From 0362dd417144ecbfcc0e376ce16415b834492b9e Mon Sep 17 00:00:00 2001 From: Magnus Manske Date: Sat, 31 Jul 2004 18:43:42 +0000 Subject: [PATCH] Article validation code (version links on validation page) --- includes/SpecialValidate.php | 18 +++++++++++++++--- languages/Language.php | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/includes/SpecialValidate.php b/includes/SpecialValidate.php index 1e78b5bd31..0c56b6fb66 100644 --- a/includes/SpecialValidate.php +++ b/includes/SpecialValidate.php @@ -23,6 +23,7 @@ class Validation function find_this_version ( $article_title , &$article_time , &$id , &$tab ) { $id = "" ; + $tab = "" ; $sql = "SELECT cur_id,cur_timestamp FROM cur WHERE cur_namespace=0 AND cur_title='{$article_title}'" ; $res = wfQuery( $sql, DB_READ ); if( $s = wfFetchObject( $res ) ) @@ -174,7 +175,10 @@ class Validation { $tablestyle = "cellspacing=0 cellpadding=2" ; if ( $article_time == $time ) $tablestyle .=" style='border: 2px solid red'" ; - $html .= str_replace ( "$1" , gmdate("F d, Y H:i:s",wfTimestamp2Unix($time)) , wfMsg("val_version_of") ) ; + $html .= "

" . str_replace ( "$1" , gmdate("F d, Y H:i:s",wfTimestamp2Unix($time)) , wfMsg("val_version_of") ) ; + $this->find_this_version ( $article_title , $time , $table_id , $table_name ) ; + if ( $table_name == "cur" ) $html .= " (" . wfMsg ( 'val_this_is_current_version' ) . ")" ; + $html .= "

\n" ; $html .= "
\n" ; $html .= "" ; $html .= "\n" ; @@ -200,13 +204,21 @@ class Validation $html .= "" ; $html .= "\n" ; } - $html .= "" ; - $html .= "
" ; + $html .= "
" ; + + # link to version + $title = Title::newFromDBkey ( $article_title ) ; + if ( $table_name == "cur" ) $link_version = $title->getLocalURL( "" ) ; + else $link_version = $title->getLocalURL( "oldid={$table_id}" ) ; + $link_version = "" . wfMsg ( 'val_view_version' ) . "" ; + $html .= $link_version ; + $html .= "" ; $html .= "" ; $html .= wfMsg ( 'val_merge_old' ); $html .= "
" ; $html .= wfMsg ( 'val_clear_old', $skin->makeKnownLinkObj( $article ) ); $html .= "
\n" ; + $html .= "\n" ; } global $wgArticle ; diff --git a/languages/Language.php b/languages/Language.php index 20453348e5..2a8085d896 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1274,8 +1274,8 @@ merging will fill in the other options with your previous settings.', 'val_total' => 'Total', 'val_version' => 'Version', 'val_tab' => 'Validate', -'val_this_version' => "

This version

\n", -'val_version_of' => "

Version of $1

\n" , +'val_this_is_current_version' => 'this is the latest version', +'val_version_of' => "Version of $1" , 'val_table_header' => "Class$1Opinion$1Comment\n", 'val_stat_link_text' => 'Validation statistics for this article', 'val_view_version' => 'View this version', -- 2.20.1