*/
protected function getCustomFilters() {
if ( $this->customFilters === null ) {
- $this->customFilters = array();
- Hooks::run( 'ChangesListSpecialPageFilters', array( $this, &$this->customFilters ) );
+ $this->customFilters = [];
+ Hooks::run( 'ChangesListSpecialPageFilters', [ $this, &$this->customFilters ] );
}
return $this->customFilters;
public function buildMainQueryConds( FormOptions $opts ) {
$dbr = $this->getDB();
$user = $this->getUser();
- $conds = array();
+ $conds = [];
// It makes no sense to hide both anons and logged-in users. When this occurs, try a guess on
// what the user meant and either show only bots or force anons to be shown.
$conds[] = 'rc_user_text != ' . $dbr->addQuotes( $user->getName() );
}
}
- if ( $opts['hidecategorization'] === true ) {
+ if ( $this->getConfig()->get( 'RCWatchCategoryMembership' )
+ && $opts['hidecategorization'] === true
+ ) {
$conds[] = 'rc_type != ' . $dbr->addQuotes( RC_CATEGORIZE );
}
* @return bool|ResultWrapper Result or false
*/
public function doMainQuery( $conds, $opts ) {
- $tables = array( 'recentchanges' );
+ $tables = [ 'recentchanges' ];
$fields = RecentChange::selectFields();
- $query_options = array();
- $join_conds = array();
+ $query_options = [];
+ $join_conds = [];
ChangeTags::modifyDisplayQuery(
$tables,
) {
return Hooks::run(
'ChangesListSpecialPageQuery',
- array( $this->getName(), &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts )
+ [ $this->getName(), &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ]
);
}
* @return array
*/
public function getExtraOptions( $opts ) {
- return array();
+ return [];
}
/**
* Return the legend displayed within the fieldset
- * @todo This should not be static, then we can drop the parameter
- * @todo Not called by anything, should be called by doHeader()
*
- * @param IContextSource $context The object available as $this in non-static functions
* @return string
*/
- public static function makeLegend( IContextSource $context ) {
+ public function makeLegend() {
+ $context = $this->getContext();
$user = $context->getUser();
# The legend showing what the letters and stuff mean
$legend = Html::openElement( 'dl' ) . "\n";
$cssClass = isset( $item['class'] ) ? $item['class'] : $key;
$legend .= Html::element( 'dt',
- array( 'class' => $cssClass ), $context->msg( $letter )->text()
+ [ 'class' => $cssClass ], $context->msg( $letter )->text()
) . "\n" .
Html::rawElement( 'dd',
- array( 'class' => Sanitizer::escapeClass( 'mw-changeslist-legend-' . $key ) ),
+ [ 'class' => Sanitizer::escapeClass( 'mw-changeslist-legend-' . $key ) ],
$context->msg( $label )->parse()
) . "\n";
}
# (+-123)
$legend .= Html::rawElement( 'dt',
- array( 'class' => 'mw-plusminus-pos' ),
+ [ 'class' => 'mw-plusminus-pos' ],
$context->msg( 'recentchanges-legend-plusminus' )->parse()
) . "\n";
$legend .= Html::element(
'dd',
- array( 'class' => 'mw-changeslist-legend-plusminus' ),
+ [ 'class' => 'mw-changeslist-legend-plusminus' ],
$context->msg( 'recentchanges-label-plusminus' )->text()
) . "\n";
$legend .= Html::closeElement( 'dl' ) . "\n";