Merge "Fixed a path issue in NoLocalSettings"
[lhc/web/wiklou.git] / includes / specials / SpecialWatchlist.php
index 7becfaa..df9d363 100644 (file)
@@ -79,22 +79,16 @@ class SpecialWatchlist extends ChangesListSpecialPage {
        }
 
        /**
-        * Return an array of subpages beginning with $search that this special page will accept.
+        * Return an array of subpages that this special page will accept.
         *
-        * @param string $search Prefix to search for
-        * @param int $limit Maximum number of results to return
-        * @return string[] Matching subpages
+        * @see also SpecialEditWatchlist::getSubpagesForPrefixSearch
+        * @return string[] subpages
         */
-       public function prefixSearchSubpages( $search, $limit = 10 ) {
-               // See also SpecialEditWatchlist::prefixSearchSubpages
-               return self::prefixSearchArray(
-                       $search,
-                       $limit,
-                       array(
-                               'clear',
-                               'edit',
-                               'raw',
-                       )
+       public function getSubpagesForPrefixSearch() {
+               return array(
+                       'clear',
+                       'edit',
+                       'raw',
                );
        }
 
@@ -129,7 +123,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
        protected function getCustomFilters() {
                if ( $this->customFilters === null ) {
                        $this->customFilters = parent::getCustomFilters();
-                       wfRunHooks( 'SpecialWatchlistFilters', array( $this, &$this->customFilters ), '1.23' );
+                       Hooks::run( 'SpecialWatchlistFilters', array( $this, &$this->customFilters ), '1.23' );
                }
 
                return $this->customFilters;
@@ -207,7 +201,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                } else {
                        # Top log Ids for a page are not stored
                        $nonRevisionTypes = array( RC_LOG );
-                       wfRunHooks( 'SpecialWatchlistGetNonRevisionTypes', array( &$nonRevisionTypes ) );
+                       Hooks::run( 'SpecialWatchlistGetNonRevisionTypes', array( &$nonRevisionTypes ) );
                        if ( $nonRevisionTypes ) {
                                $conds[] = $dbr->makeList(
                                        array(
@@ -288,9 +282,11 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                );
        }
 
-       protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) {
+       protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options,
+               &$join_conds, $opts
+       ) {
                return parent::runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts )
-                       && wfRunHooks(
+                       && Hooks::run(
                                'SpecialWatchlistQuery',
                                array( &$conds, &$tables, &$join_conds, &$fields, $opts ),
                                '1.23'
@@ -298,9 +294,9 @@ class SpecialWatchlist extends ChangesListSpecialPage {
        }
 
        /**
-        * Return a DatabaseBase object for reading
+        * Return a IDatabase object for reading
         *
-        * @return DatabaseBase
+        * @return IDatabase
         */
        protected function getDB() {
                return wfGetDB( DB_SLAVE, 'watchlist' );
@@ -367,7 +363,9 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                                $updated = false;
                        }
 
-                       if ( $this->getConfig()->get( 'RCShowWatchingUsers' ) && $user->getOption( 'shownumberswatching' ) ) {
+                       if ( $this->getConfig()->get( 'RCShowWatchingUsers' )
+                               && $user->getOption( 'shownumberswatching' )
+                       ) {
                                $rc->numberofWatchingusers = $dbr->selectField( 'watchlist',
                                        'COUNT(*)',
                                        array(
@@ -430,7 +428,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                        $filters[$key] = $params['msg'];
                }
                // Disable some if needed
-               if ( !$user->useNPPatrol() ) {
+               if ( !$user->useRCPatrol() ) {
                        unset( $filters['hidepatrolled'] );
                }
 
@@ -503,7 +501,9 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                        $form .= $this->msg( 'nowatchlist' )->parse() . "\n";
                } else {
                        $form .= $this->msg( 'watchlist-details' )->numParams( $numItems )->parse() . "\n";
-                       if ( $this->getConfig()->get( 'EnotifWatchlist' ) && $user->getOption( 'enotifwatchlistpages' ) ) {
+                       if ( $this->getConfig()->get( 'EnotifWatchlist' )
+                               && $user->getOption( 'enotifwatchlistpages' )
+                       ) {
                                $form .= $this->msg( 'wlheader-enotif' )->parse() . "\n";
                        }
                        if ( $showUpdatedMarker ) {
@@ -601,7 +601,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
        /**
         * Count the number of items on a user's watchlist
         *
-        * @param DatabaseBase $dbr A database connection
+        * @param IDatabase $dbr A database connection
         * @return int
         */
        protected function countItems( $dbr ) {