X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialRecentchanges.php;h=cb2f42009ce51a30ada28c36a88567cbce45cae6;hb=a3da44c7df29ecab2edfa2a36594c7fcb80b2e02;hp=7cc0dc6d10bfb866f0959630ade72f80e1f06375;hpb=8a4a8a8dcbaf454c9f64cd8b5ba90704d7721500;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 7cc0dc6d10..cb2f42009c 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -22,7 +22,7 @@ */ use MediaWiki\MediaWikiServices; -use Wikimedia\Rdbms\ResultWrapper; +use Wikimedia\Rdbms\IResultWrapper; use Wikimedia\Rdbms\FakeResultWrapper; /** @@ -220,20 +220,6 @@ class SpecialRecentChanges extends ChangesListSpecialPage { } } - /** - * Get a FormOptions object containing the default options - * - * @return FormOptions - */ - public function getDefaultOptions() { - $opts = parent::getDefaultOptions(); - - $opts->add( 'categories', '' ); - $opts->add( 'categories_any', false ); - - return $opts; - } - /** * Get all custom filters * @@ -359,11 +345,6 @@ class SpecialRecentChanges extends ChangesListSpecialPage { $join_conds ); - // Build the final data - if ( $this->getConfig()->get( 'AllowCategorizedRecentChanges' ) ) { - $this->filterByCategories( $rows, $opts ); - } - return $rows; } @@ -408,7 +389,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage { /** * Build and output the actual changes list. * - * @param ResultWrapper $rows Database rows + * @param IResultWrapper $rows Database rows * @param FormOptions $opts */ public function outputChangesList( $rows, $opts ) { @@ -667,16 +648,12 @@ class SpecialRecentChanges extends ChangesListSpecialPage { */ function getExtraOptions( $opts ) { $opts->consumeValues( [ - 'namespace', 'invert', 'associated', 'tagfilter', 'categories', 'categories_any' + 'namespace', 'invert', 'associated', 'tagfilter' ] ); $extraOpts = []; $extraOpts['namespace'] = $this->namespaceFilterForm( $opts ); - if ( $this->getConfig()->get( 'AllowCategorizedRecentChanges' ) ) { - $extraOpts['category'] = $this->categoryFilterForm( $opts ); - } - $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'], false, $this->getContext() ); if ( count( $tagFilter ) ) { @@ -709,7 +686,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage { */ public function checkLastModified() { $dbr = $this->getDB(); - $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __METHOD__ ); + $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', '', __METHOD__ ); return $lastmod; } @@ -740,29 +717,17 @@ class SpecialRecentChanges extends ChangesListSpecialPage { return [ $nsLabel, "$nsSelect $invert $associated" ]; } - /** - * Create an input to filter changes by categories - * - * @param FormOptions $opts - * @return array - */ - protected function categoryFilterForm( FormOptions $opts ) { - list( $label, $input ) = Xml::inputLabelSep( $this->msg( 'rc_categories' )->text(), - 'categories', 'mw-categories', false, $opts['categories'] ); - - $input .= ' ' . Xml::checkLabel( $this->msg( 'rc_categories_any' )->text(), - 'categories_any', 'mw-categories_any', $opts['categories_any'] ); - - return [ $label, $input ]; - } - /** * Filter $rows by categories set in $opts * - * @param ResultWrapper &$rows Database rows + * @deprecated since 1.31 + * + * @param IResultWrapper &$rows Database rows * @param FormOptions $opts */ function filterByCategories( &$rows, FormOptions $opts ) { + wfDeprecated( __METHOD__, '1.31' ); + $categories = array_map( 'trim', explode( '|', $opts['categories'] ) ); if ( !count( $categories ) ) {