Reduced indentation levels, broke long lines.
[lhc/web/wiklou.git] / includes / specials / SpecialWatchlist.php
index 7114fc9..543c91e 100644 (file)
@@ -87,7 +87,7 @@ class SpecialWatchlist extends SpecialPage {
                                        $mode = null;
                        }
                        $title = SpecialPage::getTitleFor( 'EditWatchlist', $mode );
-                       $output->redirect( $title->getLocalUrl() );
+                       $output->redirect( $title->getLocalURL() );
                        return;
                }
 
@@ -116,7 +116,7 @@ class SpecialWatchlist extends SpecialPage {
                $this->customFilters = array();
                wfRunHooks( 'SpecialWatchlistFilters', array( $this, &$this->customFilters ) );
                foreach( $this->customFilters as $key => $params ) {
-                       $defaults[$key] = $params['msg'];
+                       $defaults[$key] = $params['default'];
                }
 
                # Extract variables from the request, falling back to user preferences or
@@ -131,7 +131,7 @@ class SpecialWatchlist extends SpecialPage {
                $values['hidePatrolled'] = (int)$request->getBool( 'hidePatrolled', $defaults['hidePatrolled'] );
                $values['extended'] = (int)$request->getBool( 'extended', $defaults['extended'] );
                foreach( $this->customFilters as $key => $params ) {
-                       $values[$key] = (int)$request->getBool( $key );
+                       $values[$key] = (int)$request->getBool( $key, $defaults[$key] );
                }
 
                # Get namespace value, if supplied, and prepare a WHERE fragment
@@ -181,7 +181,7 @@ class SpecialWatchlist extends SpecialPage {
                        $request->wasPosted() )
                {
                        $user->clearAllNotifications();
-                       $output->redirect( $this->getTitle()->getFullUrl( $nondefaults ) );
+                       $output->redirect( $this->getTitle()->getFullURL( $nondefaults ) );
                        return;
                }
 
@@ -200,7 +200,6 @@ class SpecialWatchlist extends SpecialPage {
 
                # Up estimate of watched items by 15% to compensate for talk pages...
 
-
                # Toggles
                if( $values['hideOwn'] ) {
                        $conds[] = 'rc_user != ' . $user->getId();
@@ -247,12 +246,12 @@ class SpecialWatchlist extends SpecialPage {
                # Show watchlist header
                $form .= $this->msg( 'watchlist-details' )->numParams( $nitems )->parse() . "\n";
 
-               if( $user->getOption( 'enotifwatchlistpages' ) && $wgEnotifWatchlist) {
+               if( $user->getOption( 'enotifwatchlistpages' ) && $wgEnotifWatchlist ) {
                        $form .= $this->msg( 'wlheader-enotif' )->parseAsBlock() . "\n";
                }
                if( $wgShowUpdatedMarker ) {
                        $form .= Xml::openElement( 'form', array( 'method' => 'post',
-                                               'action' => $this->getTitle()->getLocalUrl(),
+                                               'action' => $this->getTitle()->getLocalURL(),
                                                'id' => 'mw-watchlist-resetbutton' ) ) . "\n" .
                                        $this->msg( 'wlheader-showupdated' )->parse() .
                                        Xml::submitButton( $this->msg( 'enotif_reset' )->text(), array( 'name' => 'dummy' ) ) . "\n" .
@@ -294,7 +293,7 @@ class SpecialWatchlist extends SpecialPage {
                }
 
                ChangeTags::modifyDisplayQuery( $tables, $fields, $conds, $join_conds, $options, '' );
-               wfRunHooks( 'SpecialWatchlistQuery', array( &$conds, &$tables, &$join_conds, &$fields ) );
+               wfRunHooks( 'SpecialWatchlistQuery', array( &$conds, &$tables, &$join_conds, &$fields, $values ) );
 
                $res = $dbr->select( $tables, $fields, $conds, __METHOD__, $options, $join_conds );
                $numRows = $res->numRows();
@@ -342,7 +341,7 @@ class SpecialWatchlist extends SpecialPage {
                $form .= $wlInfo;
                $form .= $cutofflinks;
                $form .= $lang->pipeList( $links ) . "\n";
-               $form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl(), 'id' => 'mw-watchlist-form-namespaceselector' ) ) . "\n";
+               $form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL(), 'id' => 'mw-watchlist-form-namespaceselector' ) ) . "\n";
                $form .= "<hr />\n<p>";
                $form .= Html::namespaceSelector(
                        array(
@@ -492,7 +491,7 @@ class SpecialWatchlist extends SpecialPage {
        /**
         * Count the number of items on a user's watchlist
         *
-        * @param $dbr A database connection
+        * @param DatabaseBase $dbr A database connection
         * @return Integer
         */
        protected function countItems( $dbr ) {
@@ -504,4 +503,8 @@ class SpecialWatchlist extends SpecialPage {
 
                return floor( $count / 2 );
        }
+
+       protected function getGroupName() {
+               return 'changes';
+       }
 }