From 2195bf8355b700215ad5e2aeb481fe1c36229083 Mon Sep 17 00:00:00 2001 From: Magnus Manske Date: Thu, 17 Mar 2005 13:47:05 +0000 Subject: [PATCH] Re-establishing validation feature (the beginnings) --- includes/Article.php | 9 +++++++++ includes/Defines.php | 2 +- includes/SkinTemplate.php | 11 ++++++++++- index.php | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 3f995d448a..e68a8893c3 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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 diff --git a/includes/Defines.php b/includes/Defines.php index c93ba95941..02d75dd592 100644 --- a/includes/Defines.php +++ b/includes/Defines.php @@ -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'); ?> diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index b603f1c4aa..3252809a70 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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 { diff --git a/index.php b/index.php index 0c77aec93e..47668c46e4 100644 --- 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': -- 2.20.1