From ff7acb3890943447294d57c71311ff2d2c74cdf3 Mon Sep 17 00:00:00 2001 From: Magnus Manske Date: Sun, 12 Jun 2005 14:11:29 +0000 Subject: [PATCH] Validation feature misc updates --- includes/SpecialValidate.php | 23 +++++++++++++++++------ languages/Language.php | 2 ++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/includes/SpecialValidate.php b/includes/SpecialValidate.php index 8e9f2978bb..95faabf456 100644 --- a/includes/SpecialValidate.php +++ b/includes/SpecialValidate.php @@ -320,6 +320,16 @@ class Validation { $metadata .= " : \"" . htmlspecialchars( $x->rev_comment ) . "\""; return $metadata; } + + # Generates a link to the topic description + function linkTopic ( $s ) { + $t = Title::newFromText ( wfMsg ( 'val_topic_desc_page' ) ) ; + $r = "getLocalURL () ; + $r .= "#" . urlencode ( $s ) ; + $r .= "\">{$s}" ; + return $r ; + } # Generates a form for a single revision function getRevisionForm( &$article, $idx, &$data, $focus = false ) { @@ -352,7 +362,7 @@ class Validation { $idx = "_{$revision}[{$x}]"; $ret .= "\n"; $ret .= ""; - $ret .= $this->topicList[$x]->val_comment; + $ret .= $this->linkTopic ( $this->topicList[$x]->val_comment ) ; $ret .= "\n"; $tlx = $this->topicList[$x]; @@ -408,7 +418,7 @@ class Validation { # Check for POST data $re = $wgRequest->getArray( 're_submit' ); - if( isset( $re ) ) { + if ( isset( $re ) ) { $id = array_keys( $re ); $id = $id[0] ; # $id is now the revision number the user clicked "OK" for $clearOldRev = $wgRequest->getVal( "re_clear_{$id}", 0 ); @@ -422,6 +432,7 @@ class Validation { } $ret .= "

" . htmlspecialchars( wfMsg( 'val_revision_changes_ok' ) ) . "

"; } + else $ret .= wfMsg ( 'val_votepage_intro' ) ; # Make sure the requested revision exists $ts = $this->rev2date[$revision]->rev_timestamp; @@ -476,7 +487,7 @@ class Validation { foreach( $this->topicList as $x => $y ) { $r .= "\n"; $r .= "" . htmlspecialchars( $y->val_type ) . "\n"; - $r .= "" . htmlspecialchars( $y->val_comment ) . "\n"; + $r .= "" . $this->linkTopic ( $y->val_comment ) . "\n"; $r .= "1 .. " . intval( $y->val_value ) . "\n"; $r .= "\n"; $r .= "\n"; @@ -537,7 +548,7 @@ class Validation { $ret .= ""; foreach( $topics as $t => $dummy ) { - $ret .= "" . htmlspecialchars( $this->topicList[$t]->val_comment ) . ""; + $ret .= "" . $this->linkTopic ( $this->topicList[$t]->val_comment ) . ""; } $ret .= "\n"; @@ -604,7 +615,7 @@ class Validation { $ret .= "\n"; $ret .= ""; foreach( $this->topicList as $x => $y ) { - $ret .= ""; + $ret .= ""; } $ret .= "\n"; foreach( $data as $ts => $y ) { @@ -674,7 +685,7 @@ class Validation { $ret .= ""; + $ret .= ""; $ret .= ""; $ret .= ""; $ret .= ""; diff --git a/languages/Language.php b/languages/Language.php index 541bc38250..04e8edd896 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1523,6 +1523,8 @@ for a newer revision, but also keep your other settings for this article in this revision, just select which option you intend to change, and merging will fill in the other options with your previous settings.', 'val_noop' => 'No opinion', +'val_topic_desc_page' => 'Wikipedia:Validation topics', +'val_votepage_intro' => '

Change this text here!

', 'val_percent' => '$1%
($2 of $3 points
by $4 users)', 'val_percent_single' => '$1%
($2 of $3 points
by one user)', 'val_total' => 'Total', -- 2.20.1
" . htmlspecialchars( wfMsg( "val_revision" ) ) . "" . htmlspecialchars( $y->val_comment ) . "" . $this->linkTopic ( $y->val_comment ) . "
"; } $initial = false; - $ret .= "" . htmlspecialchars( $this->topicList[$topic]->val_comment ) . "" . $this->linkTopic ( $this->topicList[$topic]->val_comment ) . "" . $this->getRatingText( $rating->val_value, $this->topicList[$topic]->val_value ) . "" . htmlspecialchars( $rating->val_comment ) . "