Tell regexp parser to use extra analysis on external link regexp;
[lhc/web/wiklou.git] / includes / SpecialRecentchangeslinked.php
index e14ae9b..6a86012 100644 (file)
@@ -1,19 +1,22 @@
 <?php
 /**
- *
+ * This is to display changes made to all articles linked in an article.
+ * @package MediaWiki
+ * @subpackage SpecialPage
  */
 
 /**
  *
  */
-require_once( "SpecialRecentchanges.php" );
+require_once( 'SpecialRecentchanges.php' );
 
 /**
- * constructor
+ * Entrypoint
+ * @param string $par parent page we will look at
  */
 function wfSpecialRecentchangeslinked( $par = NULL ) {
-       global $wgUser, $wgOut, $wgLang, $wgTitle, $wgRequest;
-       $fname = "wfSpecialRecentchangeslinked";
+       global $wgUser, $wgOut, $wgLang, $wgContLang, $wgTitle, $wgRequest;
+       $fname = 'wfSpecialRecentchangeslinked';
 
        $days = $wgRequest->getInt( 'days' );
        $target = $wgRequest->getText( 'target' );
@@ -25,42 +28,42 @@ function wfSpecialRecentchangeslinked( $par = NULL ) {
        if( $par ) {
                $target = $par;
        }
-       if ( "" == $target ) {
-               $wgOut->errorpage( "notargettitle", "notargettext" );
+       if ( $target == '') {
+               $wgOut->errorpage( 'notargettitle', 'notargettext' );
                return;
        }
        $nt = Title::newFromURL( $target );
        if( !$nt ) {
-               $wgOut->errorpage( "notargettitle", "notargettext" );
+               $wgOut->errorpage( 'notargettitle', 'notargettext' );
                return;
        }
        $id = $nt->getArticleId();
        
-       $wgOut->setSubtitle( wfMsg( "rclsub", $nt->getPrefixedText() ) );
+       $wgOut->setSubtitle( wfMsg( 'rclsub', $nt->getPrefixedText() ) );
 
        if ( ! $days ) {
-               $days = $wgUser->getOption( "rcdays" );
+               $days = $wgUser->getOption( 'rcdays' );
                if ( ! $days ) { $days = 7; }
        }
        $days = (int)$days;
-       list( $limit, $offset ) = wfCheckLimits( 100, "rclimit" );
+       list( $limit, $offset ) = wfCheckLimits( 100, 'rclimit' );
 
        $dbr =& wfGetDB( DB_SLAVE );
        $cutoff = $dbr->timestamp( time() - ( $days * 86400 ) );
 
        $hideminor = ($hideminor ? 1 : 0);
        if ( $hideminor ) {
-               $mlink = $sk->makeKnownLink( $wgLang->specialPage( "Recentchangeslinked" ),
-                 WfMsg( "show" ), "target=" . htmlspecialchars( $nt->getPrefixedURL() ) .
+               $mlink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchangeslinked' ),
+                 WfMsg( 'show' ), 'target=' . htmlspecialchars( $nt->getPrefixedURL() ) .
                  "&days={$days}&limit={$limit}&hideminor=0" );
        } else {
-               $mlink = $sk->makeKnownLink( $wgLang->specialPage( "Recentchangeslinked" ),
+               $mlink = $sk->makeKnownLink( $wgContLang->specialPage( "Recentchangeslinked" ),
                  WfMsg( "hide" ), "target=" . htmlspecialchars( $nt->getPrefixedURL() ) .
                  "&days={$days}&limit={$limit}&hideminor=1" );
        }
        if ( $hideminor ) {
-               $cmq = "AND cur_minor_edit=0";
-       } else { $cmq = ""; }
+               $cmq = 'AND cur_minor_edit=0';
+       } else { $cmq = ''; }
 
        extract( $dbr->tableNames( 'cur', 'links' ) );
 
@@ -79,9 +82,10 @@ function wfSpecialRecentchangeslinked( $par = NULL ) {
                                  "target=" . $nt->getPrefixedURL() . "&hideminor={$hideminor}",
                                  false, $mlink );
 
-       $wgOut->addHTML( "{$note}\n" );
+       $wgOut->addHTML( $note."\n" );
 
-       $s = $sk->beginRecentChangesList();
+       $list =& new ChangesList( $sk );
+       $s = $list->beginRecentChangesList();
        $count = $dbr->numRows( $res );
        
        $counter = 1;
@@ -92,10 +96,10 @@ function wfSpecialRecentchangeslinked( $par = NULL ) {
 
                $rc = RecentChange::newFromCurRow( $obj );
                $rc->counter = $counter++;
-               $s .= $sk->recentChangesLine( $rc );
+               $s .= $list->recentChangesLine( $rc );
                --$limit;
        }
-       $s .= $sk->endRecentChangesList();
+       $s .= $list->endRecentChangesList();
 
        $dbr->freeResult( $res );
        $wgOut->addHTML( $s );