X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecialpage%2FChangesListSpecialPage.php;h=c28aa86776123021d25986fb4a2ad54f8bda7b0f;hb=cba15a69aec2945cea2dc799750858576e015087;hp=008200d45c18197a42bbd03d442895a6e908a883;hpb=c825102577e9552f37b94ae5c74a148dd6acf158;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index 008200d45c..c28aa86776 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -53,7 +53,8 @@ abstract class ChangesListSpecialPage extends SpecialPage { $opts = $this->getOptions(); if ( $rows === false ) { if ( !$this->including() ) { - $this->doHeader( $opts ); + $this->doHeader( $opts, 0 ); + $this->getOutput()->setStatusCode( 404 ); } return; @@ -290,8 +291,8 @@ abstract class ChangesListSpecialPage extends SpecialPage { '' ); - if ( !wfRunHooks( 'ChangesListSpecialPageQuery', - array( $this->getName(), &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) ) + if ( !$this->runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, + $opts ) ) { return false; } @@ -308,6 +309,13 @@ abstract class ChangesListSpecialPage extends SpecialPage { ); } + protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) { + return wfRunHooks( + 'ChangesListSpecialPageQuery', + array( $this->getName(), &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) + ); + } + /** * Return a DatabaseBase object for reading * @@ -326,7 +334,7 @@ abstract class ChangesListSpecialPage extends SpecialPage { public function webOutput( $rows, $opts ) { if ( !$this->including() ) { $this->outputFeedLinks(); - $this->doHeader( $opts ); + $this->doHeader( $opts, $rows->numRows() ); } $this->outputChangesList( $rows, $opts ); @@ -351,8 +359,9 @@ abstract class ChangesListSpecialPage extends SpecialPage { * Set the text to be displayed above the changes * * @param FormOptions $opts + * @param int $numRows Number of rows in the result to show after this header */ - public function doHeader( $opts ) { + public function doHeader( $opts, $numRows ) { $this->setTopText( $opts ); // @todo Lots of stuff should be done here. @@ -401,12 +410,11 @@ abstract class ChangesListSpecialPage extends SpecialPage { * @return string */ public static function makeLegend( IContextSource $context ) { - global $wgRecentChangesFlags; $user = $context->getUser(); # The legend showing what the letters and stuff mean $legend = Html::openElement( 'dl' ) . "\n"; # Iterates through them and gets the messages for both letter and tooltip - $legendItems = $wgRecentChangesFlags; + $legendItems = $context->getConfig()->get( 'RecentChangesFlags' ); if ( !( $user->useRCPatrol() || $user->useNPPatrol() ) ) { unset( $legendItems['unpatrolled'] ); }