}
}
- /**
- * 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
*
$join_conds
);
- // Build the final data
- if ( $this->getConfig()->get( 'AllowCategorizedRecentChanges' ) ) {
- $this->filterByCategories( $rows, $opts );
- }
-
return $rows;
}
*/
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 ) ) {
*/
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;
}
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
*
+ * @deprecated since 1.31
+ *
* @param ResultWrapper &$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 ) ) {
/**
* Makes change an option link which carries all the other options
*
- * @param string $title Title
+ * @param string $title
* @param array $override Options to override
* @param array $options Current options
* @param bool $active Whether to show the link in bold