Update formatting
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Thu, 9 May 2013 14:51:30 +0000 (16:51 +0200)
committerAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Sat, 18 May 2013 10:06:27 +0000 (13:06 +0300)
Also removed some commented out code and one or more unneeded elses.

Change-Id: I8a7f5c683e3aa570522fb31b027b695f195a3970

30 files changed:
includes/specials/SpecialJavaScriptTest.php
includes/specials/SpecialLinkSearch.php
includes/specials/SpecialListfiles.php
includes/specials/SpecialListgrouprights.php
includes/specials/SpecialListredirects.php
includes/specials/SpecialListusers.php
includes/specials/SpecialLog.php
includes/specials/SpecialLonelypages.php
includes/specials/SpecialLongpages.php
includes/specials/SpecialMIMEsearch.php
includes/specials/SpecialMergeHistory.php
includes/specials/SpecialMostcategories.php
includes/specials/SpecialMostimages.php
includes/specials/SpecialMostinterwikis.php
includes/specials/SpecialMostlinked.php
includes/specials/SpecialMostlinkedcategories.php
includes/specials/SpecialMostlinkedtemplates.php
includes/specials/SpecialMovepage.php
includes/specials/SpecialNewimages.php
includes/specials/SpecialNewpages.php
includes/specials/SpecialPagesWithProp.php
includes/specials/SpecialPasswordReset.php
includes/specials/SpecialPopularpages.php
includes/specials/SpecialPreferences.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialProtectedpages.php
includes/specials/SpecialProtectedtitles.php
includes/specials/SpecialRandompage.php
includes/specials/SpecialRandomredirect.php
includes/specials/SpecialRecentchanges.php

index 63881a7..f79fdd7 100644 (file)
@@ -55,24 +55,28 @@ class SpecialJavaScriptTest extends SpecialPage {
                if ( $par == '' ) {
                        $out->setPageTitle( $this->msg( 'javascripttest' ) );
                        $summary = $this->wrapSummaryHtml(
-                               $this->msg( 'javascripttest-pagetext-noframework' )->escaped() . $this->getFrameworkListHtml(),
+                               $this->msg( 'javascripttest-pagetext-noframework' )->escaped() .
+                                       $this->getFrameworkListHtml(),
                                'noframework'
                        );
                        $out->addHtml( $summary );
-
-               // Matched! Display proper title and initialize the framework
                } elseif ( isset( self::$frameworks[$framework] ) ) {
-                       $out->setPageTitle( $this->msg( 'javascripttest-title', $this->msg( "javascripttest-$framework-name" )->plain() ) );
-                       $out->setSubtitle( $this->msg( 'javascripttest-backlink' )->rawParams( Linker::linkKnown( $this->getTitle() ) ) );
+                       // Matched! Display proper title and initialize the framework
+                       $out->setPageTitle( $this->msg(
+                               'javascripttest-title',
+                               $this->msg( "javascripttest-$framework-name" )->plain()
+                       ) );
+                       $out->setSubtitle( $this->msg( 'javascripttest-backlink' )
+                               ->rawParams( Linker::linkKnown( $this->getTitle() ) ) );
                        $this->{self::$frameworks[$framework]}();
-
-               // Framework not found, display error
                } else {
+                       // Framework not found, display error
                        $out->setPageTitle( $this->msg( 'javascripttest' ) );
-                       $summary = $this->wrapSummaryHtml( '<p class="error">'
-                               . $this->msg( 'javascripttest-pagetext-unknownframework', $par )->escaped()
-                               . '</p>'
-                               . $this->getFrameworkListHtml(),
+                       $summary = $this->wrapSummaryHtml(
+                               '<p class="error">' .
+                                       $this->msg( 'javascripttest-pagetext-unknownframework', $par )->escaped() .
+                                       '</p>' .
+                                       $this->getFrameworkListHtml(),
                                'unknownframework'
                        );
                        $out->addHtml( $summary );
@@ -80,8 +84,10 @@ class SpecialJavaScriptTest extends SpecialPage {
        }
 
        /**
-        * Get a list of frameworks (including introduction paragraph and links to the framework run pages)
-        * @return String: HTML
+        * Get a list of frameworks (including introduction paragraph and links
+        * to the framework run pages)
+        *
+        * @return string HTML
         */
        private function getFrameworkListHtml() {
                $list = '<ul>';
@@ -89,13 +95,16 @@ class SpecialJavaScriptTest extends SpecialPage {
                        $list .= Html::rawElement(
                                'li',
                                array(),
-                               Linker::link( $this->getTitle( $framework ), $this->msg( "javascripttest-$framework-name" )->escaped() )
+                               Linker::link(
+                                       $this->getTitle( $framework ),
+                                       $this->msg( "javascripttest-$framework-name" )->escaped()
+                               )
                        );
                }
                $list .= '</ul>';
-               $msg = $this->msg( 'javascripttest-pagetext-frameworks' )->rawParams( $list )->parseAsBlock();
 
-               return $msg;
+               return $this->msg( 'javascripttest-pagetext-frameworks' )->rawParams( $list )
+                       ->parseAsBlock();
        }
 
        /**
@@ -109,12 +118,14 @@ class SpecialJavaScriptTest extends SpecialPage {
         */
        private function wrapSummaryHtml( $html, $state ) {
                $validStates = array( 'noframework', 'unknownframework', 'frameworkfound' );
+
                if ( !in_array( $state, $validStates ) ) {
                        throw new MWException( __METHOD__
                                . ' given an invalid state. Must be one of "'
                                . join( '", "', $validStates ) . '".'
                        );
                }
+
                return "<div id=\"mw-javascripttest-summary\" class=\"mw-javascripttest-$state\">$html</div>";
        }
 
@@ -155,7 +166,10 @@ HTML;
 
                // Used in ./tests/qunit/data/testrunner.js, see also documentation of
                // $wgJavaScriptTestConfig in DefaultSettings.php
-               $out->addJsConfigVars( 'QUnitTestSwarmInjectJSPath', $wgJavaScriptTestConfig['qunit']['testswarm-injectjs'] );
+               $out->addJsConfigVars(
+                       'QUnitTestSwarmInjectJSPath',
+                       $wgJavaScriptTestConfig['qunit']['testswarm-injectjs']
+               );
        }
 
        protected function getGroupName() {
index 3abfd5f..5b0c56e 100644 (file)
@@ -88,11 +88,21 @@ class LinkSearchPage extends QueryPage {
                        '<nowiki>' . $this->getLanguage()->commaList( $protocols_list ) . '</nowiki>',
                        count( $protocols_list )
                );
-               $s = Html::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $wgScript ) ) . "\n" .
+               $s = Html::openElement(
+                       'form',
+                       array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $wgScript )
+               ) . "\n" .
                        Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
                        Html::openElement( 'fieldset' ) . "\n" .
                        Html::element( 'legend', array(), $this->msg( 'linksearch' )->text() ) . "\n" .
-                       Xml::inputLabel( $this->msg( 'linksearch-pat' )->text(), 'target', 'target', 50, $target ) . "\n";
+                       Xml::inputLabel(
+                               $this->msg( 'linksearch-pat' )->text(),
+                               'target',
+                               'target',
+                               50,
+                               $target
+                       ) . "\n";
+
                if ( !$wgMiserMode ) {
                        $s .= Html::namespaceSelector(
                                array(
@@ -106,6 +116,7 @@ class LinkSearchPage extends QueryPage {
                                )
                        );
                }
+
                $s .= Xml::submitButton( $this->msg( 'linksearch-ok' )->text() ) . "\n" .
                        Html::closeElement( 'fieldset' ) . "\n" .
                        Html::closeElement( 'form' ) . "\n";
@@ -143,12 +154,14 @@ class LinkSearchPage extends QueryPage {
                $rv = LinkFilter::makeLikeArray( $query, $prot );
                if ( $rv === false ) {
                        // LinkFilter doesn't handle wildcard in IP, so we'll have to munge here.
-                       if ( preg_match( '/^(:?[0-9]{1,3}\.)+\*\s*$|^(:?[0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]*\*\s*$/', $query ) ) {
+                       $pattern = '/^(:?[0-9]{1,3}\.)+\*\s*$|^(:?[0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]*\*\s*$/';
+                       if ( preg_match( $pattern, $query ) ) {
                                $dbr = wfGetDB( DB_SLAVE );
                                $rv = array( $prot . rtrim( $query, " \t*" ), $dbr->anyString() );
                                $field = 'el_to';
                        }
                }
+
                return array( $rv, $field );
        }
 
@@ -159,6 +172,7 @@ class LinkSearchPage extends QueryPage {
                if ( isset( $this->mNs ) && !$wgMiserMode ) {
                        $params['namespace'] = $this->mNs;
                }
+
                return $params;
        }
 
@@ -167,8 +181,7 @@ class LinkSearchPage extends QueryPage {
                $dbr = wfGetDB( DB_SLAVE );
                // strip everything past first wildcard, so that
                // index-based-only lookup would be done
-               list( $this->mMungedQuery, $clause ) = self::mungeQuery(
-                               $this->mQuery, $this->mProt );
+               list( $this->mMungedQuery, $clause ) = self::mungeQuery( $this->mQuery, $this->mProt );
                if ( $this->mMungedQuery === false ) {
                        // Invalid query; return no results
                        return array( 'tables' => 'page', 'fields' => 'page_id', 'conds' => '0=1' );
@@ -178,16 +191,23 @@ class LinkSearchPage extends QueryPage {
                $like = $dbr->buildLike( $stripped );
                $retval = array(
                        'tables' => array( 'page', 'externallinks' ),
-                       'fields' => array( 'namespace' => 'page_namespace',
-                                       'title' => 'page_title',
-                                       'value' => 'el_index', 'url' => 'el_to' ),
-                       'conds' => array( 'page_id = el_from',
-                                       "$clause $like" ),
+                       'fields' => array(
+                               'namespace' => 'page_namespace',
+                               'title' => 'page_title',
+                               'value' => 'el_index',
+                               'url' => 'el_to'
+                       ),
+                       'conds' => array(
+                               'page_id = el_from',
+                               "$clause $like"
+                       ),
                        'options' => array( 'USE INDEX' => $clause )
                );
+
                if ( isset( $this->mNs ) && !$wgMiserMode ) {
                        $retval['conds']['page_namespace'] = $this->mNs;
                }
+
                return $retval;
        }
 
index 9c2d039..f508b7c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 class SpecialListFiles extends IncludableSpecialPage {
-
        public function __construct() {
                parent::__construct( 'Listfiles' );
        }
@@ -39,7 +38,12 @@ class SpecialListFiles extends IncludableSpecialPage {
                        $search = $this->getRequest()->getText( 'ilsearch', '' );
                }
 
-               $pager = new ImageListPager( $this->getContext(), $userName, $search, $this->including() );
+               $pager = new ImageListPager(
+                       $this->getContext(),
+                       $userName,
+                       $search,
+                       $this->including()
+               );
 
                if ( $this->including() ) {
                        $html = $pager->getBody();
@@ -67,7 +71,9 @@ class ImageListPager extends TablePager {
        var $mSearch = '';
        var $mIncluding = false;
 
-       function __construct( IContextSource $context, $userName = null, $search = '', $including = false ) {
+       function __construct( IContextSource $context, $userName = null, $search = '',
+               $including = false
+       ) {
                global $wgMiserMode;
 
                $this->mIncluding = $including;
@@ -83,6 +89,7 @@ class ImageListPager extends TablePager {
                if ( $search != '' && !$wgMiserMode ) {
                        $this->mSearch = $search;
                        $nt = Title::newFromURL( $this->mSearch );
+
                        if ( $nt ) {
                                $dbr = wfGetDB( DB_SLAVE );
                                $this->mQueryConds[] = 'LOWER(img_name)' .
@@ -122,6 +129,7 @@ class ImageListPager extends TablePager {
                                $this->mFieldNames['count'] = $this->msg( 'listfiles_count' )->text();
                        }
                }
+
                return $this->mFieldNames;
        }
 
@@ -134,6 +142,7 @@ class ImageListPager extends TablePager {
                        # No index for both img_size and img_user_text
                        return !isset( $this->mQueryConds['img_user_text'] );
                }
+
                return in_array( $field, $sortable );
        }
 
@@ -165,6 +174,7 @@ class ImageListPager extends TablePager {
                        }
                        $join_conds = array( 'oldimage' => array( 'LEFT JOIN', 'oi_name = img_name' ) );
                }
+
                return array(
                        'tables' => $tables,
                        'fields' => $fields,
@@ -193,9 +203,11 @@ class ImageListPager extends TablePager {
                        case 'thumb':
                                $file = wfLocalFile( $value );
                                $thumb = $file->transform( array( 'width' => 180, 'height' => 360 ) );
+
                                return $thumb->toHtml( array( 'desc-link' => true ) );
                        case 'img_timestamp':
-                               return htmlspecialchars( $this->getLanguage()->userTimeAndDate( $value, $this->getUser() ) );
+                               $timeAndDate = $this->getLanguage()->userTimeAndDate( $value, $this->getUser() );
+                               return htmlspecialchars( $timeAndDate );
                        case 'img_name':
                                static $imgfile = null;
                                if ( $imgfile === null ) {
@@ -205,12 +217,16 @@ class ImageListPager extends TablePager {
                                // Weird files can maybe exist? Bug 22227
                                $filePage = Title::makeTitleSafe( NS_FILE, $value );
                                if ( $filePage ) {
-                                       $link = Linker::linkKnown( $filePage, htmlspecialchars( $filePage->getText() ) );
+                                       $link = Linker::linkKnown(
+                                               $filePage,
+                                               htmlspecialchars( $filePage->getText() )
+                                       );
                                        $download = Xml::element( 'a',
                                                array( 'href' => wfLocalFile( $filePage )->getURL() ),
                                                $imgfile
                                        );
                                        $download = $this->msg( 'parentheses' )->rawParams( $download )->escaped();
+
                                        return "$link $download";
                                } else {
                                        return htmlspecialchars( $value );
@@ -225,6 +241,7 @@ class ImageListPager extends TablePager {
                                } else {
                                        $link = htmlspecialchars( $value );
                                }
+
                                return $link;
                        case 'img_size':
                                return htmlspecialchars( $this->getLanguage()->formatSize( $value ) );
@@ -240,20 +257,26 @@ class ImageListPager extends TablePager {
                $inputForm = array();
                $inputForm['table_pager_limit_label'] = $this->getLimitSelect();
                if ( !$wgMiserMode ) {
-                       $inputForm['listfiles_search_for'] = Html::input( 'ilsearch', $this->mSearch, 'text',
+                       $inputForm['listfiles_search_for'] = Html::input(
+                               'ilsearch',
+                               $this->mSearch,
+                               'text',
                                array(
                                        'size' => '40',
                                        'maxlength' => '255',
                                        'id' => 'mw-ilsearch',
-                       ) );
+                               )
+                       );
                }
                $inputForm['username'] = Html::input( 'user', $this->mUserName, 'text', array(
                        'size' => '40',
                        'maxlength' => '255',
                        'id' => 'mw-listfiles-user',
                ) );
+
                return Html::openElement( 'form',
-                               array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
+                       array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' )
+               ) .
                        Xml::fieldset( $this->msg( 'listfiles' )->text() ) .
                        Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
                        Xml::buildForm( $inputForm, 'table_pager_limit_submit' ) .
@@ -282,6 +305,7 @@ class ImageListPager extends TablePager {
                                $query['user'] = $this->mUserName;
                        }
                }
+
                return $queries;
        }
 
@@ -290,6 +314,7 @@ class ImageListPager extends TablePager {
                if ( !isset( $queries['user'] ) && !is_null( $this->mUserName ) ) {
                        $queries['user'] = $this->mUserName;
                }
+
                return $queries;
        }
 
index 3309682..57bfea5 100644 (file)
@@ -29,7 +29,6 @@
  * @author Petr Kadlec <mormegil@centrum.cz>
  */
 class SpecialListGroupRights extends SpecialPage {
-
        /**
         * Constructor
         */
@@ -54,8 +53,8 @@ class SpecialListGroupRights extends SpecialPage {
                $out->addHTML(
                        Xml::openElement( 'table', array( 'class' => 'wikitable mw-listgrouprights-table' ) ) .
                                '<tr>' .
-                                       Xml::element( 'th', null, $this->msg( 'listgrouprights-group' )->text() ) .
-                                       Xml::element( 'th', null, $this->msg( 'listgrouprights-rights' )->text() ) .
+                               Xml::element( 'th', null, $this->msg( 'listgrouprights-group' )->text() ) .
+                               Xml::element( 'th', null, $this->msg( 'listgrouprights-rights' )->text() ) .
                                '</tr>'
                );
 
@@ -124,8 +123,8 @@ class SpecialListGroupRights extends SpecialPage {
                                "
                                <td>$grouppage$grouplink</td>
                                        <td>" .
-                                               $this->formatPermissions( $permissions, $revoke, $addgroups, $removegroups,
-                                                       $addgroupsSelf, $removegroupsSelf ) .
+                                       $this->formatPermissions( $permissions, $revoke, $addgroups, $removegroups,
+                                               $addgroupsSelf, $removegroupsSelf ) .
                                        '</td>
                                '
                        ) );
@@ -168,8 +167,11 @@ class SpecialListGroupRights extends SpecialPage {
                                $r[] = $description;
                        }
                }
+
                sort( $r );
+
                $lang = $this->getLanguage();
+
                if ( $add === true ) {
                        $r[] = $this->msg( 'listgrouprights-addgroup-all' )->escaped();
                } elseif ( is_array( $add ) && count( $add ) ) {
@@ -179,6 +181,7 @@ class SpecialListGroupRights extends SpecialPage {
                                count( $add )
                        )->parse();
                }
+
                if ( $remove === true ) {
                        $r[] = $this->msg( 'listgrouprights-removegroup-all' )->escaped();
                } elseif ( is_array( $remove ) && count( $remove ) ) {
@@ -188,6 +191,7 @@ class SpecialListGroupRights extends SpecialPage {
                                count( $remove )
                        )->parse();
                }
+
                if ( $addSelf === true ) {
                        $r[] = $this->msg( 'listgrouprights-addgroup-self-all' )->escaped();
                } elseif ( is_array( $addSelf ) && count( $addSelf ) ) {
@@ -197,6 +201,7 @@ class SpecialListGroupRights extends SpecialPage {
                                count( $addSelf )
                        )->parse();
                }
+
                if ( $removeSelf === true ) {
                        $r[] = $this->msg( 'listgrouprights-removegroup-self-all' )->parse();
                } elseif ( is_array( $removeSelf ) && count( $removeSelf ) ) {
@@ -206,6 +211,7 @@ class SpecialListGroupRights extends SpecialPage {
                                count( $removeSelf )
                        )->parse();
                }
+
                if ( empty( $r ) ) {
                        return '';
                } else {
index 4401499..2c8792f 100644 (file)
@@ -29,7 +29,6 @@
  * @ingroup SpecialPage
  */
 class ListredirectsPage extends QueryPage {
-
        function __construct( $name = 'Listredirects' ) {
                parent::__construct( $name );
        }
@@ -50,16 +49,16 @@ class ListredirectsPage extends QueryPage {
                return array(
                        'tables' => array( 'p1' => 'page', 'redirect', 'p2' => 'page' ),
                        'fields' => array( 'namespace' => 'p1.page_namespace',
-                                       'title' => 'p1.page_title',
-                                       'value' => 'p1.page_title',
-                                       'rd_namespace',
-                                       'rd_title',
-                                       'rd_fragment',
-                                       'rd_interwiki',
-                                       'redirid' => 'p2.page_id' ),
+                               'title' => 'p1.page_title',
+                               'value' => 'p1.page_title',
+                               'rd_namespace',
+                               'rd_title',
+                               'rd_fragment',
+                               'rd_interwiki',
+                               'redirid' => 'p2.page_id' ),
                        'conds' => array( 'p1.page_is_redirect' => 1 ),
                        'join_conds' => array( 'redirect' => array(
-                                       'LEFT JOIN', 'rd_from=p1.page_id' ),
+                               'LEFT JOIN', 'rd_from=p1.page_id' ),
                                'p2' => array( 'LEFT JOIN', array(
                                        'p2.page_namespace=rd_namespace',
                                        'p2.page_title=rd_title' ) ) )
@@ -78,10 +77,12 @@ class ListredirectsPage extends QueryPage {
         */
        function preprocessResults( $db, $res ) {
                $batch = new LinkBatch;
+
                foreach ( $res as $row ) {
                        $batch->add( $row->namespace, $row->title );
                        $batch->addObj( $this->getRedirectTarget( $row ) );
                }
+
                $batch->execute();
 
                // Back to start for display
@@ -100,6 +101,7 @@ class ListredirectsPage extends QueryPage {
                } else {
                        $title = Title::makeTitle( $row->namespace, $row->title );
                        $article = WikiPage::factory( $title );
+
                        return $article->getRedirectTarget();
                }
        }
@@ -126,6 +128,7 @@ class ListredirectsPage extends QueryPage {
                        $lang = $this->getLanguage();
                        $arr = $lang->getArrow() . $lang->getDirMark();
                        $targetLink = Linker::link( $target );
+
                        return "$rd_link $arr $targetLink";
                } else {
                        return "<del>$rd_link</del>";
index d674b05..75b8490 100644 (file)
@@ -49,7 +49,10 @@ class UsersPager extends AlphabeticPager {
                $par = ( $par !== null ) ? $par : '';
                $parms = explode( '/', $par );
                $symsForAll = array( '*', 'user' );
-               if ( $parms[0] != '' && ( in_array( $par, User::getAllGroups() ) || in_array( $par, $symsForAll ) ) ) {
+
+               if ( $parms[0] != '' &&
+                       ( in_array( $par, User::getAllGroups() ) || in_array( $par, $symsForAll ) )
+               ) {
                        $this->requestedGroup = $par;
                        $un = $request->getText( 'username' );
                } elseif ( count( $parms ) == 2 ) {
@@ -59,6 +62,7 @@ class UsersPager extends AlphabeticPager {
                        $this->requestedGroup = $request->getVal( 'group' );
                        $un = ( $par != '' ) ? $par : $request->getText( 'username' );
                }
+
                if ( in_array( $this->requestedGroup, $symsForAll ) ) {
                        $this->requestedGroup = '';
                }
@@ -67,12 +71,15 @@ class UsersPager extends AlphabeticPager {
                $this->including = $including;
 
                $this->requestedUser = '';
+
                if ( $un != '' ) {
                        $username = Title::makeTitleSafe( NS_USER, $un );
-                       if ( ! is_null( $username ) ) {
+
+                       if ( !is_null( $username ) ) {
                                $this->requestedUser = $username->getText();
                        }
                }
+
                parent::__construct();
        }
 
@@ -89,6 +96,7 @@ class UsersPager extends AlphabeticPager {
        function getQueryInfo() {
                $dbr = wfGetDB( DB_SLAVE );
                $conds = array();
+
                // Don't show hidden names
                if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
                        $conds[] = 'ipb_deleted IS NULL OR ipb_deleted = 0';
@@ -98,9 +106,8 @@ class UsersPager extends AlphabeticPager {
 
                if ( $this->requestedGroup != '' ) {
                        $conds['ug_group'] = $this->requestedGroup;
-               } else {
-                       //$options['USE INDEX'] = $this->creationSort ? 'PRIMARY' : 'user_name';
                }
+
                if ( $this->requestedUser != '' ) {
                        # Sorted either by account creation or name
                        if ( $this->creationSort ) {
@@ -109,6 +116,7 @@ class UsersPager extends AlphabeticPager {
                                $conds[] = 'user_name >= ' . $dbr->addQuotes( $this->requestedUser );
                        }
                }
+
                if ( $this->editsOnly ) {
                        $conds[] = 'user_editcount > 0';
                }
@@ -129,15 +137,18 @@ class UsersPager extends AlphabeticPager {
                        'options' => $options,
                        'join_conds' => array(
                                'user_groups' => array( 'LEFT JOIN', 'user_id=ug_user' ),
-                               'ipblocks' => array( 'LEFT JOIN', array(
-                                       'user_id=ipb_user',
-                                       'ipb_auto' => 0
-                               )),
+                               'ipblocks' => array(
+                                       'LEFT JOIN', array(
+                                               'user_id=ipb_user',
+                                               'ipb_auto' => 0
+                                       )
+                               ),
                        ),
                        'conds' => $conds
                );
 
                wfRunHooks( 'SpecialListusersQueryInfo', array( $this, &$query ) );
+
                return $query;
        }
 
@@ -153,12 +164,17 @@ class UsersPager extends AlphabeticPager {
                $userName = $row->user_name;
 
                $ulinks = Linker::userLink( $row->user_id, $userName );
-               $ulinks .= Linker::userToolLinksRedContribs( $row->user_id, $userName, intval( $row->edits ) );
+               $ulinks .= Linker::userToolLinksRedContribs(
+                       $row->user_id,
+                       $userName,
+                       (int)$row->edits
+               );
 
                $lang = $this->getLanguage();
 
                $groups = '';
                $groups_list = self::getGroups( $row->user_id );
+
                if ( !$this->including && count( $groups_list ) > 0 ) {
                        $list = array();
                        foreach ( $groups_list as $group ) {
@@ -168,6 +184,7 @@ class UsersPager extends AlphabeticPager {
                }
 
                $item = $lang->specialList( $ulinks, $groups );
+
                if ( $row->ipb_deleted ) {
                        $item = "<span class=\"deleted\">$item</span>";
                }
@@ -175,11 +192,14 @@ class UsersPager extends AlphabeticPager {
                $edits = '';
                global $wgEdititis;
                if ( !$this->including && $wgEdititis ) {
-                       $edits = ' [' . $this->msg( 'usereditcount' )->numParams( $row->edits )->escaped() . ']';
+                       // @fixme i18n issue: Hardcoded square brackets.
+                       $edits = ' [' .
+                               $this->msg( 'usereditcount' )->numParams( $row->edits )->escaped() .
+                               ']';
                }
 
                $created = '';
-               # Some rows may be NULL
+               # Some rows may be null
                if ( !$this->including && $row->creation ) {
                        $user = $this->getUser();
                        $d = $lang->userDate( $row->creation, $user );
@@ -187,9 +207,12 @@ class UsersPager extends AlphabeticPager {
                        $created = $this->msg( 'usercreated', $d, $t, $row->user_name )->escaped();
                        $created = ' ' . $this->msg( 'parentheses' )->rawParams( $created )->escaped();
                }
-               $blocked = !is_null( $row->ipb_deleted ) ? ' ' . $this->msg( 'listusers-blocked', $userName )->escaped() : '';
+               $blocked = !is_null( $row->ipb_deleted ) ?
+                       ' ' . $this->msg( 'listusers-blocked', $userName )->escaped() :
+                       '';
 
                wfRunHooks( 'SpecialListusersFormatRow', array( &$item, $row ) );
+
                return Html::rawElement( 'li', array(), "{$item}{$edits}{$created}{$blocked}" );
        }
 
@@ -213,7 +236,10 @@ class UsersPager extends AlphabeticPager {
                list( $self ) = explode( '/', $this->getTitle()->getPrefixedDBkey() );
 
                # Form tag
-               $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listusers-form' ) ) .
+               $out = Xml::openElement(
+                       'form',
+                       array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listusers-form' )
+               ) .
                        Xml::fieldset( $this->msg( 'listusers' )->text() ) .
                        Html::hidden( 'title', $self );
 
@@ -238,9 +264,19 @@ class UsersPager extends AlphabeticPager {
                        $out .= Xml::option( $groupText, $group, $group == $this->requestedGroup );
                }
                $out .= Xml::closeElement( 'select' ) . '<br />';
-               $out .= Xml::checkLabel( $this->msg( 'listusers-editsonly' )->text(), 'editsOnly', 'editsOnly', $this->editsOnly );
+               $out .= Xml::checkLabel(
+                       $this->msg( 'listusers-editsonly' )->text(),
+                       'editsOnly',
+                       'editsOnly',
+                       $this->editsOnly
+               );
                $out .= '&#160;';
-               $out .= Xml::checkLabel( $this->msg( 'listusers-creationsort' )->text(), 'creationSort', 'creationSort', $this->creationSort );
+               $out .= Xml::checkLabel(
+                       $this->msg( 'listusers-creationsort' )->text(),
+                       'creationSort',
+                       'creationSort',
+                       $this->creationSort
+               );
                $out .= '<br />';
 
                wfRunHooks( 'SpecialListusersHeaderForm', array( $this, &$out ) );
@@ -265,6 +301,7 @@ class UsersPager extends AlphabeticPager {
                        $result[$group] = User::getGroupName( $group );
                }
                asort( $result );
+
                return $result;
        }
 
@@ -281,6 +318,7 @@ class UsersPager extends AlphabeticPager {
                        $query['username'] = $this->requestedUser;
                }
                wfRunHooks( 'SpecialListusersDefaultQuery', array( $this, &$query ) );
+
                return $query;
        }
 
@@ -293,6 +331,7 @@ class UsersPager extends AlphabeticPager {
        protected static function getGroups( $uid ) {
                $user = User::newFromId( $uid );
                $groups = array_diff( $user->getEffectiveGroups(), User::getImplicitGroups() );
+
                return $groups;
        }
 
@@ -304,7 +343,10 @@ class UsersPager extends AlphabeticPager {
         * @return string
         */
        protected static function buildGroupLink( $group, $username ) {
-               return User::makeGroupLinkHtml( $group, htmlspecialchars( User::getGroupMember( $group, $username ) ) );
+               return User::makeGroupLinkHtml(
+                       $group,
+                       htmlspecialchars( User::getGroupMember( $group, $username ) )
+               );
        }
 }
 
@@ -312,7 +354,6 @@ class UsersPager extends AlphabeticPager {
  * @ingroup SpecialPage
  */
 class SpecialListUsers extends IncludableSpecialPage {
-
        /**
         * Constructor
         */
index cf690f6..5d55a28 100644 (file)
@@ -29,7 +29,6 @@
  * @ingroup SpecialPage
  */
 class SpecialLog extends SpecialPage {
-
        /**
         * List log type for which the target is a user
         * Thus if the given target is in NS_MAIN we can alter it to be an NS_USER
@@ -119,7 +118,9 @@ class SpecialLog extends SpecialPage {
                # Get parameters
                $parms = explode( '/', ( $par = ( $par !== null ) ? $par : '' ) );
                $symsForAll = array( '*', 'all' );
-               if ( $parms[0] != '' && ( in_array( $par, $wgLogTypes ) || in_array( $par, $symsForAll ) ) ) {
+               if ( $parms[0] != '' &&
+                       ( in_array( $par, $wgLogTypes ) || in_array( $par, $symsForAll ) )
+               ) {
                        $opts->setValue( 'type', $par );
                } elseif ( count( $parms ) == 2 ) {
                        $opts->setValue( 'type', $parms[0] );
@@ -131,10 +132,22 @@ class SpecialLog extends SpecialPage {
 
        private function show( FormOptions $opts, array $extraConds ) {
                # Create a LogPager item to get the results and a LogEventsList item to format them...
-               $loglist = new LogEventsList( $this->getContext(), null, LogEventsList::USE_REVDEL_CHECKBOXES );
-               $pager = new LogPager( $loglist, $opts->getValue( 'type' ), $opts->getValue( 'user' ),
-                       $opts->getValue( 'page' ), $opts->getValue( 'pattern' ), $extraConds, $opts->getValue( 'year' ),
-                       $opts->getValue( 'month' ), $opts->getValue( 'tagfilter' ) );
+               $loglist = new LogEventsList(
+                       $this->getContext(),
+                       null,
+                       LogEventsList::USE_REVDEL_CHECKBOXES
+               );
+               $pager = new LogPager(
+                       $loglist,
+                       $opts->getValue( 'type' ),
+                       $opts->getValue( 'user' ),
+                       $opts->getValue( 'page' ),
+                       $opts->getValue( 'pattern' ),
+                       $extraConds,
+                       $opts->getValue( 'year' ),
+                       $opts->getValue( 'month' ),
+                       $opts->getValue( 'tagfilter' )
+               );
 
                $this->addHeader( $opts->getValue( 'type' ) );
 
@@ -144,16 +157,28 @@ class SpecialLog extends SpecialPage {
                }
 
                # Show form options
-               $loglist->showOptions( $pager->getType(), $opts->getValue( 'user' ), $pager->getPage(), $pager->getPattern(),
-                       $pager->getYear(), $pager->getMonth(), $pager->getFilterParams(), $opts->getValue( 'tagfilter' ) );
+               $loglist->showOptions(
+                       $pager->getType(),
+                       $opts->getValue( 'user' ),
+                       $pager->getPage(),
+                       $pager->getPattern(),
+                       $pager->getYear(),
+                       $pager->getMonth(),
+                       $pager->getFilterParams(),
+                       $opts->getValue( 'tagfilter' )
+               );
 
                # Insert list
                $logBody = $pager->getBody();
                if ( $logBody ) {
                        $this->getOutput()->addHTML(
                                $pager->getNavigationBar() .
-                               $this->getRevisionButton( $loglist->beginLogEventsList() . $logBody . $loglist->endLogEventsList() ) .
-                               $pager->getNavigationBar()
+                                       $this->getRevisionButton(
+                                               $loglist->beginLogEventsList() .
+                                                       $logBody .
+                                                       $loglist->endLogEventsList()
+                                       ) .
+                                       $pager->getNavigationBar()
                        );
                } else {
                        $this->getOutput()->addWikiMsg( 'logempty' );
@@ -161,19 +186,27 @@ class SpecialLog extends SpecialPage {
        }
 
        private function getRevisionButton( $formcontents ) {
-               # If the user doesn't have the ability to delete log entries, don't bother showing him/her the button.
+               # If the user doesn't have the ability to delete log entries,
+               # don't bother showing them the button.
                if ( !$this->getUser()->isAllowedAll( 'deletedhistory', 'deletelogentry' ) ) {
                        return $formcontents;
                }
 
                # Show button to hide log entries
                global $wgScript;
-               $s = Html::openElement( 'form', array( 'action' => $wgScript, 'id' => 'mw-log-deleterevision-submit' ) ) . "\n";
+               $s = Html::openElement(
+                       'form',
+                       array( 'action' => $wgScript, 'id' => 'mw-log-deleterevision-submit' )
+               ) . "\n";
                $s .= Html::hidden( 'title', SpecialPage::getTitleFor( 'Revisiondelete' ) ) . "\n";
                $s .= Html::hidden( 'target', SpecialPage::getTitleFor( 'Log' ) ) . "\n";
                $s .= Html::hidden( 'type', 'logging' ) . "\n";
-               $button = Html::element( 'button',
-                       array( 'type' => 'submit', 'class' => "deleterevision-log-submit mw-log-deleterevision-button" ),
+               $button = Html::element(
+                       'button',
+                       array(
+                               'type' => 'submit',
+                               'class' => "deleterevision-log-submit mw-log-deleterevision-button"
+                       ),
                        $this->msg( 'showhideselectedlogentries' )->text()
                ) . "\n";
                $s .= $button . $formcontents . $button;
index 6bccdc7..7c7771d 100644 (file)
@@ -28,7 +28,6 @@
  * @ingroup SpecialPage
  */
 class LonelyPagesPage extends PageQueryPage {
-
        function __construct( $name = 'Lonelypages' ) {
                parent::__construct( $name );
        }
@@ -51,24 +50,35 @@ class LonelyPagesPage extends PageQueryPage {
 
        function getQueryInfo() {
                return array(
-                       'tables' => array( 'page', 'pagelinks',
-                                       'templatelinks' ),
-                       'fields' => array( 'namespace' => 'page_namespace',
-                                       'title' => 'page_title',
-                                       'value' => 'page_title' ),
-                       'conds' => array( 'pl_namespace IS NULL',
-                                       'page_namespace' => MWNamespace::getContentNamespaces(),
-                                       'page_is_redirect' => 0,
-                                       'tl_namespace IS NULL' ),
+                       'tables' => array(
+                               'page', 'pagelinks',
+                               'templatelinks'
+                       ),
+                       'fields' => array(
+                               'namespace' => 'page_namespace',
+                               'title' => 'page_title',
+                               'value' => 'page_title'
+                       ),
+                       'conds' => array(
+                               'pl_namespace IS NULL',
+                               'page_namespace' => MWNamespace::getContentNamespaces(),
+                               'page_is_redirect' => 0,
+                               'tl_namespace IS NULL'
+                       ),
                        'join_conds' => array(
-                                       'pagelinks' => array(
-                                               'LEFT JOIN', array(
+                               'pagelinks' => array(
+                                       'LEFT JOIN', array(
                                                'pl_namespace = page_namespace',
-                                               'pl_title = page_title' ) ),
-                                       'templatelinks' => array(
-                                               'LEFT JOIN', array(
+                                               'pl_title = page_title'
+                                       )
+                               ),
+                               'templatelinks' => array(
+                                       'LEFT JOIN', array(
                                                'tl_namespace = page_namespace',
-                                               'tl_title = page_title' ) ) )
+                                               'tl_title = page_title'
+                                       )
+                               )
+                       )
                );
        }
 
index c045f9e..d90d271 100644 (file)
@@ -26,7 +26,6 @@
  * @ingroup SpecialPage
  */
 class LongPagesPage extends ShortPagesPage {
-
        function __construct( $name = 'Longpages' ) {
                parent::__construct( $name );
        }
index c11016d..7ff5d7b 100644 (file)
@@ -53,16 +53,20 @@ class MIMEsearchPage extends QueryPage {
        public function getQueryInfo() {
                return array(
                        'tables' => array( 'image' ),
-                       'fields' => array( 'namespace' => NS_FILE,
-                                       'title' => 'img_name',
-                                       'value' => 'img_major_mime',
-                                       'img_size',
-                                       'img_width',
-                                       'img_height',
-                                       'img_user_text',
-                                       'img_timestamp' ),
-                       'conds' => array( 'img_major_mime' => $this->major,
-                                       'img_minor_mime' => $this->minor )
+                       'fields' => array(
+                               'namespace' => NS_FILE,
+                               'title' => 'img_name',
+                               'value' => 'img_major_mime',
+                               'img_size',
+                               'img_width',
+                               'img_height',
+                               'img_user_text',
+                               'img_timestamp'
+                       ),
+                       'conds' => array(
+                               'img_major_mime' => $this->major,
+                               'img_minor_mime' => $this->minor
+                       )
                );
        }
 
@@ -74,21 +78,28 @@ class MIMEsearchPage extends QueryPage {
                $this->setHeaders();
                $this->outputHeader();
                $this->getOutput()->addHTML(
-                       Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgScript ) ) .
-                       Xml::openElement( 'fieldset' ) .
-                       Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
-                       Xml::element( 'legend', null, $this->msg( 'mimesearch' )->text() ) .
-                       Xml::inputLabel( $this->msg( 'mimetype' )->text(), 'mime', 'mime', 20, $mime ) . ' ' .
-                       Xml::submitButton( $this->msg( 'ilsubmit' )->text() ) .
-                       Xml::closeElement( 'fieldset' ) .
-                       Xml::closeElement( 'form' )
+                       Xml::openElement(
+                               'form',
+                               array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgScript )
+                       ) .
+                               Xml::openElement( 'fieldset' ) .
+                               Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
+                               Xml::element( 'legend', null, $this->msg( 'mimesearch' )->text() ) .
+                               Xml::inputLabel( $this->msg( 'mimetype' )->text(), 'mime', 'mime', 20, $mime ) .
+                               ' ' .
+                               Xml::submitButton( $this->msg( 'ilsubmit' )->text() ) .
+                               Xml::closeElement( 'fieldset' ) .
+                               Xml::closeElement( 'form' )
                );
 
                list( $this->major, $this->minor ) = File::splitMime( $mime );
+
                if ( $this->major == '' || $this->minor == '' || $this->minor == 'unknown' ||
-                       !self::isValidType( $this->major ) ) {
+                       !self::isValidType( $this->major )
+               ) {
                        return;
                }
+
                parent::execute( $par );
        }
 
@@ -113,8 +124,13 @@ class MIMEsearchPage extends QueryPage {
                $bytes = htmlspecialchars( $lang->formatSize( $result->img_size ) );
                $dimensions = $this->msg( 'widthheight' )->numParams( $result->img_width,
                        $result->img_height )->escaped();
-               $user = Linker::link( Title::makeTitle( NS_USER, $result->img_user_text ), htmlspecialchars( $result->img_user_text ) );
-               $time = htmlspecialchars( $lang->userTimeAndDate( $result->img_timestamp, $this->getUser() ) );
+               $user = Linker::link(
+                       Title::makeTitle( NS_USER, $result->img_user_text ),
+                       htmlspecialchars( $result->img_user_text )
+               );
+
+               $time = $lang->userTimeAndDate( $result->img_timestamp, $this->getUser() );
+               $time = htmlspecialchars( $time );
 
                return "$download $plink . . $dimensions . . $bytes . . $user . . $time";
        }
@@ -136,6 +152,7 @@ class MIMEsearchPage extends QueryPage {
                        'model',
                        'multipart'
                );
+
                return in_array( $type, $types );
        }
 
index 2e7f672..2a86fca 100644 (file)
@@ -91,11 +91,13 @@ class SpecialMergeHistory extends SpecialPage {
 
                if ( $this->mTargetID && $this->mDestID && $this->mAction == 'submit' && $this->mMerge ) {
                        $this->merge();
+
                        return;
                }
 
                if ( !$this->mSubmitted ) {
                        $this->showMergeForm();
+
                        return;
                }
 
@@ -126,7 +128,6 @@ class SpecialMergeHistory extends SpecialPage {
                } else {
                        $this->showHistory();
                }
-
        }
 
        function showMergeForm() {
@@ -138,25 +139,25 @@ class SpecialMergeHistory extends SpecialPage {
                        Xml::openElement( 'form', array(
                                'method' => 'get',
                                'action' => $wgScript ) ) .
-                       '<fieldset>' .
-                       Xml::element( 'legend', array(),
-                               $this->msg( 'mergehistory-box' )->text() ) .
-                       Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) .
-                       Html::hidden( 'submitted', '1' ) .
-                       Html::hidden( 'mergepoint', $this->mTimestamp ) .
-                       Xml::openElement( 'table' ) .
-                       '<tr>
+                               '<fieldset>' .
+                               Xml::element( 'legend', array(),
+                                       $this->msg( 'mergehistory-box' )->text() ) .
+                               Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) .
+                               Html::hidden( 'submitted', '1' ) .
+                               Html::hidden( 'mergepoint', $this->mTimestamp ) .
+                               Xml::openElement( 'table' ) .
+                               '<tr>
                                <td>' . Xml::label( $this->msg( 'mergehistory-from' )->text(), 'target' ) . '</td>
                                <td>' . Xml::input( 'target', 30, $this->mTarget, array( 'id' => 'target' ) ) . '</td>
                        </tr><tr>
                                <td>' . Xml::label( $this->msg( 'mergehistory-into' )->text(), 'dest' ) . '</td>
                                <td>' . Xml::input( 'dest', 30, $this->mDest, array( 'id' => 'dest' ) ) . '</td>
                        </tr><tr><td>' .
-                       Xml::submitButton( $this->msg( 'mergehistory-go' )->text() ) .
-                       '</td></tr>' .
-                       Xml::closeElement( 'table' ) .
-                       '</fieldset>' .
-                       '</form>'
+                               Xml::submitButton( $this->msg( 'mergehistory-go' )->text() ) .
+                               '</td></tr>' .
+                               Xml::closeElement( 'table' ) .
+                               '</fieldset>' .
+                               '</form>'
                );
        }
 
@@ -188,32 +189,32 @@ class SpecialMergeHistory extends SpecialPage {
                        # in a nice little table
                        $table =
                                Xml::openElement( 'fieldset' ) .
-                               $this->msg( 'mergehistory-merge', $this->mTargetObj->getPrefixedText(),
-                                       $this->mDestObj->getPrefixedText() )->parse() .
-                               Xml::openElement( 'table', array( 'id' => 'mw-mergehistory-table' ) ) .
+                                       $this->msg( 'mergehistory-merge', $this->mTargetObj->getPrefixedText(),
+                                               $this->mDestObj->getPrefixedText() )->parse() .
+                                       Xml::openElement( 'table', array( 'id' => 'mw-mergehistory-table' ) ) .
                                        '<tr>
                                                <td class="mw-label">' .
-                                                       Xml::label( $this->msg( 'mergehistory-reason' )->text(), 'wpComment' ) .
-                                               '</td>
-                                               <td class="mw-input">' .
-                                                       Xml::input( 'wpComment', 50, $this->mComment, array( 'id' => 'wpComment' ) ) .
-                                               '</td>
+                                       Xml::label( $this->msg( 'mergehistory-reason' )->text(), 'wpComment' ) .
+                                       '</td>
+                                       <td class="mw-input">' .
+                                       Xml::input( 'wpComment', 50, $this->mComment, array( 'id' => 'wpComment' ) ) .
+                                       '</td>
                                        </tr>
                                        <tr>
                                                <td>&#160;</td>
                                                <td class="mw-submit">' .
-                                                       Xml::submitButton( $this->msg( 'mergehistory-submit' )->text(), array( 'name' => 'merge', 'id' => 'mw-merge-submit' ) ) .
-                                               '</td>
+                                       Xml::submitButton( $this->msg( 'mergehistory-submit' )->text(), array( 'name' => 'merge', 'id' => 'mw-merge-submit' ) ) .
+                                       '</td>
                                        </tr>' .
-                               Xml::closeElement( 'table' ) .
-                               Xml::closeElement( 'fieldset' );
+                                       Xml::closeElement( 'table' ) .
+                                       Xml::closeElement( 'fieldset' );
 
                        $out->addHTML( $table );
                }
 
                $out->addHTML(
                        '<h2 id="mw-mergehistory">' .
-                       $this->msg( 'mergehistory-list' )->escaped() . "</h2>\n"
+                               $this->msg( 'mergehistory-list' )->escaped() . "</h2>\n"
                );
 
                if ( $haveRevisions ) {
@@ -319,6 +320,7 @@ class SpecialMergeHistory extends SpecialPage {
                # Destination page must exist with revisions
                if ( !$maxtimestamp ) {
                        $this->getOutput()->addWikiMsg( 'mergehistory-fail' );
+
                        return false;
                }
                # Get the latest timestamp of the source
@@ -331,6 +333,7 @@ class SpecialMergeHistory extends SpecialPage {
                # $this->mTimestamp must be older than $maxtimestamp
                if ( $this->mTimestamp >= $maxtimestamp ) {
                        $this->getOutput()->addWikiMsg( 'mergehistory-fail' );
+
                        return false;
                }
                # Update the revisions
@@ -407,6 +410,7 @@ class SpecialMergeHistory extends SpecialPage {
                # Check if this did anything
                if ( !$count ) {
                        $this->getOutput()->addWikiMsg( 'mergehistory-fail' );
+
                        return false;
                }
                # Update our logs
@@ -475,6 +479,7 @@ class MergeHistoryPager extends ReverseChronologicalPager {
                $this->mResult->seek( 0 );
 
                wfProfileOut( __METHOD__ );
+
                return '';
        }
 
@@ -486,6 +491,7 @@ class MergeHistoryPager extends ReverseChronologicalPager {
                $conds = $this->mConds;
                $conds['rev_page'] = $this->articleID;
                $conds[] = "rev_timestamp < {$this->maxTimestamp}";
+
                return array(
                        'tables' => array( 'revision', 'page', 'user' ),
                        'fields' => array_merge( Revision::selectFields(), Revision::selectUserFields() ),
index a0dbcf0..9b67f34 100644 (file)
@@ -45,14 +45,22 @@ class MostcategoriesPage extends QueryPage {
        function getQueryInfo() {
                return array(
                        'tables' => array( 'categorylinks', 'page' ),
-                       'fields' => array( 'namespace' => 'page_namespace',
-                                       'title' => 'page_title',
-                                       'value' => 'COUNT(*)' ),
+                       'fields' => array(
+                               'namespace' => 'page_namespace',
+                               'title' => 'page_title',
+                               'value' => 'COUNT(*)'
+                       ),
                        'conds' => array( 'page_namespace' => MWNamespace::getContentNamespaces() ),
-                       'options' => array( 'HAVING' => 'COUNT(*) > 1',
-                               'GROUP BY' => array( 'page_namespace', 'page_title' ) ),
-                       'join_conds' => array( 'page' => array( 'LEFT JOIN',
-                                       'page_id = cl_from' ) )
+                       'options' => array(
+                               'HAVING' => 'COUNT(*) > 1',
+                               'GROUP BY' => array( 'page_namespace', 'page_title' )
+                       ),
+                       'join_conds' => array(
+                               'page' => array(
+                                       'LEFT JOIN',
+                                       'page_id = cl_from'
+                               )
+                       )
                );
        }
 
@@ -84,8 +92,15 @@ class MostcategoriesPage extends QueryPage {
        function formatResult( $skin, $result ) {
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
                if ( !$title ) {
-                       return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
-                               Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+                       return Html::element(
+                               'span',
+                               array( 'class' => 'mw-invalidtitle' ),
+                               Linker::getInvalidTitleDescription(
+                                       $this->getContext(),
+                                       $result->namespace,
+                                       $result->title
+                               )
+                       );
                }
 
                if ( $this->isCached() ) {
index a961efd..98d8da3 100644 (file)
@@ -30,7 +30,6 @@
  * @ingroup SpecialPage
  */
 class MostimagesPage extends ImageQueryPage {
-
        function __construct( $name = 'Mostimages' ) {
                parent::__construct( $name );
        }
@@ -46,11 +45,15 @@ class MostimagesPage extends ImageQueryPage {
        function getQueryInfo() {
                return array(
                        'tables' => array( 'imagelinks' ),
-                       'fields' => array( 'namespace' => NS_FILE,
-                                       'title' => 'il_to',
-                                       'value' => 'COUNT(*)' ),
-                       'options' => array( 'GROUP BY' => 'il_to',
-                                       'HAVING' => 'COUNT(*) > 1' )
+                       'fields' => array(
+                               'namespace' => NS_FILE,
+                               'title' => 'il_to',
+                               'value' => 'COUNT(*)'
+                       ),
+                       'options' => array(
+                               'GROUP BY' => 'il_to',
+                               'HAVING' => 'COUNT(*) > 1'
+                       )
                );
        }
 
index 0321fb6..98dd68e 100644 (file)
@@ -30,7 +30,6 @@
  * @ingroup SpecialPage
  */
 class MostinterwikisPage extends QueryPage {
-
        function __construct( $name = 'Mostinterwikis' ) {
                parent::__construct( $name );
        }
@@ -100,8 +99,15 @@ class MostinterwikisPage extends QueryPage {
        function formatResult( $skin, $result ) {
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
                if ( !$title ) {
-                       return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
-                               Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+                       return Html::element(
+                               'span',
+                               array( 'class' => 'mw-invalidtitle' ),
+                               Linker::getInvalidTitleDescription(
+                                       $this->getContext(),
+                                       $result->namespace,
+                                       $result->title
+                               )
+                       );
                }
 
                if ( $this->isCached() ) {
index be28b99..37593bf 100644 (file)
@@ -31,7 +31,6 @@
  * @ingroup SpecialPage
  */
 class MostlinkedPage extends QueryPage {
-
        function __construct( $name = 'Mostlinked' ) {
                parent::__construct( $name );
        }
@@ -47,16 +46,28 @@ class MostlinkedPage extends QueryPage {
        function getQueryInfo() {
                return array(
                        'tables' => array( 'pagelinks', 'page' ),
-                       'fields' => array( 'namespace' => 'pl_namespace',
-                                       'title' => 'pl_title',
-                                       'value' => 'COUNT(*)',
-                                       'page_namespace' ),
-                       'options' => array( 'HAVING' => 'COUNT(*) > 1',
-                               'GROUP BY' => array( 'pl_namespace', 'pl_title',
-                                               'page_namespace' ) ),
-                       'join_conds' => array( 'page' => array( 'LEFT JOIN',
-                                       array( 'page_namespace = pl_namespace',
-                                               'page_title = pl_title' ) ) )
+                       'fields' => array(
+                               'namespace' => 'pl_namespace',
+                               'title' => 'pl_title',
+                               'value' => 'COUNT(*)',
+                               'page_namespace'
+                       ),
+                       'options' => array(
+                               'HAVING' => 'COUNT(*) > 1',
+                               'GROUP BY' => array(
+                                       'pl_namespace', 'pl_title',
+                                       'page_namespace'
+                               )
+                       ),
+                       'join_conds' => array(
+                               'page' => array(
+                                       'LEFT JOIN',
+                                       array(
+                                               'page_namespace = pl_namespace',
+                                               'page_title = pl_title'
+                                       )
+                               )
+                       )
                );
        }
 
@@ -69,9 +80,11 @@ class MostlinkedPage extends QueryPage {
        function preprocessResults( $db, $res ) {
                if ( $res->numRows() > 0 ) {
                        $linkBatch = new LinkBatch();
+
                        foreach ( $res as $row ) {
                                $linkBatch->add( $row->namespace, $row->title );
                        }
+
                        $res->seek( 0 );
                        $linkBatch->execute();
                }
@@ -86,11 +99,13 @@ class MostlinkedPage extends QueryPage {
         */
        function makeWlhLink( $title, $caption ) {
                $wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedDBkey() );
+
                return Linker::linkKnown( $wlh, $caption );
        }
 
        /**
-        * Make links to the page corresponding to the item, and the "what links here" page for it
+        * Make links to the page corresponding to the item,
+        * and the "what links here" page for it
         *
         * @param Skin $skin Skin to be used
         * @param object $result Result row
@@ -99,12 +114,22 @@ class MostlinkedPage extends QueryPage {
        function formatResult( $skin, $result ) {
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
                if ( !$title ) {
-                       return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
-                               Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+                       return Html::element(
+                               'span',
+                               array( 'class' => 'mw-invalidtitle' ),
+                               Linker::getInvalidTitleDescription(
+                                       $this->getContext(),
+                                       $result->namespace,
+                                       $result->title )
+                       );
                }
+
                $link = Linker::link( $title );
-               $wlh = $this->makeWlhLink( $title,
-                       $this->msg( 'nlinks' )->numParams( $result->value )->escaped() );
+               $wlh = $this->makeWlhLink(
+                       $title,
+                       $this->msg( 'nlinks' )->numParams( $result->value )->escaped()
+               );
+
                return $this->getLanguage()->specialList( $link, $wlh );
        }
 
index f0ec664..0d4641b 100644 (file)
@@ -30,7 +30,6 @@
  * @ingroup SpecialPage
  */
 class MostlinkedCategoriesPage extends QueryPage {
-
        function __construct( $name = 'Mostlinkedcategories' ) {
                parent::__construct( $name );
        }
@@ -43,8 +42,8 @@ class MostlinkedCategoriesPage extends QueryPage {
                return array(
                        'tables' => array( 'category' ),
                        'fields' => array( 'title' => 'cat_title',
-                                       'namespace' => NS_CATEGORY,
-                                       'value' => 'cat_pages' ),
+                               'namespace' => NS_CATEGORY,
+                               'value' => 'cat_pages' ),
                );
        }
 
@@ -83,15 +82,20 @@ class MostlinkedCategoriesPage extends QueryPage {
 
                $nt = Title::makeTitleSafe( NS_CATEGORY, $result->title );
                if ( !$nt ) {
-                       return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
-                               Linker::getInvalidTitleDescription( $this->getContext(), NS_CATEGORY, $result->title ) );
+                       return Html::element(
+                               'span',
+                               array( 'class' => 'mw-invalidtitle' ),
+                               Linker::getInvalidTitleDescription(
+                                       $this->getContext(),
+                                       NS_CATEGORY,
+                                       $result->title )
+                       );
                }
 
                $text = $wgContLang->convert( $nt->getText() );
-
                $plink = Linker::link( $nt, htmlspecialchars( $text ) );
-
                $nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped();
+
                return $this->getLanguage()->specialList( $plink, $nlinks );
        }
 
index 2590cf8..c90acb1 100644 (file)
@@ -29,7 +29,6 @@
  * @ingroup SpecialPage
  */
 class MostlinkedTemplatesPage extends QueryPage {
-
        function __construct( $name = 'Mostlinkedtemplates' ) {
                parent::__construct( $name );
        }
@@ -64,9 +63,11 @@ class MostlinkedTemplatesPage extends QueryPage {
        public function getQueryInfo() {
                return array(
                        'tables' => array( 'templatelinks' ),
-                       'fields' => array( 'namespace' => 'tl_namespace',
-                                       'title' => 'tl_title',
-                                       'value' => 'COUNT(*)' ),
+                       'fields' => array(
+                               'namespace' => 'tl_namespace',
+                               'title' => 'tl_title',
+                               'value' => 'COUNT(*)'
+                       ),
                        'conds' => array( 'tl_namespace' => NS_TEMPLATE ),
                        'options' => array( 'GROUP BY' => array( 'tl_namespace', 'tl_title' ) )
                );
@@ -102,8 +103,15 @@ class MostlinkedTemplatesPage extends QueryPage {
        public function formatResult( $skin, $result ) {
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
                if ( !$title ) {
-                       return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
-                               Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+                       return Html::element(
+                               'span',
+                               array( 'class' => 'mw-invalidtitle' ),
+                               Linker::getInvalidTitleDescription(
+                                       $this->getContext(),
+                                       $result->namespace,
+                                       $result->title
+                               )
+                       );
                }
 
                return $this->getLanguage()->specialList(
@@ -122,6 +130,7 @@ class MostlinkedTemplatesPage extends QueryPage {
        private function makeWlhLink( $title, $result ) {
                $wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedText() );
                $label = $this->msg( 'ntransclusions' )->numParams( $result->value )->escaped();
+
                return Linker::link( $wlh, $label );
        }
 
index e4bce1c..2ba3c06 100644 (file)
  * @ingroup SpecialPage
  */
 class MovePageForm extends UnlistedSpecialPage {
-
        /**
+        * Objects
         * @var Title
         */
-       var $oldTitle, $newTitle; # Objects
-       var $reason; # Text input
-       var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects, $leaveRedirect, $moveOverShared; # Checks
+       var $oldTitle, $newTitle;
+       // Text input
+       var $reason;
+       // Checks
+       var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects, $leaveRedirect, $moveOverShared;
 
        private $watch = false;
 
@@ -93,7 +95,8 @@ class MovePageForm extends UnlistedSpecialPage {
                $this->watch = $request->getCheck( 'wpWatch' ) && $user->isLoggedIn();
 
                if ( 'submit' == $request->getVal( 'action' ) && $request->wasPosted()
-                       && $user->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) {
+                       && $user->matchEditToken( $request->getVal( 'wpEditToken' ) )
+               ) {
                        $this->doSubmit();
                } else {
                        $this->showForm( array() );
@@ -146,16 +149,26 @@ class MovePageForm extends UnlistedSpecialPage {
                                <tr>
                                        <td></td>
                                        <td class='mw-input'>" .
-                                               Xml::checkLabel( $this->msg( 'delete_and_move_confirm' )->text(), 'wpConfirm', 'wpConfirm' ) .
-                                       "</td>
+                               Xml::checkLabel(
+                                       $this->msg( 'delete_and_move_confirm' )->text(),
+                                       'wpConfirm',
+                                       'wpConfirm'
+                               ) .
+                               "</td>
                                </tr>";
                        $err = array();
                } else {
                        if ( $this->oldTitle->getNamespace() == NS_USER && !$this->oldTitle->isSubpage() ) {
-                               $out->wrapWikiMsg( "<div class=\"error mw-moveuserpage-warning\">\n$1\n</div>", 'moveuserpage-warning' );
+                               $out->wrapWikiMsg(
+                                       "<div class=\"error mw-moveuserpage-warning\">\n$1\n</div>",
+                                       'moveuserpage-warning'
+                               );
                        }
-                       $out->addWikiMsg( $wgFixDoubleRedirects ? 'movepagetext' :
-                               'movepagetext-noredirectfixer' );
+
+                       $out->addWikiMsg( $wgFixDoubleRedirects ?
+                               'movepagetext' :
+                               'movepagetext-noredirectfixer'
+                       );
                        $movepagebtn = $this->msg( 'movepagebtn' )->text();
                        $submitVar = 'wpMove';
                        $confirm = false;
@@ -205,6 +218,7 @@ class MovePageForm extends UnlistedSpecialPage {
                        if ( count( $err ) == 1 ) {
                                $errMsg = $err[0];
                                $errMsgName = array_shift( $errMsg );
+
                                if ( $errMsgName == 'hookaborted' ) {
                                        $out->addHTML( "<p>{$errMsg[0]}</p>\n" );
                                } else {
@@ -212,6 +226,7 @@ class MovePageForm extends UnlistedSpecialPage {
                                }
                        } else {
                                $errStr = array();
+
                                foreach ( $err as $errMsg ) {
                                        if ( $errMsg[0] == 'hookaborted' ) {
                                                $errStr[] = $errMsg[1];
@@ -238,7 +253,13 @@ class MovePageForm extends UnlistedSpecialPage {
                        }
                        $out->addHTML( "<div class='mw-warning-with-logexcerpt'>\n" );
                        $out->addWikiMsg( $noticeMsg );
-                       LogEventsList::showLogExtract( $out, 'protect', $this->oldTitle, '', array( 'lim' => 1 ) );
+                       LogEventsList::showLogExtract(
+                               $out,
+                               'protect',
+                               $this->oldTitle,
+                               '',
+                               array( 'lim' => 1 )
+                       );
                        $out->addHTML( "</div>\n" );
                }
 
@@ -256,13 +277,20 @@ class MovePageForm extends UnlistedSpecialPage {
                $handler = ContentHandler::getForTitle( $this->oldTitle );
 
                $out->addHTML(
-                       Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL( 'action=submit' ), 'id' => 'movepage' ) ) .
-                       Xml::openElement( 'fieldset' ) .
-                       Xml::element( 'legend', null, $this->msg( 'move-page-legend' )->text() ) .
-                       Xml::openElement( 'table', array( 'id' => 'mw-movepage-table' ) ) .
-                       "<tr>
+                       Xml::openElement(
+                               'form',
+                               array(
+                                       'method' => 'post',
+                                       'action' => $this->getTitle()->getLocalURL( 'action=submit' ),
+                                       'id' => 'movepage'
+                               )
+                       ) .
+                               Xml::openElement( 'fieldset' ) .
+                               Xml::element( 'legend', null, $this->msg( 'move-page-legend' )->text() ) .
+                               Xml::openElement( 'table', array( 'id' => 'mw-movepage-table' ) ) .
+                               "<tr>
                                <td class='mw-label'>" .
-                                       $this->msg( 'movearticle' )->escaped() .
+                               $this->msg( 'movearticle' )->escaped() .
                                "</td>
                                <td class='mw-input'>
                                        <strong>{$oldTitleLink}</strong>
@@ -270,27 +298,32 @@ class MovePageForm extends UnlistedSpecialPage {
                        </tr>
                        <tr>
                                <td class='mw-label'>" .
-                                       Xml::label( $this->msg( 'newtitle' )->text(), 'wpNewTitleMain' ) .
+                               Xml::label( $this->msg( 'newtitle' )->text(), 'wpNewTitleMain' ) .
                                "</td>
                                <td class='mw-input'>" .
-                                       Html::namespaceSelector(
-                                               array(
-                                                       'selected' => $newTitle->getNamespace(),
-                                                       'exclude' => $immovableNamespaces
-                                               ),
-                                               array( 'name' => 'wpNewTitleNs', 'id' => 'wpNewTitleNs' )
-                                       ) .
-                                       Xml::input( 'wpNewTitleMain', 60, $wgContLang->recodeForEdit( $newTitle->getText() ), array(
+                               Html::namespaceSelector(
+                                       array(
+                                               'selected' => $newTitle->getNamespace(),
+                                               'exclude' => $immovableNamespaces
+                                       ),
+                                       array( 'name' => 'wpNewTitleNs', 'id' => 'wpNewTitleNs' )
+                               ) .
+                               Xml::input(
+                                       'wpNewTitleMain',
+                                       60,
+                                       $wgContLang->recodeForEdit( $newTitle->getText() ),
+                                       array(
                                                'type' => 'text',
                                                'id' => 'wpNewTitleMain',
-                                               'maxlength' => 255,
-                                       ) ) .
-                                       Html::hidden( 'wpOldTitle', $this->oldTitle->getPrefixedText() ) .
+                                               'maxlength' => 255
+                                       )
+                               ) .
+                               Html::hidden( 'wpOldTitle', $this->oldTitle->getPrefixedText() ) .
                                "</td>
                        </tr>
                        <tr>
                                <td class='mw-label'>" .
-                                       Xml::label( $this->msg( 'movereason' )->text(), 'wpReason' ) .
+                               Xml::label( $this->msg( 'movereason' )->text(), 'wpReason' ) .
                                "</td>
                                <td class='mw-input'>" .
                                        Xml::input( 'wpReason', 60, $this->reason, array(
@@ -307,7 +340,12 @@ class MovePageForm extends UnlistedSpecialPage {
                                <tr>
                                        <td></td>
                                        <td class='mw-input'>" .
-                                               Xml::checkLabel( $this->msg( 'movetalk' )->text(), 'wpMovetalk', 'wpMovetalk', $this->moveTalk ) .
+                                       Xml::checkLabel(
+                                               $this->msg( 'movetalk' )->text(),
+                                               'wpMovetalk',
+                                               'wpMovetalk',
+                                               $this->moveTalk
+                                       ) .
                                        "</td>
                                </tr>"
                        );
@@ -318,8 +356,12 @@ class MovePageForm extends UnlistedSpecialPage {
                                <tr>
                                        <td></td>
                                        <td class='mw-input' >" .
-                                               Xml::checkLabel( $this->msg( 'move-leave-redirect' )->text(), 'wpLeaveRedirect',
-                                                       'wpLeaveRedirect', $this->leaveRedirect ) .
+                                       Xml::checkLabel(
+                                               $this->msg( 'move-leave-redirect' )->text(),
+                                               'wpLeaveRedirect',
+                                               'wpLeaveRedirect',
+                                               $this->leaveRedirect
+                                       ) .
                                        "</td>
                                </tr>"
                        );
@@ -330,8 +372,12 @@ class MovePageForm extends UnlistedSpecialPage {
                                <tr>
                                        <td></td>
                                        <td class='mw-input' >" .
-                                               Xml::checkLabel( $this->msg( 'fix-double-redirects' )->text(), 'wpFixRedirects',
-                                                       'wpFixRedirects', $this->fixRedirects ) .
+                                       Xml::checkLabel(
+                                               $this->msg( 'fix-double-redirects' )->text(),
+                                               'wpFixRedirects',
+                                               'wpFixRedirects',
+                                               $this->fixRedirects
+                                       ) .
                                        "</td>
                                </tr>"
                        );
@@ -342,20 +388,20 @@ class MovePageForm extends UnlistedSpecialPage {
                                <tr>
                                        <td></td>
                                        <td class=\"mw-input\">" .
-                               Xml::check(
-                                       'wpMovesubpages',
-                                       # Don't check the box if we only have talk subpages to
-                                       # move and we aren't moving the talk page.
-                                       $this->moveSubpages && ( $this->oldTitle->hasSubpages() || $this->moveTalk ),
-                                       array( 'id' => 'wpMovesubpages' )
-                               ) . '&#160;' .
-                               Xml::tags( 'label', array( 'for' => 'wpMovesubpages' ),
-                                       $this->msg(
-                                               ( $this->oldTitle->hasSubpages()
-                                                       ? 'move-subpages'
-                                                       : 'move-talk-subpages' )
+                                       Xml::check(
+                                               'wpMovesubpages',
+                                               # Don't check the box if we only have talk subpages to
+                                               # move and we aren't moving the talk page.
+                                               $this->moveSubpages && ( $this->oldTitle->hasSubpages() || $this->moveTalk ),
+                                               array( 'id' => 'wpMovesubpages' )
+                                       ) . '&#160;' .
+                                       Xml::tags( 'label', array( 'for' => 'wpMovesubpages' ),
+                                               $this->msg(
+                                                       ( $this->oldTitle->hasSubpages()
+                                                               ? 'move-subpages'
+                                                               : 'move-talk-subpages' )
                                                )->numParams( $wgMaximumMovedPages )->params( $wgMaximumMovedPages )->parse()
-                               ) .
+                                       ) .
                                        "</td>
                                </tr>"
                        );
@@ -369,7 +415,12 @@ class MovePageForm extends UnlistedSpecialPage {
                        <tr>
                                <td></td>
                                <td class='mw-input'>" .
-                                       Xml::checkLabel( $this->msg( 'move-watch' )->text(), 'wpWatch', 'watch', $watchChecked ) .
+                               Xml::checkLabel(
+                                       $this->msg( 'move-watch' )->text(),
+                                       'wpWatch',
+                                       'watch',
+                                       $watchChecked
+                               ) .
                                "</td>
                        </tr>" );
                }
@@ -379,19 +430,18 @@ class MovePageForm extends UnlistedSpecialPage {
                        <tr>
                                <td>&#160;</td>
                                <td class='mw-submit'>" .
-                                       Xml::submitButton( $movepagebtn, array( 'name' => $submitVar ) ) .
+                               Xml::submitButton( $movepagebtn, array( 'name' => $submitVar ) ) .
                                "</td>
                        </tr>" .
-                       Xml::closeElement( 'table' ) .
-                       Html::hidden( 'wpEditToken', $user->getEditToken() ) .
-                       Xml::closeElement( 'fieldset' ) .
-                       Xml::closeElement( 'form' ) .
-                       "\n"
+                               Xml::closeElement( 'table' ) .
+                               Html::hidden( 'wpEditToken', $user->getEditToken() ) .
+                               Xml::closeElement( 'fieldset' ) .
+                               Xml::closeElement( 'form' ) .
+                               "\n"
                );
 
                $this->showLogFragment( $this->oldTitle );
                $this->showSubpages( $this->oldTitle );
-
        }
 
        function doSubmit() {
@@ -409,6 +459,7 @@ class MovePageForm extends UnlistedSpecialPage {
                # don't allow moving to pages with # in
                if ( !$nt || $nt->getFragment() != '' ) {
                        $this->showForm( array( array( 'badtitletext' ) ) );
+
                        return;
                }
 
@@ -416,11 +467,11 @@ class MovePageForm extends UnlistedSpecialPage {
                if ( $nt->getNamespace() == NS_FILE
                        && !( $this->moveOverShared && $user->isAllowed( 'reupload-shared' ) )
                        && !RepoGroup::singleton()->getLocalRepo()->findFile( $nt )
-                       && wfFindFile( $nt ) )
-               {
+                       && wfFindFile( $nt )
+               {
                        $this->showForm( array( array( 'file-exists-sharedrepo' ) ) );
-                       return;
 
+                       return;
                }
 
                # Delete to make way if requested
@@ -429,6 +480,7 @@ class MovePageForm extends UnlistedSpecialPage {
                        if ( count( $permErrors ) ) {
                                # Only show the first error
                                $this->showForm( $permErrors );
+
                                return;
                        }
 
@@ -447,6 +499,7 @@ class MovePageForm extends UnlistedSpecialPage {
                        $deleteStatus = $page->doDeleteArticleReal( $reason, false, 0, true, $error, $user );
                        if ( !$deleteStatus->isGood() ) {
                                $this->showForm( $deleteStatus->getErrorsArray() );
+
                                return;
                        }
                }
@@ -465,6 +518,7 @@ class MovePageForm extends UnlistedSpecialPage {
                $error = $ot->moveTo( $nt, true, $this->reason, $createRedirect );
                if ( $error !== true ) {
                        $this->showForm( $error );
+
                        return;
                }
 
@@ -530,7 +584,7 @@ class MovePageForm extends UnlistedSpecialPage {
                if ( $this->moveSubpages && (
                        MWNamespace::hasSubpages( $nt->getNamespace() ) || (
                                $this->moveTalk &&
-                               MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
+                                       MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
                        )
                ) ) {
                        $conds = array(
@@ -541,7 +595,9 @@ class MovePageForm extends UnlistedSpecialPage {
                        if ( MWNamespace::hasSubpages( $nt->getNamespace() ) ) {
                                $conds['page_namespace'][] = $ot->getNamespace();
                        }
-                       if ( $this->moveTalk && MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() ) ) {
+                       if ( $this->moveTalk &&
+                               MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
+                       ) {
                                $conds['page_namespace'][] = $ot->getTalkPage()->getNamespace();
                        }
                } elseif ( $this->moveTalk ) {
@@ -578,18 +634,20 @@ class MovePageForm extends UnlistedSpecialPage {
                                StringUtils::escapeRegexReplacement( $nt->getDBkey() ), # bug 21234
                                $oldSubpage->getDBkey()
                        );
+
                        if ( $oldSubpage->isTalkPage() ) {
                                $newNs = $nt->getTalkPage()->getNamespace();
                        } else {
                                $newNs = $nt->getSubjectPage()->getNamespace();
                        }
+
                        # Bug 14385: we need makeTitleSafe because the new page names may
                        # be longer than 255 characters.
                        $newSubpage = Title::makeTitleSafe( $newNs, $newPageName );
                        if ( !$newSubpage ) {
                                $oldLink = Linker::linkKnown( $oldSubpage );
-                               $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink
-                                       )->params( Title::makeName( $newNs, $newPageName ) )->escaped();
+                               $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink     )
+                                       ->params( Title::makeName( $newNs, $newPageName ) )->escaped();
                                continue;
                        }
 
@@ -599,6 +657,7 @@ class MovePageForm extends UnlistedSpecialPage {
                                $extraOutput[] = $this->msg( 'movepage-page-exists' )->rawParams( $link )->escaped();
                        } else {
                                $success = $oldSubpage->moveTo( $newSubpage, true, $this->reason, $createRedirect );
+
                                if ( $success === true ) {
                                        if ( $this->fixRedirects ) {
                                                DoubleRedirectJob::fixRedirects( 'move', $oldSubpage, $newSubpage );
@@ -609,9 +668,11 @@ class MovePageForm extends UnlistedSpecialPage {
                                                array(),
                                                array( 'redirect' => 'no' )
                                        );
+
                                        $newLink = Linker::linkKnown( $newSubpage );
                                        $extraOutput[] = $this->msg( 'movepage-page-moved' )->rawParams( $oldLink, $newLink )->escaped();
                                        ++$count;
+
                                        if ( $count >= $wgMaximumMovedPages ) {
                                                $extraOutput[] = $this->msg( 'movepage-max-pages' )->numParams( $wgMaximumMovedPages )->escaped();
                                                break;
@@ -622,7 +683,6 @@ class MovePageForm extends UnlistedSpecialPage {
                                        $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink, $newLink )->escaped();
                                }
                        }
-
                }
 
                if ( $extraOutput !== array() ) {
@@ -667,6 +727,7 @@ class MovePageForm extends UnlistedSpecialPage {
                # No subpages.
                if ( $count == 0 ) {
                        $out->addWikiMsg( 'movenosubpage' );
+
                        return;
                }
 
index b865f40..8e92e4a 100644 (file)
@@ -21,7 +21,6 @@
  * @ingroup SpecialPage
  */
 class SpecialNewFiles extends IncludableSpecialPage {
-
        public function __construct() {
                parent::__construct( 'Newimages' );
        }
@@ -37,6 +36,7 @@ class SpecialNewFiles extends IncludableSpecialPage {
                        $form->prepareForm();
                        $form->displayForm( '' );
                }
+
                $this->getOutput()->addHTML( $pager->getBody() );
                if ( !$this->including() ) {
                        $this->getOutput()->addHTML( $pager->getNavigationBar() );
@@ -52,7 +52,6 @@ class SpecialNewFiles extends IncludableSpecialPage {
  * @ingroup SpecialPage Pager
  */
 class NewFilesPager extends ReverseChronologicalPager {
-
        /**
         * @var ImageGallery
         */
@@ -75,6 +74,7 @@ class NewFilesPager extends ReverseChronologicalPager {
 
                if ( !$this->showbots ) {
                        $groupsWithBotPermission = User::getGroupsWithPermission( 'bot' );
+
                        if ( count( $groupsWithBotPermission ) ) {
                                $tables[] = 'user_groups';
                                $conds[] = 'ug_group IS NULL';
@@ -92,7 +92,11 @@ class NewFilesPager extends ReverseChronologicalPager {
                        $dbr = wfGetDB( DB_SLAVE );
                        $likeObj = Title::newFromURL( $this->like );
                        if ( $likeObj instanceof Title ) {
-                               $like = $dbr->buildLike( $dbr->anyString(), strtolower( $likeObj->getDBkey() ), $dbr->anyString() );
+                               $like = $dbr->buildLike(
+                                       $dbr->anyString(),
+                                       strtolower( $likeObj->getDBkey() ),
+                                       $dbr->anyString()
+                               );
                                $conds[] = "LOWER(img_name) $like";
                        }
                }
@@ -115,6 +119,7 @@ class NewFilesPager extends ReverseChronologicalPager {
                if ( !$this->gallery ) {
                        $this->gallery = new ImageGallery();
                }
+
                return '';
        }
 
@@ -128,11 +133,12 @@ class NewFilesPager extends ReverseChronologicalPager {
 
                $title = Title::makeTitle( NS_FILE, $name );
                $ul = Linker::link( $user->getUserpage(), $user->getName() );
+               $time = $this->getLanguage()->userTimeAndDate( $row->img_timestamp, $this->getUser() );
 
                $this->gallery->add(
                        $title,
                        "$ul<br />\n<i>"
-                               . htmlspecialchars( $this->getLanguage()->userTimeAndDate( $row->img_timestamp, $this->getUser() ) )
+                               . htmlspecialchars( $time )
                                . "</i><br />\n"
                );
        }
@@ -150,7 +156,6 @@ class NewFilesPager extends ReverseChronologicalPager {
                                'type' => 'check',
                                'label' => $this->msg( 'showhidebots', $this->msg( 'show' )->plain() )->escaped(),
                                'name' => 'showbots',
-                       #       'default' => $this->getRequest()->getBool( 'showbots', 0 ),
                        ),
                        'limit' => array(
                                'type' => 'hidden',
index 46bf81a..fc6151f 100644 (file)
@@ -27,7 +27,6 @@
  * @ingroup SpecialPage
  */
 class SpecialNewpages extends IncludableSpecialPage {
-
        // Stored objects
 
        /**
@@ -144,6 +143,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                        $feedType = $this->opts->getValue( 'feed' );
                        if ( $feedType ) {
                                $this->feed( $feedType );
+
                                return;
                        }
 
@@ -198,7 +198,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                foreach ( $filters as $key => $msg ) {
                        $onoff = 1 - $this->opts->getValue( $key );
                        $link = Linker::link( $self, $showhide[$onoff], array(),
-                                       array( $key => $onoff ) + $changed
+                               array( $key => $onoff ) + $changed
                        );
                        $links[$key] = $this->msg( $msg )->rawParams( $link )->escaped();
                }
@@ -238,55 +238,55 @@ class SpecialNewpages extends IncludableSpecialPage {
                        Xml::openElement( 'table', array( 'id' => 'mw-newpages-table' ) ) .
                        '<tr>
                                <td class="mw-label">' .
-                                       Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) .
-                               '</td>
-                               <td class="mw-input">' .
-                                       Html::namespaceSelector(
-                                               array(
-                                                       'selected' => $namespace,
-                                                       'all' => 'all',
-                                               ), array(
-                                                       'name' => 'namespace',
-                                                       'id' => 'namespace',
-                                                       'class' => 'namespaceselector',
-                                               )
-                                       ) . '&#160;' .
-                                       Xml::checkLabel(
-                                               $this->msg( 'invert' )->text(),
-                                               'invert',
-                                               'nsinvert',
-                                               $nsinvert,
-                                               array( 'title' => $this->msg( 'tooltip-invert' )->text() )
-                                       ) .
-                               '</td>
+                       Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) .
+                       '</td>
+                       <td class="mw-input">' .
+                       Html::namespaceSelector(
+                               array(
+                                       'selected' => $namespace,
+                                       'all' => 'all',
+                               ), array(
+                                       'name' => 'namespace',
+                                       'id' => 'namespace',
+                                       'class' => 'namespaceselector',
+                               )
+                       ) . '&#160;' .
+                       Xml::checkLabel(
+                               $this->msg( 'invert' )->text(),
+                               'invert',
+                               'nsinvert',
+                               $nsinvert,
+                               array( 'title' => $this->msg( 'tooltip-invert' )->text() )
+                       ) .
+                       '</td>
                        </tr>' . ( $tagFilter ? (
                        '<tr>
                                <td class="mw-label">' .
-                                       $tagFilterLabel .
+                               $tagFilterLabel .
                                '</td>
                                <td class="mw-input">' .
-                                       $tagFilterSelector .
+                               $tagFilterSelector .
                                '</td>
                        </tr>' ) : '' ) .
                        ( $wgEnableNewpagesUserFilter ?
-                       '<tr>
+                               '<tr>
                                <td class="mw-label">' .
                                        Xml::label( $this->msg( 'newpages-username' )->text(), 'mw-np-username' ) .
-                               '</td>
+                                       '</td>
                                <td class="mw-input">' .
                                        Xml::input( 'username', 30, $userText, array( 'id' => 'mw-np-username' ) ) .
-                               '</td>
+                                       '</td>
                        </tr>' : '' ) .
                        '<tr> <td></td>
                                <td class="mw-submit">' .
-                                       Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) .
-                               '</td>
-                       </tr>' .
+                       Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) .
+                       '</td>
+               </tr>' .
                        '<tr>
                                <td></td>
                                <td class="mw-input">' .
-                                       $this->filterLinks() .
-                               '</td>
+                       $this->filterLinks() .
+                       '</td>
                        </tr>' .
                        Xml::closeElement( 'table' ) .
                        Xml::closeElement( 'fieldset' ) .
@@ -297,9 +297,10 @@ class SpecialNewpages extends IncludableSpecialPage {
        }
 
        /**
-        * Format a row, providing the timestamp, links to the page/history, size, user links, and a comment
+        * Format a row, providing the timestamp, links to the page/history,
+        * size, user links, and a comment
         *
-        * @param $result Result row
+        * @param object $result Result row
         * @return String
         */
        public function formatRow( $result ) {
@@ -337,7 +338,8 @@ class SpecialNewpages extends IncludableSpecialPage {
                        $query['rcid'] = $result->rc_id;
                }
 
-               // Linker::linkKnown() uses 'known' and 'noclasses' options. This breaks the colouration for stubs.
+               // Linker::linkKnown() uses 'known' and 'noclasses' options.
+               // This breaks the colouration for stubs.
                $plink = Linker::link(
                        $title,
                        null,
@@ -354,8 +356,12 @@ class SpecialNewpages extends IncludableSpecialPage {
                $hist = Html::rawElement( 'span', array( 'class' => 'mw-newpages-history' ),
                        $this->msg( 'parentheses' )->rawParams( $histLink )->escaped() );
 
-               $length = Html::element( 'span', array( 'class' => 'mw-newpages-length' ),
-                       $this->msg( 'brackets' )->params( $this->msg( 'nbytes' )->numParams( $result->length )->text() )
+               $length = Html::element(
+                       'span',
+                       array( 'class' => 'mw-newpages-length' ),
+                       $this->msg( 'brackets' )->params( $this->msg( 'nbytes' )
+                               ->numParams( $result->length )->text()
+                       )
                );
 
                $ulink = Linker::revUserTools( $rev );
@@ -372,7 +378,10 @@ class SpecialNewpages extends IncludableSpecialPage {
 
                # Tags, if any.
                if ( isset( $result->ts_tags ) ) {
-                       list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow( $result->ts_tags, 'newpages' );
+                       list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow(
+                               $result->ts_tags,
+                               'newpages'
+                       );
                        $classes = array_merge( $classes, $newClasses );
                } else {
                        $tagDisplay = '';
@@ -383,8 +392,10 @@ class SpecialNewpages extends IncludableSpecialPage {
                # Display the old title if the namespace/title has been changed
                $oldTitleText = '';
                $oldTitle = Title::makeTitle( $result->rc_namespace, $result->rc_title );
+
                if ( !$title->equals( $oldTitle ) ) {
-                       $oldTitleText = $this->msg( 'rc-old-title' )->params( $oldTitle->getPrefixedText() )->escaped();
+                       $oldTitleText = $oldTitle->getPrefixedText();
+                       $oldTitleText = $this->msg( 'rc-old-title' )->params( $oldTitleText )->escaped();
                }
 
                return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay} {$oldTitleText}</li>\n";
@@ -393,7 +404,7 @@ class SpecialNewpages extends IncludableSpecialPage {
        /**
         * Should a specific result row provide "patrollable" links?
         *
-        * @param $result Result row
+        * @param object $result Result row
         * @return Boolean
         */
        protected function patrollable( $result ) {
@@ -410,11 +421,13 @@ class SpecialNewpages extends IncludableSpecialPage {
 
                if ( !$wgFeed ) {
                        $this->getOutput()->addWikiMsg( 'feed-unavailable' );
+
                        return;
                }
 
                if ( !isset( $wgFeedClasses[$type] ) ) {
                        $this->getOutput()->addWikiMsg( 'feed-invalid' );
+
                        return;
                }
 
@@ -440,6 +453,7 @@ class SpecialNewpages extends IncludableSpecialPage {
        protected function feedTitle() {
                global $wgLanguageCode, $wgSitename;
                $desc = $this->getDescription();
+
                return "$wgSitename - $desc [$wgLanguageCode]";
        }
 
@@ -476,6 +490,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                                "</p>\n<hr />\n<div>" .
                                nl2br( htmlspecialchars( $revision->getContent()->serialize() ) ) . "</div>";
                }
+
                return '';
        }
 
@@ -528,14 +543,18 @@ class NewPagesPager extends ReverseChronologicalPager {
                if ( $wgEnableNewpagesUserFilter && $user ) {
                        $conds['rc_user_text'] = $user->getText();
                        $rcIndexes = 'rc_user_text';
-               # If anons cannot make new pages, don't "exclude logged in users"!
-               } elseif ( User::groupHasPermission( '*', 'createpage' ) && $this->opts->getValue( 'hideliu' ) ) {
+               } elseif ( User::groupHasPermission( '*', 'createpage' ) &&
+                       $this->opts->getValue( 'hideliu' )
+               ) {
+                       # If anons cannot make new pages, don't "exclude logged in users"!
                        $conds['rc_user'] = 0;
                }
+
                # If this user cannot see patrolled edits or they are off, don't do dumb queries!
                if ( $this->opts->getValue( 'hidepatrolled' ) && $this->getUser()->useNPPatrol() ) {
                        $conds['rc_patrolled'] = 0;
                }
+
                if ( $this->opts->getValue( 'hidebots' ) ) {
                        $conds['rc_bot'] = 0;
                }
@@ -595,6 +614,7 @@ class NewPagesPager extends ReverseChronologicalPager {
                        $linkBatch->add( $row->rc_namespace, $row->rc_title );
                }
                $linkBatch->execute();
+
                return '<ul>';
        }
 
index 51dd99f..72a3476 100644 (file)
@@ -23,7 +23,6 @@
  * @author Brad Jorsch
  */
 
-
 /**
  * Special:PagesWithProp to search the page_props table
  * @ingroup SpecialPage
@@ -128,11 +127,11 @@ class SpecialPagesWithProp extends QueryPage {
                $title = Title::newFromRow( $result );
                $ret = Linker::link( $title, null, array(), array(), array( 'known' ) );
                if ( $result->pp_value !== '' ) {
-                       $value = $this->msg( 'parentheses' )
-                               ->rawParams( Html::element( 'span', array( 'class' => 'prop-value' ), $result->pp_value ) )
-                               ->escaped();
+                       $propValue = Html::element( 'span', array( 'class' => 'prop-value' ), $result->pp_value );
+                       $value = $this->msg( 'parentheses' )->rawParams( $propValue )->escaped();
                        $ret .= " $value";
                }
+
                return $ret;
        }
 
index d1f8136..fd46c03 100644 (file)
@@ -27,7 +27,6 @@
  * @ingroup SpecialPage
  */
 class SpecialPasswordReset extends FormSpecialPage {
-
        /**
         * @var Message
         */
@@ -70,6 +69,7 @@ class SpecialPasswordReset extends FormSpecialPage {
                                'type' => 'text',
                                'label-message' => 'passwordreset-username',
                        );
+
                        if ( $this->getUser()->isLoggedIn() ) {
                                $a['Username']['default'] = $this->getUser()->getName();
                        }
@@ -118,6 +118,7 @@ class SpecialPasswordReset extends FormSpecialPage {
                if ( isset( $wgPasswordResetRoutes['domain'] ) && $wgPasswordResetRoutes['domain'] ) {
                        $i++;
                }
+
                return $this->msg( 'passwordreset-pretext', $i )->parseAsBlock();
        }
 
@@ -142,7 +143,8 @@ class SpecialPasswordReset extends FormSpecialPage {
                }
 
                if ( isset( $data['Capture'] ) && !$this->getUser()->isAllowed( 'passwordreset' ) ) {
-                       // The user knows they don't have the passwordreset permission, but they tried to spoof the form.  That's naughty
+                       // The user knows they don't have the passwordreset permission,
+                       // but they tried to spoof the form. That's naughty
                        throw new PermissionsError( 'passwordreset' );
                }
 
@@ -156,8 +158,8 @@ class SpecialPasswordReset extends FormSpecialPage {
                        $users = array( User::newFromName( $data['Username'] ) );
                } elseif ( isset( $data['Email'] )
                        && $data['Email'] !== ''
-                       && Sanitizer::validateEmail( $data['Email'] ) )
-               {
+                       && Sanitizer::validateEmail( $data['Email'] )
+               {
                        $method = 'email';
                        $res = wfGetDB( DB_SLAVE )->select(
                                'user',
@@ -165,8 +167,10 @@ class SpecialPasswordReset extends FormSpecialPage {
                                array( 'user_email' => $data['Email'] ),
                                __METHOD__
                        );
+
                        if ( $res ) {
                                $users = array();
+
                                foreach ( $res as $row ) {
                                        $users[] = User::newFromRow( $row );
                                }
@@ -209,9 +213,13 @@ class SpecialPasswordReset extends FormSpecialPage {
                foreach ( $users as $user ) {
                        if ( $user->isPasswordReminderThrottled() ) {
                                global $wgPasswordReminderResendTime;
+
                                # Round the time in hours to 3 d.p., in case someone is specifying
                                # minutes or seconds.
-                               return array( array( 'throttled-mailpassword', round( $wgPasswordReminderResendTime, 3 ) ) );
+                               return array( array(
+                                       'throttled-mailpassword',
+                                       round( $wgPasswordReminderResendTime, 3 )
+                               ) );
                        }
                }
 
@@ -244,8 +252,8 @@ class SpecialPasswordReset extends FormSpecialPage {
                        $password = $user->randomPassword();
                        $user->setNewpassword( $password );
                        $user->saveSettings();
-                       $passwords[] = $this->msg( 'passwordreset-emailelement', $user->getName(), $password
-                               )->inLanguage( $userLanguage )->text(); // We'll escape the whole thing later
+                       $passwords[] = $this->msg( 'passwordreset-emailelement', $user->getName(), $password )
+                               ->inLanguage( $userLanguage )->text(); // We'll escape the whole thing later
                }
                $passwordBlock = implode( "\n\n", $passwords );
 
@@ -276,8 +284,9 @@ class SpecialPasswordReset extends FormSpecialPage {
                        // The email didn't send, but maybe they knew that and that's why they captured it
                        return true;
                } else {
-                       // @todo FIXME: The email didn't send, but we have already set the password throttle
-                       // timestamp, so they won't be able to try again until it expires...  :(
+                       // @todo FIXME: The email wasn't sent, but we have already set
+                       // the password throttle timestamp, so they won't be able to try
+                       // again until it expires...  :(
                        return array( array( 'mailerror', $this->result->getMessage() ) );
                }
        }
@@ -305,8 +314,8 @@ class SpecialPasswordReset extends FormSpecialPage {
 
                // Maybe password resets are disabled, or there are no allowable routes
                if ( !is_array( $wgPasswordResetRoutes ) ||
-                        !in_array( true, array_values( $wgPasswordResetRoutes ) ) )
-               {
+                       !in_array( true, array_values( $wgPasswordResetRoutes ) )
+               {
                        return 'passwordreset-disabled';
                }
 
index 81797f2..2a80f65 100644 (file)
@@ -27,7 +27,6 @@
  * @ingroup SpecialPage
  */
 class PopularPagesPage extends QueryPage {
-
        function __construct( $name = 'Popularpages' ) {
                parent::__construct( $name );
        }
@@ -44,11 +43,15 @@ class PopularPagesPage extends QueryPage {
        function getQueryInfo() {
                return array(
                        'tables' => array( 'page' ),
-                       'fields' => array( 'namespace' => 'page_namespace',
-                                       'title' => 'page_title',
-                                       'value' => 'page_counter' ),
-                       'conds' => array( 'page_is_redirect' => 0,
-                                       'page_namespace' => MWNamespace::getContentNamespaces() ) );
+                       'fields' => array(
+                               'namespace' => 'page_namespace',
+                               'title' => 'page_title',
+                               'value' => 'page_counter' ),
+                       'conds' => array(
+                               'page_is_redirect' => 0,
+                               'page_namespace' => MWNamespace::getContentNamespaces()
+                       )
+               );
        }
 
        /**
@@ -61,8 +64,14 @@ class PopularPagesPage extends QueryPage {
 
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
                if ( !$title ) {
-                       return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
-                               Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+                       return Html::element(
+                               'span',
+                               array( 'class' => 'mw-invalidtitle' ),
+                               Linker::getInvalidTitleDescription(
+                                       $this->getContext(),
+                                       $result->namespace,
+                                       $result->title )
+                       );
                }
 
                $link = Linker::linkKnown(
@@ -70,6 +79,7 @@ class PopularPagesPage extends QueryPage {
                        htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )
                );
                $nv = $this->msg( 'nviews' )->numParams( $result->value )->escaped();
+
                return $this->getLanguage()->specialList( $link, $nv );
        }
 
index ee5940f..bb6bc95 100644 (file)
@@ -35,16 +35,21 @@ class SpecialPreferences extends SpecialPage {
                $this->setHeaders();
                $this->outputHeader();
                $out = $this->getOutput();
-               $out->disallowUserJs();  # Prevent hijacked user scripts from sniffing passwords etc.
+               $out->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc.
 
                $user = $this->getUser();
                if ( $user->isAnon() ) {
-                       throw new ErrorPageError( 'prefsnologin', 'prefsnologintext', array( $this->getTitle()->getPrefixedDBkey() ) );
+                       throw new ErrorPageError(
+                               'prefsnologin',
+                               'prefsnologintext',
+                               array( $this->getTitle()->getPrefixedDBkey() )
+                       );
                }
                $this->checkReadOnly();
 
                if ( $par == 'reset' ) {
                        $this->showResetForm();
+
                        return;
                }
 
index f914702..1322d54 100644 (file)
@@ -98,37 +98,38 @@ class SpecialPrefixindex extends SpecialAllpages {
                $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) );
                $out .= "<tr>
                                <td class='mw-label'>" .
-                               Xml::label( $this->msg( 'allpagesprefix' )->text(), 'nsfrom' ) .
-                               "</td>
+                       Xml::label( $this->msg( 'allpagesprefix' )->text(), 'nsfrom' ) .
+                       "</td>
                                <td class='mw-input'>" .
-                                       Xml::input( 'prefix', 30, str_replace( '_', ' ', $from ), array( 'id' => 'nsfrom' ) ) .
-                               "</td>
+                       Xml::input( 'prefix', 30, str_replace( '_', ' ', $from ), array( 'id' => 'nsfrom' ) ) .
+                       "</td>
                        </tr>
                        <tr>
-                               <td class='mw-label'>" .
-                                       Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) .
-                               "</td>
+                       <td class='mw-label'>" .
+                       Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) .
+                       "</td>
                                <td class='mw-input'>" .
-                               Html::namespaceSelector( array(
-                                               'selected' => $namespace,
-                                       ), array(
-                                               'name' => 'namespace',
-                                               'id' => 'namespace',
-                                               'class' => 'namespaceselector',
-                               ) ) .
-                               Xml::checkLabel(
-                                       $this->msg( 'allpages-hide-redirects' )->text(),
-                                       'hideredirects',
-                                       'hideredirects',
-                                       $hideredirects
-                               ) . ' ' .
-                               Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) .
-                               "</td>
+                       Html::namespaceSelector( array(
+                               'selected' => $namespace,
+                       ), array(
+                               'name' => 'namespace',
+                               'id' => 'namespace',
+                               'class' => 'namespaceselector',
+                       ) ) .
+                       Xml::checkLabel(
+                               $this->msg( 'allpages-hide-redirects' )->text(),
+                               'hideredirects',
+                               'hideredirects',
+                               $hideredirects
+                       ) . ' ' .
+                       Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) .
+                       "</td>
                        </tr>";
                $out .= Xml::closeElement( 'table' );
                $out .= Xml::closeElement( 'fieldset' );
                $out .= Xml::closeElement( 'form' );
                $out .= Xml::closeElement( 'div' );
+
                return $out;
        }
 
@@ -212,9 +213,11 @@ class SpecialPrefixindex extends SpecialAllpages {
                                                $out .= '</tr>';
                                        }
                                }
+
                                if ( $n % 3 != 0 ) {
                                        $out .= '</tr>';
                                }
+
                                $out .= Xml::closeElement( 'table' );
                        } else {
                                $out = '';
@@ -230,11 +233,13 @@ class SpecialPrefixindex extends SpecialAllpages {
                        $out2 = Xml::openElement( 'table', array( 'id' => 'mw-prefixindex-nav-table' ) ) .
                                '<tr>
                                        <td>' .
-                                               $nsForm .
-                                       '</td>
-                                       <td id="mw-prefixindex-nav-form" class="mw-prefixindex-nav">';
+                               $nsForm .
+                               '</td>
+                               <td id="mw-prefixindex-nav-form" class="mw-prefixindex-nav">';
 
-                       if ( isset( $res ) && $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
+                       if ( isset( $res ) && $res && ( $n == $this->maxPerPage ) &&
+                               ( $s = $res->fetchObject() )
+                       ) {
                                $query = array(
                                        'from' => $s->page_title,
                                        'prefix' => $prefix,
@@ -246,16 +251,22 @@ class SpecialPrefixindex extends SpecialAllpages {
                                        // This tells us we're not just a holdover from old links.
                                        $query['namespace'] = $namespace;
                                }
+
                                $nextLink = Linker::linkKnown(
-                                               $self,
-                                               $this->msg( 'nextpage', str_replace( '_', ' ', $s->page_title ) )->escaped(),
-                                               array(),
-                                               $query
-                                       );
+                                       $self,
+                                       $this->msg( 'nextpage', str_replace( '_', ' ', $s->page_title ) )->escaped(),
+                                       array(),
+                                       $query
+                               );
+
                                $out2 .= $nextLink;
 
-                               $footer = "\n" . Html::element( "hr" )
-                                       . Html::rawElement( "div", array( "class" => "mw-prefixindex-nav" ), $nextLink );
+                               $footer = "\n" . Html::element( 'hr' ) .
+                                       Html::rawElement(
+                                               'div',
+                                               array( 'class' => 'mw-prefixindex-nav' ),
+                                               $nextLink
+                                       );
                        }
                        $out2 .= "</td></tr>" .
                                Xml::closeElement( 'table' );
index 4c5d1aa..78931a0 100644 (file)
@@ -49,19 +49,37 @@ class SpecialProtectedpages extends SpecialPage {
                $level = $request->getVal( $this->IdLevel );
                $sizetype = $request->getVal( 'sizetype' );
                $size = $request->getIntOrNull( 'size' );
-               $NS = $request->getIntOrNull( 'namespace' );
+               $ns = $request->getIntOrNull( 'namespace' );
                $indefOnly = $request->getBool( 'indefonly' ) ? 1 : 0;
                $cascadeOnly = $request->getBool( 'cascadeonly' ) ? 1 : 0;
 
-               $pager = new ProtectedPagesPager( $this, array(), $type, $level, $NS, $sizetype, $size, $indefOnly, $cascadeOnly );
+               $pager = new ProtectedPagesPager(
+                       $this,
+                       array(),
+                       $type,
+                       $level,
+                       $ns,
+                       $sizetype,
+                       $size,
+                       $indefOnly,
+                       $cascadeOnly
+               );
 
-               $this->getOutput()->addHTML( $this->showOptions( $NS, $type, $level, $sizetype, $size, $indefOnly, $cascadeOnly ) );
+               $this->getOutput()->addHTML( $this->showOptions(
+                       $ns,
+                       $type,
+                       $level,
+                       $sizetype,
+                       $size,
+                       $indefOnly,
+                       $cascadeOnly
+               ) );
 
                if ( $pager->getNumRows() ) {
                        $this->getOutput()->addHTML(
                                $pager->getNavigationBar() .
-                               '<ul>' . $pager->getBody() . '</ul>' .
-                               $pager->getNavigationBar()
+                                       '<ul>' . $pager->getBody() . '</ul>' .
+                                       $pager->getNavigationBar()
                        );
                } else {
                        $this->getOutput()->addWikiMsg( 'protectedpagesempty' );
@@ -85,9 +103,20 @@ class SpecialProtectedpages extends SpecialPage {
                $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
                if ( !$title ) {
                        wfProfileOut( __METHOD__ );
-                       return Html::rawElement( 'li', array(),
-                               Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
-                                       Linker::getInvalidTitleDescription( $this->getContext(), $row->page_namespace, $row->page_title ) ) ) . "\n";
+
+                       return Html::rawElement(
+                               'li',
+                               array(),
+                               Html::element(
+                                       'span',
+                                       array( 'class' => 'mw-invalidtitle' ),
+                                       Linker::getInvalidTitleDescription(
+                                               $this->getContext(),
+                                               $row->page_namespace,
+                                               $row->page_title
+                                       )
+                               )
+                       ) . "\n";
                }
 
                $link = Linker::link( $title );
@@ -120,7 +149,8 @@ class SpecialProtectedpages extends SpecialPage {
                        $stxt = $lang->getDirMark() . ' ' . Linker::formatRevisionSize( $size );
                }
 
-               # Show a link to the change protection form for allowed users otherwise a link to the protection log
+               # Show a link to the change protection form for allowed users otherwise
+               # a link to the protection log
                if ( $this->getUser()->isAllowed( 'protect' ) ) {
                        $changeProtection = Linker::linkKnown(
                                $title,
@@ -141,14 +171,17 @@ class SpecialProtectedpages extends SpecialPage {
                        );
                }
 
-               $changeProtection = ' ' . $this->msg( 'parentheses' )->rawParams( $changeProtection )->escaped();
+               $changeProtection = ' ' . $this->msg( 'parentheses' )->rawParams( $changeProtection )
+                       ->escaped();
 
                wfProfileOut( __METHOD__ );
 
                return Html::rawElement(
                        'li',
                        array(),
-                       $lang->specialList( $link . $stxt, $lang->commaList( $description_items ), false ) . $changeProtection ) . "\n";
+                       $lang->specialList( $link . $stxt, $lang->commaList( $description_items ), false ) .
+                               $changeProtection
+               ) . "\n";
        }
 
        /**
@@ -161,9 +194,13 @@ class SpecialProtectedpages extends SpecialPage {
         * @param $cascadeOnly Boolean: only cascading protection
         * @return String: input form
         */
-       protected function showOptions( $namespace, $type = 'edit', $level, $sizetype, $size, $indefOnly, $cascadeOnly ) {
+       protected function showOptions( $namespace, $type = 'edit', $level, $sizetype,
+               $size, $indefOnly, $cascadeOnly
+       ) {
                global $wgScript;
+
                $title = $this->getTitle();
+
                return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
                        Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', array(), $this->msg( 'protectedpages' )->text() ) .
@@ -210,7 +247,12 @@ class SpecialProtectedpages extends SpecialPage {
         * @return string Formatted HTML
         */
        protected function getExpiryCheck( $indefOnly ) {
-               return Xml::checkLabel( $this->msg( 'protectedpages-indef' )->text(), 'indefonly', 'indefonly', $indefOnly ) . "\n";
+               return Xml::checkLabel(
+                       $this->msg( 'protectedpages-indef' )->text(),
+                       'indefonly',
+                       'indefonly',
+                       $indefOnly
+               ) . "\n";
        }
 
        /**
@@ -218,7 +260,12 @@ class SpecialProtectedpages extends SpecialPage {
         * @return string Formatted HTML
         */
        protected function getCascadeCheck( $cascadeOnly ) {
-               return Xml::checkLabel( $this->msg( 'protectedpages-cascade' )->text(), 'cascadeonly', 'cascadeonly', $cascadeOnly ) . "\n";
+               return Xml::checkLabel(
+                       $this->msg( 'protectedpages-cascade' )->text(),
+                       'cascadeonly',
+                       'cascadeonly',
+                       $cascadeOnly
+               ) . "\n";
        }
 
        /**
@@ -229,9 +276,21 @@ class SpecialProtectedpages extends SpecialPage {
        protected function getSizeLimit( $sizetype, $size ) {
                $max = $sizetype === 'max';
 
-               return Xml::radioLabel( $this->msg( 'minimum-size' )->text(), 'sizetype', 'min', 'wpmin', !$max ) .
+               return Xml::radioLabel(
+                       $this->msg( 'minimum-size' )->text(),
+                       'sizetype',
+                       'min',
+                       'wpmin',
+                       !$max
+               ) .
                        '&#160;' .
-                       Xml::radioLabel( $this->msg( 'maximum-size' )->text(), 'sizetype', 'max', 'wpmax', $max ) .
+                       Xml::radioLabel(
+                               $this->msg( 'maximum-size' )->text(),
+                               'sizetype',
+                               'max',
+                               'wpmax',
+                               $max
+                       ) .
                        '&#160;' .
                        Xml::input( 'size', 9, $size, array( 'id' => 'wpsize' ) ) .
                        '&#160;' .
@@ -274,7 +333,8 @@ class SpecialProtectedpages extends SpecialPage {
        protected function getLevelMenu( $pr_level ) {
                global $wgRestrictionLevels;
 
-               $m = array( $this->msg( 'restriction-level-all' )->text() => 0 ); // Temporary array
+               // Temporary array
+               $m = array( $this->msg( 'restriction-level-all' )->text() => 0 );
                $options = array();
 
                // First pass to load the log names
@@ -312,9 +372,9 @@ class ProtectedPagesPager extends AlphabeticPager {
        public $mForm, $mConds;
        private $type, $level, $namespace, $sizetype, $size, $indefonly;
 
-       function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype = '', $size = 0,
-               $indefonly = false, $cascadeonly = false )
-       {
+       function __construct( $form, $conds = array(), $type, $level, $namespace,
+               $sizetype = '', $size = 0, $indefonly = false, $cascadeonly = false
+       {
                $this->mForm = $form;
                $this->mConds = $conds;
                $this->type = ( $type ) ? $type : 'edit';
@@ -334,6 +394,7 @@ class ProtectedPagesPager extends AlphabeticPager {
                        $lb->add( $row->page_namespace, $row->page_title );
                }
                $lb->execute();
+
                return '';
        }
 
@@ -344,7 +405,7 @@ class ProtectedPagesPager extends AlphabeticPager {
        function getQueryInfo() {
                $conds = $this->mConds;
                $conds[] = '(pr_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
-                               'OR pr_expiry IS NULL)';
+                       'OR pr_expiry IS NULL)';
                $conds[] = 'page_id=pr_page';
                $conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
 
@@ -355,7 +416,8 @@ class ProtectedPagesPager extends AlphabeticPager {
                }
 
                if ( $this->indefonly ) {
-                       $conds[] = "pr_expiry = {$this->mDb->addQuotes( $this->mDb->getInfinity() )} OR pr_expiry IS NULL";
+                       $infinity = $this->mDb->addQuotes( $this->mDb->getInfinity() );
+                       $conds[] = "pr_expiry = $infinity OR pr_expiry IS NULL";
                }
                if ( $this->cascadeonly ) {
                        $conds[] = 'pr_cascade = 1';
@@ -367,6 +429,7 @@ class ProtectedPagesPager extends AlphabeticPager {
                if ( !is_null( $this->namespace ) ) {
                        $conds[] = 'page_namespace=' . $this->mDb->addQuotes( $this->namespace );
                }
+
                return array(
                        'tables' => array( 'page_restrictions', 'page' ),
                        'fields' => array( 'pr_id', 'page_namespace', 'page_title', 'page_len',
index 7055f2f..21bdf02 100644 (file)
@@ -27,7 +27,6 @@
  * @ingroup SpecialPage
  */
 class SpecialProtectedtitles extends SpecialPage {
-
        protected $IdLevel = 'level';
        protected $IdType = 'type';
 
@@ -58,8 +57,8 @@ class SpecialProtectedtitles extends SpecialPage {
                if ( $pager->getNumRows() ) {
                        $this->getOutput()->addHTML(
                                $pager->getNavigationBar() .
-                               '<ul>' . $pager->getBody() . '</ul>' .
-                               $pager->getNavigationBar()
+                                       '<ul>' . $pager->getBody() . '</ul>' .
+                                       $pager->getNavigationBar()
                        );
                } else {
                        $this->getOutput()->addWikiMsg( 'protectedtitlesempty' );
@@ -84,21 +83,31 @@ class SpecialProtectedtitles extends SpecialPage {
                $title = Title::makeTitleSafe( $row->pt_namespace, $row->pt_title );
                if ( !$title ) {
                        wfProfileOut( __METHOD__ );
-                       return Html::rawElement( 'li', array(),
-                               Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
-                                       Linker::getInvalidTitleDescription( $this->getContext(), $row->pt_namespace, $row->pt_title ) ) ) . "\n";
+
+                       return Html::rawElement(
+                               'li',
+                               array(),
+                               Html::element(
+                                       'span',
+                                       array( 'class' => 'mw-invalidtitle' ),
+                                       Linker::getInvalidTitleDescription(
+                                               $this->getContext(),
+                                               $row->pt_namespace,
+                                               $row->pt_title
+                                       )
+                               )
+                       ) . "\n";
                }
 
                $link = Linker::link( $title );
-
                $description_items = array();
-
                $protType = $this->msg( 'restriction-level-' . $row->pt_create_perm )->escaped();
-
                $description_items[] = $protType;
-
                $lang = $this->getLanguage();
-               $expiry = strlen( $row->pt_expiry ) ? $lang->formatExpiry( $row->pt_expiry, TS_MW ) : $infinity;
+               $expiry = strlen( $row->pt_expiry ) ?
+                       $lang->formatExpiry( $row->pt_expiry, TS_MW ) :
+                       $infinity;
+
                if ( $expiry != $infinity ) {
                        $user = $this->getUser();
                        $description_items[] = $this->msg(
@@ -111,6 +120,7 @@ class SpecialProtectedtitles extends SpecialPage {
 
                wfProfileOut( __METHOD__ );
 
+               // @todo i18n: This should use a comma separator instead of a hard coded comma, right?
                return '<li>' . $lang->specialList( $link, implode( $description_items, ', ' ) ) . "</li>\n";
        }
 
@@ -126,6 +136,7 @@ class SpecialProtectedtitles extends SpecialPage {
                $action = htmlspecialchars( $wgScript );
                $title = $this->getTitle();
                $special = htmlspecialchars( $title->getPrefixedDBkey() );
+
                return "<form action=\"$action\" method=\"get\">\n" .
                        '<fieldset>' .
                        Xml::element( 'legend', array(), $this->msg( 'protectedtitles' )->text() ) .
@@ -165,7 +176,8 @@ class SpecialProtectedtitles extends SpecialPage {
        function getLevelMenu( $pr_level ) {
                global $wgRestrictionLevels;
 
-               $m = array( $this->msg( 'restriction-level-all' )->text() => 0 ); // Temporary array
+               // Temporary array
+               $m = array( $this->msg( 'restriction-level-all' )->text() => 0 );
                $options = array();
 
                // First pass to load the log names
@@ -175,6 +187,7 @@ class SpecialProtectedtitles extends SpecialPage {
                                $m[$text] = $type;
                        }
                }
+
                // Is there only one level (aside from "all")?
                if ( count( $m ) <= 2 ) {
                        return '';
@@ -203,7 +216,9 @@ class SpecialProtectedtitles extends SpecialPage {
 class ProtectedTitlesPager extends AlphabeticPager {
        public $mForm, $mConds;
 
-       function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype = '', $size = 0 ) {
+       function __construct( $form, $conds = array(), $type, $level, $namespace,
+               $sizetype = '', $size = 0
+       ) {
                $this->mForm = $form;
                $this->mConds = $conds;
                $this->level = $level;
@@ -224,6 +239,7 @@ class ProtectedTitlesPager extends AlphabeticPager {
 
                $lb->execute();
                wfProfileOut( __METHOD__ );
+
                return '';
        }
 
@@ -247,9 +263,11 @@ class ProtectedTitlesPager extends AlphabeticPager {
                if ( $this->level ) {
                        $conds['pt_create_perm'] = $this->level;
                }
+
                if ( !is_null( $this->namespace ) ) {
                        $conds[] = 'pt_namespace=' . $this->mDb->addQuotes( $this->namespace );
                }
+
                return array(
                        'tables' => 'protected_titles',
                        'fields' => array( 'pt_namespace', 'pt_title', 'pt_create_perm',
index dc4c1cd..e4f31f4 100644 (file)
@@ -66,6 +66,7 @@ class RandomPage extends SpecialPage {
                        $this->setHeaders();
                        $this->getOutput()->addWikiMsg( strtolower( $this->getName() ) . '-nopages',
                                $this->getNsList(), count( $this->namespaces ) );
+
                        return;
                }
 
@@ -90,6 +91,7 @@ class RandomPage extends SpecialPage {
                                $nsNames[] = $wgContLang->getNsText( $n );
                        }
                }
+
                return $wgContLang->commaList( $nsNames );
        }
 
@@ -100,10 +102,14 @@ class RandomPage extends SpecialPage {
        public function getRandomTitle() {
                $randstr = wfRandom();
                $title = null;
-               if ( !wfRunHooks( 'SpecialRandomGetRandomTitle', array( &$randstr, &$this->isRedir, &$this->namespaces,
-                       &$this->extra, &$title ) ) ) {
+
+               if ( !wfRunHooks(
+                       'SpecialRandomGetRandomTitle',
+                       array( &$randstr, &$this->isRedir, &$this->namespaces, &$this->extra, &$title )
+               ) ) {
                        return $title;
                }
+
                $row = $this->selectRandomPageFromDB( $randstr );
 
                /* If we picked a value that was higher than any in
@@ -119,9 +125,9 @@ class RandomPage extends SpecialPage {
 
                if ( $row ) {
                        return Title::makeTitleSafe( $row->page_namespace, $row->page_title );
-               } else {
-                       return null;
                }
+
+               return null;
        }
 
        protected function getQueryInfo( $randstr ) {
index 51783a2..7c36a28 100644 (file)
@@ -32,5 +32,4 @@ class SpecialRandomredirect extends RandomPage {
                parent::__construct( 'Randomredirect' );
                $this->isRedir = true;
        }
-
 }
index ad6346d..0d6378c 100644 (file)
@@ -60,6 +60,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $opts->add( 'categories', '' );
                $opts->add( 'categories_any', false );
                $opts->add( 'tagfilter', '' );
+
                return $opts;
        }
 
@@ -85,6 +86,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                }
 
                $opts->validateIntBounds( 'limit', 0, 5000 );
+
                return $opts;
        }
 
@@ -98,6 +100,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        $this->customFilters = array();
                        wfRunHooks( 'SpecialRecentChangesFilters', array( $this, &$this->customFilters ) );
                }
+
                return $this->customFilters;
        }
 
@@ -111,6 +114,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $opts = $this->getDefaultOptions();
                $opts->fetchValuesFromRequest( $this->getRequest() );
                $opts->validateIntBounds( 'limit', 0, $wgFeedLimit );
+
                return $opts;
        }
 
@@ -126,6 +130,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        }
                        $this->rcOptions = $isFeed ? $this->feedSetup() : $this->setup( $this->rcSubpage );
                }
+
                return $this->rcOptions;
        }
 
@@ -158,6 +163,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        if ( !$this->including() ) {
                                $this->doHeader( $opts );
                        }
+
                        return;
                }
 
@@ -194,6 +200,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        $this->msg( 'recentchanges-feed-description' )->inContentLanguage()->text(),
                        $this->getTitle()->getFullURL()
                );
+
                return array( $changesFeed, $formatter );
        }
 
@@ -266,6 +273,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                                return false;
                        }
                }
+
                return $lastmod;
        }
 
@@ -340,7 +348,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                # Namespace filtering
                if ( $opts['namespace'] !== '' ) {
                        $selectedNS = $dbr->addQuotes( $opts['namespace'] );
-                       $operator = $opts['invert'] ? '!='  : '=';
+                       $operator = $opts['invert'] ? '!=' : '=';
                        $boolean = $opts['invert'] ? 'AND' : 'OR';
 
                        # namespace association (bug 2429)
@@ -358,6 +366,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
 
                        $conds[] = $condition;
                }
+
                return $conds;
        }
 
@@ -392,7 +401,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                                'wl_user' => $uid,
                                'wl_title=rc_title',
                                'wl_namespace=rc_namespace'
-                       ));
+                       ) );
                }
                if ( $this->getUser()->isAllowed( 'rollback' ) ) {
                        $tables[] = 'page';
@@ -410,8 +419,8 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                );
 
                if ( !wfRunHooks( 'SpecialRecentChangesQuery',
-                       array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ) ) )
-               {
+                       array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ) )
+               {
                        return false;
                }
 
@@ -423,14 +432,15 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                if ( $namespace === ''
                        || ( $invert || $associated )
                        || $opts['tagfilter'] != ''
-                       || !$dbr->unionSupportsOrderAndLimit() )
-               {
+                       || !$dbr->unionSupportsOrderAndLimit()
+               {
                        $res = $dbr->select( $tables, $fields, $conds, __METHOD__,
                                array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ) +
-                               $query_options,
+                                       $query_options,
                                $join_conds );
-               // We have a new_namespace_time index! UNION over new=(0,1) and sort result set!
                } else {
+                       // We have a new_namespace_time index! UNION over new=(0,1) and sort result set!
+
                        // New pages
                        $sqlNew = $dbr->selectSQLText(
                                $tables,
@@ -444,6 +454,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                                ),
                                $join_conds
                        );
+
                        // Old pages
                        $sqlOld = $dbr->selectSQLText(
                                $tables,
@@ -457,6 +468,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                                ),
                                $join_conds
                        );
+
                        # Join the two fast queries, and sort the result set
                        $sql = $dbr->unionQueries( array( $sqlNew, $sqlOld ), false ) .
                                ' ORDER BY rc_timestamp DESC';
@@ -495,7 +507,8 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        $this->filterByCategories( $rows, $opts );
                }
 
-               $showWatcherCount = $wgRCShowWatchingUsers && $this->getUser()->getOption( 'shownumberswatching' );
+               $showNumsWachting = $this->getUser()->getOption( 'shownumberswatching' );
+               $showWatcherCount = $wgRCShowWatchingUsers && $showNumsWachting;
                $watcherCache = array();
 
                $dbr = wfGetDB( DB_SLAVE );
@@ -601,10 +614,22 @@ class SpecialRecentChanges extends IncludableSpecialPage {
 
                        $out .= Xml::openElement( 'tr' );
                        if ( is_array( $optionRow ) ) {
-                               $out .= Xml::tags( 'td', array( 'class' => 'mw-label mw-' . $name . '-label' ), $optionRow[0] );
-                               $out .= Xml::tags( 'td', array( 'class' => 'mw-input' ), $optionRow[1] . $addSubmit );
+                               $out .= Xml::tags(
+                                       'td',
+                                       array( 'class' => 'mw-label mw-' . $name . '-label' ),
+                                       $optionRow[0]
+                               );
+                               $out .= Xml::tags(
+                                       'td',
+                                       array( 'class' => 'mw-input' ),
+                                       $optionRow[1] . $addSubmit
+                               );
                        } else {
-                               $out .= Xml::tags( 'td', array( 'class' => 'mw-input', 'colspan' => 2 ), $optionRow . $addSubmit );
+                               $out .= Xml::tags(
+                                       'td',
+                                       array( 'class' => 'mw-input', 'colspan' => 2 ),
+                                       $optionRow . $addSubmit
+                               );
                        }
                        $out .= Xml::closeElement( 'tr' );
                }
@@ -622,7 +647,11 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $panelString = implode( "\n", $panel );
 
                $this->getOutput()->addHTML(
-                       Xml::fieldset( $this->msg( 'recentchanges-legend' )->text(), $panelString, array( 'class' => 'rcoptions' ) )
+                       Xml::fieldset(
+                               $this->msg( 'recentchanges-legend' )->text(),
+                               $panelString,
+                               array( 'class' => 'rcoptions' )
+                       )
                );
 
                $this->setBottomText( $opts );
@@ -649,6 +678,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                }
 
                wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
+
                return $extraOpts;
        }
 
@@ -679,7 +709,8 @@ class SpecialRecentChanges extends IncludableSpecialPage {
         *
         * @param FormOptions $opts
         */
-       function setBottomText( FormOptions $opts ) {}
+       function setBottomText( FormOptions $opts ) {
+       }
 
        /**
         * Creates the choose namespace selection
@@ -704,6 +735,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        $opts['associated'],
                        array( 'title' => $this->msg( 'tooltip-namespace_association' )->text() )
                );
+
                return array( $nsLabel, "$nsSelect $invert $associated" );
        }
 
@@ -812,6 +844,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                if ( $active ) {
                        $text = '<strong>' . $text . '</strong>';
                }
+
                return Linker::linkKnown( $this->getTitle(), $text, array(), $params );
        }
 
@@ -898,13 +931,15 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        $now, array( 'from' => $timestamp ), $nondefaults
                );
 
-               $rclinks = $this->msg( 'rclinks' )->rawParams( $cl, $dl, $lang->pipeList( $links ) )->parse();
+               $rclinks = $this->msg( 'rclinks' )->rawParams( $cl, $dl, $lang->pipeList( $links ) )
+                       ->parse();
                $rclistfrom = $this->msg( 'rclistfrom' )->rawParams( $tl )->parse();
+
                return "{$note}$rclinks<br />$rclistfrom";
        }
 
        /**
-        * add javascript specific to the [[Special:RecentChanges]] page
+        * Add JavaScript to the page
         */
        function addRecentChangesJS() {
                $this->getOutput()->addModules( array(