Split off page history code to PageHistory.php out of Article.php and Skin.php.
[lhc/web/wiklou.git] / includes / Article.php
index 56ec140..470fffd 100644 (file)
@@ -597,79 +597,6 @@ class Article {
                $this->watch( false );
        }
 
-       # This shares a lot of issues (and code) with Recent Changes
-
-       function history()
-       {
-               global $wgUser, $wgOut, $wgLang, $offset, $limit;
-
-               # If page hasn't changed, client can cache this
-               
-               if( $wgOut->checkLastModified( $this->getTimestamp() ) ){
-                       # Client cache fresh and headers sent, nothing more to do.
-                       return;
-               }
-               $fname = "Article::history";
-               wfProfileIn( $fname );
-
-               $wgOut->setPageTitle( $this->mTitle->getPRefixedText() );
-               $wgOut->setSubtitle( wfMsg( "revhistory" ) );
-               $wgOut->setArticleFlag( false );
-               $wgOut->setRobotpolicy( "noindex,nofollow" );
-
-               if( $this->mTitle->getArticleID() == 0 ) {
-                       $wgOut->addHTML( wfMsg( "nohistory" ) );
-                       wfProfileOut( $fname );
-                       return;
-               }
-               
-               $offset = (int)$offset;
-               $limit = (int)$limit;
-               if( $limit == 0 ) $limit = 50;
-               $namespace = $this->mTitle->getNamespace();
-               $title = $this->mTitle->getText();
-               $sql = "SELECT old_id,old_user," .
-                 "old_comment,old_user_text,old_timestamp,old_minor_edit ".
-                 "FROM old USE INDEX (name_title_timestamp) " .
-                 "WHERE old_namespace={$namespace} AND " .
-                 "old_title='" . wfStrencode( $this->mTitle->getDBkey() ) . "' " .
-                 "ORDER BY inverse_timestamp LIMIT $offset, $limit";
-               $res = wfQuery( $sql, DB_READ, "Article::history" );
-
-               $revs = wfNumRows( $res );
-               if( $this->mTitle->getArticleID() == 0 ) {
-                       $wgOut->addHTML( wfMsg( "nohistory" ) );
-                       wfProfileOut( $fname );
-                       return;
-               }
-               
-               $sk = $wgUser->getSkin();
-               $numbar = wfViewPrevNext(
-                       $offset, $limit,
-                       $this->mTitle->getPrefixedText(),
-                       "action=history" );
-               $s = $numbar;
-               $s .= $sk->beginHistoryList();
-
-               if($offset == 0 )
-               $s .= $sk->historyLine( $this->getTimestamp(), $this->getUser(),
-                 $this->getUserText(), $namespace,
-                 $title, 0, $this->getComment(),
-                 ( $this->getMinorEdit() > 0 ) );
-
-               $revs = wfNumRows( $res );
-               while ( $line = wfFetchObject( $res ) ) {
-                       $s .= $sk->historyLine( $line->old_timestamp, $line->old_user,
-                         $line->old_user_text, $namespace,
-                         $title, $line->old_id,
-                         $line->old_comment, ( $line->old_minor_edit > 0 ) );
-               }
-               $s .= $sk->endHistoryList();
-               $s .= $numbar;
-               $wgOut->addHTML( $s );
-               wfProfileOut( $fname );
-       }
-
        function protect( $limit = "sysop" )
        {
                global $wgUser, $wgOut;