# Note: edit user interface and cache support functions have been
# moved to separate EditPage and CacheManager classes.
-require_once( 'CacheManager.php' );
+require_once ( 'CacheManager.php' );
+include_once ( 'SpecialValidate.php' ) ;
$wgArticleCurContentFields = false;
$wgArticleOldContentFields = false;
$wgOut->redirect( $this->mTitle->getFullURL( $r ).$sectionanchor );
}
+ # Validate article
+
+ function validate ()
+ {
+ global $wgOut ;
+ $v = new Validation ;
+ $html = $v->validate_form ( $this->mTitle->getDBkey() ) ;
+ $wgOut->setPagetitle( wfMsg( 'validate' ) . " : " . $this->mTitle->getText() );
+ $wgOut->setRobotpolicy( 'noindex,follow' );
+ $wgOut->addHTML( $html ) ;
+ }
+
# Add this page to my watchlist
function watch( $add = true )
'href' => $this->makeUrl($this->thispage, 'action=unwatch'));
}
}
+
+ if ( $wgUser->getID() != 0 && $wgTitle->getArticleId() ) {
+ $content_actions['validate'] = array('class' => ($action == 'validate') ? 'selected' : false ,
+ 'text' => wfMsg('val_tab'),
+ 'href' => $this->makeUrl($this->thispage, 'action=validate'));
+ }
+
} else {
/* show special page tab */
{
global $wgOut, $wgLang, $wgUser;
if ( $wgUser->getID() == 0 ) return ; # Anon
- if ( $article_title == "" ) $article_title = $_GET['article'] ;
+ if ( $article_title == "" )
+ {
+ $article_title = $_GET['article'] ;
+ $heading = "<h1>" . $article->getPrefixedText() . "</h1>\n" ;
+ }
+ else $heading = "" ;
$article_time = "" ;
if ( isset ( $_GET['timestamp'] ) ) $article_time = $_GET['timestamp'] ;
$article = Title::newFromText ( $article_title ) ;
}
# Generating HTML
- $html = "<h1>" . $article->getPrefixedText() . "</h1>\n" ;
+ $html = $heading ;
foreach ( $val AS $time => $stuff )
{
if ( $time == $article_time ) $html .= "<h2>This version</h2>\n" ;
case "rollback":
case "protect":
case "unprotect":
+ case "validate":
case "info":
$wgArticle->$action();
break;
'val_clear_old' => 'Clear my other validation data for the <a href="$1">$2</a> article',
'val_noop' => 'No opinion',
'val_percent' => '<b>$1%</b> ($2 of $3 points)',
+'val_tab' => 'Validate',
# Move page
#