+
+ function showDetails ( &$article , $revision ) {
+ global $wgDBprefix , $wgOut ;
+ $this->prepareRevisions ( $article->getID() ) ;
+ $this->topicList = $this->getTopicList() ;
+
+ $title = $article->getTitle() ;
+ $wgOut->setPageTitle ( str_replace ( '$1' , $title->getPrefixedText() , wfMsg ( 'val_validation_of' ) ) ) ;
+
+ # Collecting statistic data
+ $id = $article->getID() ;
+ $sql = "SELECT * FROM {$wgDBprefix}validate WHERE val_page='{$id}' AND val_revision='{$revision}'" ;
+ $res = wfQuery( $sql, DB_READ );
+ $data = array () ;
+ $users = array () ;
+ $topics = array () ;
+ while( $x = wfFetchObject( $res ) ) {
+ $data[$x->val_user][$x->val_type] = $x ;
+ $users[$x->val_user] = true ;
+ $topics[$x->val_type] = true ;
+ }
+
+ # Sorting lists of topics and users
+ ksort ( $users ) ;
+ ksort ( $topics ) ;
+
+ $ts = $this->getTimestamp ( $revision ) ;
+ $url = $this->getVersionLink ( $article , $revision , wfTimestamp ( TS_DB , $ts ) ) ;
+
+ # Table headers
+ $ret = "" ;
+ $ret .= "<p><b>" . str_replace ( '$1' , $url , wfMsg ( 'val_revision_of' ) ) . "</b></p>\n" ;
+ $ret .= "<table border='1' cellspacing='0' cellpadding='2'>\n" ;
+ $ret .= "<tr><th/>" ;
+
+ foreach ( $topics AS $t => $dummy ) {
+ $ret .= "<th>" . $this->topicList[$t]->val_comment . "</th>" ;
+ }
+ $ret .= "</tr>\n" ;
+
+ # Table data
+ foreach ( $users AS $u => $dummy ) { # Every row a user
+ $ret .= "<tr>" ;
+ $ret .= "<th>" . str_replace ( "$1" , $u , wfMsg ( 'val_details_th_user') ) . "</th>" ;
+ foreach ( $topics AS $t => $dummy ) { # Every column a topic
+ if ( !isset ( $data[$u][$t] ) ) $ret .= "<td/>" ;
+ else {
+ $ret .= "<td valign='center'>" ;
+ $ret .= $data[$u][$t]->val_value ;
+ if ( $data[$u][$t]->val_comment != "" )
+ $ret .= " <small>(" . $data[$u][$t]->val_comment . ")</small>" ;
+ $ret .= "</td>" ;
+ }
+ }
+ $ret .= "</tr>" ;
+ }
+ $ret .= "</table>" ;
+ $ret .= "<p>" . $this->link2statistics ( $article ) . "</p>" ;
+
+ return $ret ;
+ }