* Return an array of subpages beginning with $search that this special page will accept.
*
* @param string $search Prefix to search for
- * @param integer $limit Maximum number of results to return
+ * @param int $limit Maximum number of results to return
* @return string[] Matching subpages
*/
public function prefixSearchSubpages( $search, $limit = 10 ) {
// the necessary rights.
if ( !$user->isAllowed( 'deletedhistory' ) ) {
$bitmask = LogPage::DELETED_ACTION;
- } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
+ } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
$bitmask = LogPage::DELETED_ACTION | LogPage::DELETED_RESTRICTED;
} else {
$bitmask = 0;
''
);
- wfRunHooks( 'SpecialWatchlistQuery',
- array( &$conds, &$tables, &$join_conds, &$fields, $opts ),
- '1.23' );
+ $this->runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts );
return $dbr->select(
$tables,
);
}
+ protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) {
+ return parent::runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts )
+ && wfRunHooks(
+ 'SpecialWatchlistQuery',
+ array( &$conds, &$tables, &$join_conds, &$fields, $opts ),
+ '1.23'
+ );
+ }
+
/**
* Return a DatabaseBase object for reading
*
}
/**
- * Return the text to be displayed above the changes
+ * Set the text to be displayed above the changes
*
* @param FormOptions $opts
- * @return string XHTML
+ * @param int $numRows Number of rows in the result to show after this header
*/
- public function doHeader( $opts ) {
+ public function doHeader( $opts, $numRows ) {
$user = $this->getUser();
$this->getOutput()->addSubtitle(
$wlInfo = '';
if ( $opts['days'] > 0 ) {
$timestamp = wfTimestampNow();
- $wlInfo = $this->msg( 'wlnote2' )->numParams( round( $opts['days'] * 24 ) )->params(
+ $wlInfo = $this->msg( 'wlnote' )->numParams( $numRows, round( $opts['days'] * 24 ) )->params(
$lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user )
)->parse() . "<br />\n";
}