X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecialpage%2FChangesListSpecialPage.php;h=c1c16854a0ccd74059e77f32da501a4ef2e2dd09;hb=9cd114f3800e1f3e62a9bf6467f1881b0d781588;hp=cb1384052864dd0fc5202f0986a6984e843bf3cc;hpb=a53df045423dcc78bf9662cf325a6238931b09d0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index cb13840528..c1c16854a0 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -150,6 +150,9 @@ abstract class ChangesListSpecialPage extends SpecialPage { if ( $config->get( 'RCWatchCategoryMembership' ) ) { $opts->add( 'hidecategorization', false ); } + $opts->add( 'hidepageedits', false ); + $opts->add( 'hidenewpages', false ); + $opts->add( 'hidelog', false ); $opts->add( 'namespace', '', FormOptions::INTNULL ); $opts->add( 'invert', false ); @@ -269,6 +272,15 @@ abstract class ChangesListSpecialPage extends SpecialPage { ) { $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_CATEGORIZE ); } + if ( $opts['hidepageedits'] ) { + $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_EDIT ); + } + if ( $opts['hidenewpages'] ) { + $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_NEW ); + } + if ( $opts['hidelog'] ) { + $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_LOG ); + } // Namespace filtering if ( $opts['namespace'] !== '' ) { @@ -495,4 +507,23 @@ abstract class ChangesListSpecialPage extends SpecialPage { protected function getGroupName() { return 'changes'; } + + /** + * Get filters that can be rendered. + * + * Filters with 'msg' => false can be used to filter data but won't + * be presented as show/hide toggles in the UI. They are not returned + * by this function. + * + * @param array $allFilters Map of filter URL param names to properties (msg/default) + * @return array Map of filter URL param names to properties (msg/default) + */ + protected function getRenderableCustomFilters( $allFilters ) { + return array_filter( + $allFilters, + function( $filter ) { + return isset( $filter['msg'] ) && ( $filter['msg'] !== false ); + } + ); + } }