Remove validate bits
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index c54f7f1..2e89518 100644 (file)
@@ -473,7 +473,7 @@ class SkinTemplate extends Skin {
                $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' );
@@ -484,10 +484,16 @@ class SkinTemplate extends Skin {
 
                        $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" );
@@ -617,17 +623,6 @@ class SkinTemplate extends Skin {
                                }
                        }
 
-                       # Show validate tab
-                       if ( $wgUseValidation && $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
-                               global $wgArticle ;
-                               $article_time = "&timestamp=" . $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 */
 
@@ -818,7 +813,7 @@ class SkinTemplate extends Skin {
                        $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 {
@@ -857,7 +852,7 @@ class SkinTemplate extends Skin {
                $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 {