Re-establishing validation feature (the beginnings)
authorMagnus Manske <magnusmanske@users.mediawiki.org>
Thu, 17 Mar 2005 13:47:05 +0000 (13:47 +0000)
committerMagnus Manske <magnusmanske@users.mediawiki.org>
Thu, 17 Mar 2005 13:47:05 +0000 (13:47 +0000)
includes/Article.php
includes/Defines.php
includes/SkinTemplate.php
index.php

index 3f995d4..e68a889 100644 (file)
@@ -1207,6 +1207,15 @@ class Article {
                }
        }
 
+       /**
+        * Validate function
+        */
+       function validate() {
+               global $wgOut, $wgUser;
+               $wgOut->setRobotpolicy( 'noindex,follow' );
+               
+               $wgOut->addWikiText ( "Not implemented yet" ) ;
+       }
 
        /**
         * Add this page to $wgUser's watchlist
index c93ba95..02d75dd 100644 (file)
@@ -83,6 +83,6 @@ define( 'MW_MATH_MATHML', 5 );
  */
 $wgAvailableRights = array('read', 'edit', 'move', 'delete', 'undelete',
 'protect', 'block', 'userrights', 'grouprights', 'createaccount', 'upload',
-'asksql', 'rollback', 'patrol', 'editinterface', 'siteadmin', 'bot');
+'asksql', 'rollback', 'patrol', 'editinterface', 'siteadmin', 'bot', 'validate');
 
 ?>
index b603f1c..3252809 100644 (file)
@@ -488,7 +488,7 @@ class SkinTemplate extends Skin {
         * @access private
         */
        function buildContentActionUrls () {
-               global $wgContLang;
+               global $wgContLang, $wgUseValidation;
                $fname = 'SkinTemplate::buildContentActionUrls';
                wfProfileIn( $fname );
                
@@ -583,6 +583,7 @@ class SkinTemplate extends Skin {
                                                );
                                        }
                                }
+                               }
                        } else {
                                //article doesn't exist or is deleted
                                if($wgUser->isAllowed('delete')){
@@ -611,6 +612,14 @@ class SkinTemplate extends Skin {
                                                'href' => $this->mTitle->getLocalUrl( 'action=unwatch' )
                                        );
                                }
+
+                       # Validate tab. TODO: add validation to logged-in user rights 
+                       if($wgUseValidation){ # && $wgUser->isAllowed('validate')){
+                               $content_actions['validate'] = array(
+                                       'class' => ($action == 'validate') ? 'selected' : false,
+                                       'text' => wfMsg('val_tab'),
+                                       'href' => $this->mTitle->getLocalUrl( 'action=validate' )
+                               );
                        }
 
                } else {
index 0c77aec..47668c4 100644 (file)
--- a/index.php
+++ b/index.php
@@ -135,6 +135,7 @@ if( !$wgDisableInternalSearch && !is_null( $search ) && $search !== '' ) {
                case 'unprotect':
                case 'info':
                case 'markpatrolled':
+               case 'validate':
                        $wgArticle->$action();
                        break;
                case 'print':