$fname = 'SkinTemplate::buildContentActionUrls';
wfProfileIn( $fname );
- global $wgTitle, $wgUser, $wgRequest, $wgUseValidation;
+ global $wgTitle, $wgUser, $wgRequest;
$action = $wgRequest->getText( 'action' );
$section = $wgRequest->getText( 'section' );
$oldid = $wgRequest->getVal( 'oldid' );
$nskey = $this->getNameSpaceKey();
$is_active = !Namespace::isTalk( $wgTitle->getNamespace()) ;
- if ( $action == 'validate' ) $is_active = false ; # Show article tab deselected when validating
- $content_actions[$nskey] = array('class' => ($is_active) ? 'selected' : false,
- 'text' => wfMsg($nskey),
- 'href' => $this->makeArticleUrl($this->thispage));
+
+ $subjectTitle = $wgTitle->getSubjectPage();
+ if( $subjectTitle->getArticleId() != 0 ) {
+ $class = ($is_active) ? 'selected' : false;
+ } else {
+ $class = ($is_active) ? 'selected new' : 'new';
+ }
+ $content_actions[$nskey] = array('class' => $class,
+ 'text' => wfMsg($nskey),
+ 'href' => $this->makeArticleUrl($this->thispage));
/* set up the classes for the talk link */
wfProfileIn( "$fname-talk" );
}
}
- # Show validate tab
- if ( $wgUseValidation && $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
- global $wgArticle ;
- $article_time = "×tamp=" . $wgArticle->mTimestamp ;
- $content_actions['validate'] = array(
- 'class' => ($action == 'validate') ? 'selected' : false ,
- 'text' => wfMsg('val_tab'),
- 'href' => $wgTitle->getLocalUrl( 'action=validate'.$article_time)
- );
- }
-
} else {
/* show special page tab */
$action = $wgRequest->getText('action');
# if we're previewing the CSS page, use it
- if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
+ if( $wgTitle->isCssSubpage() and $this->userCanPreview( $action ) ) {
$siteargs = "&smaxage=0&maxage=0";
$usercss = $wgRequest->getText('wpTextbox1');
} else {
$action = $wgRequest->getText('action');
if( $wgAllowUserJs && $this->loggedin ) {
- if($wgTitle->isJsSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
+ if( $wgTitle->isJsSubpage() and $this->userCanPreview( $action ) ) {
# XXX: additional security check/prompt?
$this->userjsprev = '/*<![CDATA[*/ ' . $wgRequest->getText('wpTextbox1') . ' /*]]>*/';
} else {