$opts = $this->getOptions();
if ( $rows === false ) {
if ( !$this->including() ) {
- $this->doHeader( $opts );
+ $this->doHeader( $opts, 0 );
$this->getOutput()->setStatusCode( 404 );
}
''
);
- 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;
}
);
}
+ 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
*
public function webOutput( $rows, $opts ) {
if ( !$this->including() ) {
$this->outputFeedLinks();
- $this->doHeader( $opts );
+ $this->doHeader( $opts, $rows->numRows() );
}
$this->outputChangesList( $rows, $opts );
* 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.
* @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'] );
}