function validate ()
{
global $wgOut ;
- $v = new Validation ;
- $html = $v->validate_form ( $this->mTitle->getDBkey() ) ;
- $wgOut->setPagetitle( wfMsg( 'validate' ) . " : " . $this->mTitle->getText() );
+ $wgOut->setPagetitle( wfMsg( 'validate' ) . " : " . $this->mTitle->getPrefixedText() );
$wgOut->setRobotpolicy( 'noindex,follow' );
- $wgOut->addHTML( $html ) ;
+ if ( $this->mTitle->getNamespace() != 0 )
+ {
+ $wgOut->addHTML ( wfMsg ( 'val_validate_article_namespace_only' ) ) ;
+ return ;
+ }
+ $v = new Validation ;
+ $v->validate_form ( $this->mTitle->getDBkey() ) ;
}
# Add this page to my watchlist
}
}
- if ( $wgUseValidation && $wgUser->getID() != 0 && $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
+ if ( $wgUseValidation && /*$wgUser->getID() != 0 && */ $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
global $wgArticle ;
$article_time = "×tamp=" . $wgArticle->mTimestamp ;
$content_actions['validate'] = array('class' => ($action == 'validate') ? 'selected' : false ,
function validate_form ( $article_title = "" )
{
global $wgOut, $wgLang, $wgUser;
- if ( $wgUser->getID() == 0 ) return ; # Anon
+
+ if ( $wgUser->getID() == 0 ) # Anon
+ {
+ $wgOut->addHTML ( wfMsg ( 'val_no_anon_validation' ) . $this->getPageStatistics ( $article_title ) ) ;
+ return ;
+ }
+
$validationtypes = $wgLang->getValidationTypes() ;
if ( $article_title == "" )
{
if ( isset ( $_GET['timestamp'] ) ) $article_time = $_GET['timestamp'] ;
else $article_time = "" ;
$article = Title::newFromText ( $article_title ) ;
-
+
# Now we get all the "votes" for the different versions of this article for this user
$val = $this->get_prev_data ( $wgUser->getID() , $article_title ) ;
$html .= "<h2>" . wfMsg ( 'preview' ) . "</h2>" ;
$wgOut->addHTML ( $html ) ;
$wgOut->addWikiText ( $wgArticle->getContent( true ) ) ;
- return "" ;
-
-# $html .= $wgArticle->getContent( true ) ;
-# $html .= $wgArticle->view () ;
-# return $html ;
}
function getData ( $user = -1 , $title = "" , $type = -1 )
{
global $wgLang, $wgUser ;
$validationtypes = $wgLang->getValidationTypes() ;
- $article_title = $_GET['article_title'] ;
+ if ( $article_title == "" ) $article_title = $_GET['article_title'] ;
$d = $this->getData ( -1 , $article_title , -1 ) ;
if ( count ( $d ) ) $d = array_shift ( $d ) ;
else $d = array () ;
'val_view_version' => 'View this version',
'val_validate_version' => 'Validate this version',
'val_user_validations' => 'This user has validated $1 pages.',
+'val_no_anon_validation' => 'You have to be logged in to validate an article.',
+'val_validate_article_namespace_only' => 'Only articles can be validated. This page is <i>not</i> in the article namespace.',
# Move page
#