Merge "SpecialPage: Adjust type hint: Array → array"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 26 Jun 2014 19:15:04 +0000 (19:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 26 Jun 2014 19:15:04 +0000 (19:15 +0000)
12 files changed:
RELEASE-NOTES-1.24
includes/Setup.php
includes/db/DatabaseMysqlBase.php
includes/db/LoadBalancer.php
includes/gallery/ImageGalleryBase.php
includes/htmlform/HTMLFormField.php
includes/specials/SpecialVersion.php
includes/templates/Usercreate.php
includes/templates/Userlogin.php
languages/i18n/en.json
languages/i18n/qqq.json
resources/src/mediawiki.ui/components/default/forms.less

index 8974e68..f510d90 100644 (file)
@@ -183,6 +183,9 @@ changes to languages because of Bugzilla reports.
 * The "jquery.json" module has been deprecated. Use the "json" module instead.
 * Removed HTMLForm::addJS(). (deprecated since 1.18)
 * Removed LogEventsList::showHeader(). (deprecated since 1.19)
+* Removed ImageGalleryBase::useSkin(). (deprecated since 1.18)
+* Removed DatabaseMysqlBase::getLagFromProcesslist(). (deprecated since 1.19)
+* Removed LoadBalancer::closeConnecton(). (deprecated since 1.18)
 
 ==== Renamed classes ====
 * CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression
index ccb3a15..6003305 100644 (file)
@@ -602,9 +602,8 @@ $wgTitle = null;
 $wgDeferredUpdateList = array();
 
 // Enable default skins.
-// This is hacky and bad, but it will go away before 1.24 release (or so I hope).
-// These lines should eventually be placed in skins' meta definition files, and loaded by a
-// require_once for each skin file generated by the installer and placed in LocalSettings.php.
+// This is hacky and bad, the require_once calls should eventually be generated by the installer
+// and placed in LocalSettings.php.
 require_once "$wgStyleDirectory/MonoBook/MonoBook.php";
 require_once "$wgStyleDirectory/Vector/Vector.php";
 
index 837d094..cf37736 100644 (file)
@@ -637,47 +637,6 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
                }
        }
 
-       /**
-        * @deprecated since 1.19, use getLagFromSlaveStatus
-        *
-        * @return bool|int
-        */
-       function getLagFromProcesslist() {
-               wfDeprecated( __METHOD__, '1.19' );
-               $res = $this->query( 'SHOW PROCESSLIST', __METHOD__ );
-               if ( !$res ) {
-                       return false;
-               }
-               # Find slave SQL thread
-               foreach ( $res as $row ) {
-                       /* This should work for most situations - when default db
-                        * for thread is not specified, it had no events executed,
-                        * and therefore it doesn't know yet how lagged it is.
-                        *
-                        * Relay log I/O thread does not select databases.
-                        */
-                       if ( $row->User == 'system user' &&
-                               $row->State != 'Waiting for master to send event' &&
-                               $row->State != 'Connecting to master' &&
-                               $row->State != 'Queueing master event to the relay log' &&
-                               $row->State != 'Waiting for master update' &&
-                               $row->State != 'Requesting binlog dump' &&
-                               $row->State != 'Waiting to reconnect after a failed master event read' &&
-                               $row->State != 'Reconnecting after a failed master event read' &&
-                               $row->State != 'Registering slave on master'
-                       ) {
-                               # This is it, return the time (except -ve)
-                               if ( $row->Time > 0x7fffffff ) {
-                                       return false;
-                               } else {
-                                       return $row->Time;
-                               }
-                       }
-               }
-
-               return false;
-       }
-
        /**
         * Wait for the slave to catch up to a given master position.
         * @todo Return values for this and base class are rubbish
index 306c2d3..b3f9210 100644 (file)
@@ -868,17 +868,6 @@ class LoadBalancer {
                );
        }
 
-       /**
-        * Deprecated function, typo in function name
-        *
-        * @deprecated since 1.18
-        * @param DatabaseBase $conn
-        */
-       function closeConnecton( $conn ) {
-               wfDeprecated( __METHOD__, '1.18' );
-               $this->closeConnection( $conn );
-       }
-
        /**
         * Close a connection
         * Using this function makes sure the LoadBalancer knows the connection is closed.
index 39da597..8d2b949 100644 (file)
@@ -221,17 +221,6 @@ abstract class ImageGalleryBase extends ContextSource {
        public function setAdditionalOptions( $options ) {
        }
 
-       /**
-        * Instruct the class to use a specific skin for rendering
-        *
-        * @param Skin $skin
-        * @deprecated since 1.18 Not used anymore
-        */
-       function useSkin( $skin ) {
-               wfDeprecated( __METHOD__, '1.18' );
-               /* no op */
-       }
-
        /**
         * Add an image to the gallery.
         *
index 0e1860b..8076e8a 100644 (file)
@@ -504,7 +504,7 @@ abstract class HTMLFormField {
                );
                $divCssClasses = array( "mw-htmlform-field-$fieldType", $this->mClass, $errorClass );
                if ( $this->mParent->isVForm() ) {
-                       $divCssClasses[] = 'mw-ui-vform-div';
+                       $divCssClasses[] = 'mw-ui-vform-field';
                }
 
                $wrapperAttributes = array(
index 543c8fe..026cb34 100644 (file)
@@ -129,6 +129,7 @@ class SpecialVersion extends SpecialPage {
                                        $this->getEntryPointInfo()
                                );
                                $out->addHtml(
+                                       $this->getSkinCredits() .
                                        $this->getExtensionCredits() .
                                        $this->getParserTags() .
                                        $this->getParserFunctionHooks()
@@ -450,9 +451,11 @@ class SpecialVersion extends SpecialPage {
                        }
                }
 
+               $this->firstExtOpened = false;
                // Loop through the extension categories to display their extensions in the list.
                foreach ( $extensionTypes as $type => $message ) {
-                       if ( $type != 'other' ) {
+                       // Skins have a separate section
+                       if ( $type !== 'other' && $type !== 'skin' ) {
                                $out .= $this->getExtensionCategory( $type, $message );
                        }
                }
@@ -465,6 +468,27 @@ class SpecialVersion extends SpecialPage {
                return $out;
        }
 
+       /**
+        * Generate wikitext showing skins name, URL, author and description.
+        *
+        * @return string Wikitext
+        */
+       function getSkinCredits() {
+               $out = Xml::element(
+                               'h2',
+                               array( 'id' => 'mw-version-skin' ),
+                               $this->msg( 'version-skins' )->text()
+                       ) .
+                       Xml::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'sv-skin' ) );
+
+               $this->firstExtOpened = false;
+               $out .= $this->getExtensionCategory( 'skin', null );
+
+               $out .= Xml::closeElement( 'table' );
+
+               return $out;
+       }
+
        /**
         * Obtains a list of installed parser tags and the associated H2 header
         *
@@ -795,7 +819,7 @@ class SpecialVersion extends SpecialPage {
                }
        }
 
-       private function openExtType( $text, $name = null ) {
+       private function openExtType( $text = null, $name = null ) {
                $out = '';
 
                $opt = array( 'colspan' => 5 );
@@ -811,13 +835,18 @@ class SpecialVersion extends SpecialPage {
                        $opt['id'] = "sv-$name";
                }
 
-               $out .= Html::rawElement( 'tr', array(),
-                       Html::element( 'th', $opt, $text )
-               );
+               if ( $text !== null ) {
+                       $out .= Html::rawElement( 'tr', array(),
+                               Html::element( 'th', $opt, $text )
+                       );
+               }
 
+               $firstHeadingMsg = ( $name === 'credits-skin' )
+                       ? 'version-skin-colheader-name'
+                       : 'version-ext-colheader-name';
                $out .= Html::openElement( 'tr' );
                $out .= Html::element( 'th', array( 'class' => 'mw-version-ext-col-label' ),
-                       $this->msg( 'version-ext-colheader-name' )->text() );
+                       $this->msg( $firstHeadingMsg )->text() );
                $out .= Html::element( 'th', array( 'class' => 'mw-version-ext-col-label' ),
                        $this->msg( 'version-ext-colheader-version' )->text() );
                $out .= Html::element( 'th', array( 'class' => 'mw-version-ext-col-label' ),
index 9118701..a4240e2 100644 (file)
@@ -73,7 +73,7 @@ class UsercreateTemplate extends BaseTemplate {
                        <?php } ?>
                        </div>
 
-                       <div>
+                       <div class="mw-ui-vform-field">
                                <label for='wpName2'>
                                        <?php $this->msg( 'userlogin-yourname' ); ?>
 
@@ -92,7 +92,7 @@ class UsercreateTemplate extends BaseTemplate {
                                ?>
                        </div>
 
-                       <div>
+                       <div class="mw-ui-vform-field">
                                <?php if ( $this->data['createemail'] ) { ?>
                                        <label class="mw-ui-checkbox-label">
                                                <input name="wpCreateaccountMail" type="checkbox" value="1" id="wpCreateaccountMail" tabindex="2"
@@ -105,7 +105,7 @@ class UsercreateTemplate extends BaseTemplate {
                                <?php } ?>
                        </div>
 
-                       <div class="mw-row-password">
+                       <div class="mw-ui-vform-field mw-row-password">
                                <label for='wpPassword2'><?php $this->msg( 'userlogin-yourpassword' ); ?></label>
                                <?php
                                echo Html::input( 'wpPassword', null, 'password', array(
@@ -127,7 +127,7 @@ class UsercreateTemplate extends BaseTemplate {
                                        $select->addOption( $dom );
                                }
                        ?>
-                               <div id="mw-user-domain-section">
+                               <div class="mw-ui-vform-field" id="mw-user-domain-section">
                                        <label for="wpDomain"><?php $this->msg( 'yourdomainname' ); ?></label>
                                        <div class="mw-input">
                                                <?php echo $select->getHTML(); ?>
@@ -135,7 +135,7 @@ class UsercreateTemplate extends BaseTemplate {
                                </div>
                        <?php } ?>
 
-                       <div class="mw-row-password">
+                       <div class="mw-ui-vform-field mw-row-password">
                                <label for='wpRetype'><?php $this->msg( 'createacct-yourpasswordagain' ); ?></label>
                                <?php
                                echo Html::input( 'wpRetype', null, 'password', array(
@@ -149,7 +149,7 @@ class UsercreateTemplate extends BaseTemplate {
                                ?>
                        </div>
 
-                       <div>
+                       <div class="mw-ui-vform-field">
                                <?php if ( $this->data['useemail'] ) { ?>
                                        <label for='wpEmail'>
                                                <?php
@@ -174,7 +174,7 @@ class UsercreateTemplate extends BaseTemplate {
                        </div>
 
                        <?php if ( $this->data['userealname'] ) { ?>
-                               <div>
+                               <div class="mw-ui-vform-field">
                                        <label for='wpRealName'><?php $this->msg( 'createacct-realname' ); ?></label>
                                        <input type='text' class='mw-input loginText' name="wpRealName" id="wpRealName"
                                                tabindex="7"
@@ -186,7 +186,7 @@ class UsercreateTemplate extends BaseTemplate {
                        <?php } ?>
 
                        <?php if ( $this->data['usereason'] ) { ?>
-                               <div>
+                               <div class="mw-ui-vform-field">
                                        <label for='wpReason'><?php $this->msg( 'createacct-reason' ); ?></label>
                                        <?php echo Html::input( 'wpReason', $this->data['reason'], 'text', array(
                                                'class' => 'mw-input loginText',
@@ -202,7 +202,7 @@ class UsercreateTemplate extends BaseTemplate {
                        $tabIndex = 9;
                        if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
                                foreach ( $this->data['extraInput'] as $inputItem ) { ?>
-                                       <div>
+                                       <div class="mw-ui-vform-field">
                                                <?php
                                                // If it's a checkbox, output the whole thing (assume it has a msg).
                                                if ( $inputItem['type'] == 'checkbox' ) {
@@ -252,7 +252,7 @@ class UsercreateTemplate extends BaseTemplate {
                        // so skip one index.
                        $tabIndex++;
                        ?>
-                       <div class="mw-submit">
+                       <div class="mw-ui-vform-field mw-submit">
                                <?php
                                echo Html::input(
                                        'wpCreateaccount',
index 0aad07d..19ea20b 100644 (file)
@@ -55,7 +55,7 @@ class UserloginTemplate extends BaseTemplate {
                                </div>
                        <?php } ?>
 
-                       <div>
+                       <div class="mw-ui-vform-field">
                                <label for='wpName1'>
                                        <?php
                                        $this->msg( 'userlogin-yourname' );
@@ -85,7 +85,7 @@ class UserloginTemplate extends BaseTemplate {
                                ?>
                        </div>
 
-                       <div>
+                       <div class="mw-ui-vform-field">
                                <label for='wpPassword1'>
                                        <?php
                                        $this->msg( 'userlogin-yourpassword' );
@@ -120,7 +120,7 @@ class UserloginTemplate extends BaseTemplate {
                                        $select->addOption( $dom );
                                }
                        ?>
-                               <div id="mw-user-domain-section">
+                               <div class="mw-ui-vform-field" id="mw-user-domain-section">
                                        <label for='wpDomain'><?php $this->msg( 'yourdomainname' ); ?></label>
                                        <?php echo $select->getHTML(); ?>
                                </div>
@@ -132,7 +132,7 @@ class UserloginTemplate extends BaseTemplate {
                        }
                        ?>
 
-                       <div>
+                       <div class="mw-ui-vform-field">
                                <?php if ( $this->data['canremember'] ) { ?>
                                        <label class="mw-ui-checkbox-label">
                                                <input name="wpRemember" type="checkbox" value="1" id="wpRemember" tabindex="4"
@@ -145,7 +145,7 @@ class UserloginTemplate extends BaseTemplate {
                                <?php } ?>
                        </div>
 
-                       <div>
+                       <div class="mw-ui-vform-field">
                                <?php
                                echo Html::input( 'wpLoginAttempt', $this->getMsg( 'pt-login-button' )->text(), 'submit', array(
                                        'id' => 'wpLoginAttempt',
@@ -154,7 +154,8 @@ class UserloginTemplate extends BaseTemplate {
                                ) );
                                ?>
                        </div>
-                       <div id="mw-userlogin-help">
+
+                       <div class="mw-ui-vform-field" id="mw-userlogin-help">
                                <?php
                                echo Html::element(
                                        'a',
@@ -167,6 +168,7 @@ class UserloginTemplate extends BaseTemplate {
                                );
                                ?>
                        </div>
+
                        <?php if ( $this->haveData( 'createOrLoginHref' ) ) { ?>
                                <?php if ( $this->data['loggedin'] ) { ?>
                                        <div id="mw-createaccount-another">
index 33030c5..2633155 100644 (file)
        "version": "Version",
        "version-summary": "",
        "version-extensions": "Installed extensions",
+       "version-skins": "Installed skins",
        "version-specialpages": "Special pages",
        "version-parserhooks": "Parser hooks",
        "version-variables": "Variables",
        "version-antispam": "Spam prevention",
-       "version-skins": "Skins",
        "version-api": "API",
        "version-other": "Other",
        "version-mediahandlers": "Media handlers",
        "version-license": "MediaWiki License",
        "version-ext-license": "License",
        "version-ext-colheader-name": "Extension",
+       "version-skin-colheader-name": "Skin",
        "version-ext-colheader-version": "Version",
        "version-ext-colheader-license": "License",
        "version-ext-colheader-description": "Description",
index ef5d567..ee3b6a9 100644 (file)
        "version": "{{doc-special|Version}}\n{{Identical|Version}}",
        "version-summary": "{{doc-specialpagesummary|version}}",
        "version-extensions": "Header on [[Special:Version]].",
+       "version-skins": "Header on [[Special:Version]].",
        "version-specialpages": "Part of [[Special:Version]].\n{{Identical|Special page}}",
        "version-parserhooks": "This message is a heading at [[Special:Version]] for extensions that modifies the parser of wikitext.",
        "version-variables": "{{Identical|Variable}}",
        "version-antispam": "Part of [[Special:Version]].\nThis message is followed by the list of SPAM prevention extensions.",
-       "version-skins": "{{Identical|Skin}}",
        "version-api": "{{optional}}",
        "version-other": "{{Identical|Other}}",
        "version-mediahandlers": "Used in [[Special:Version]]. It is the title of a section for media handler extensions (e.g. [[mw:Extension:OggHandler]]).\nThere are no such extensions here, so look at [[wikipedia:Special:Version]] for an example.",
        "version-license": "Used specifically for the MediaWiki software.\n\nUsed as heading in [[Special:Version]].",
        "version-ext-license": "Used in [[Special:Version]].\n\nUsed as label for the link pointing to the extension's license page. e.g. [[Special:Version/License/Maps]]\n{{Identical|License}}",
        "version-ext-colheader-name": "Column header for the name of an extension.\n{{Identical|Extension}}",
+       "version-skin-colheader-name": "Column header for the name of a skin.\n{{Identical|Skin}}",
        "version-ext-colheader-version": "Column header for describing an extensions version.\n{{Identical|Version}}",
        "version-ext-colheader-license": "Column header for describing an extensions license.\n{{Identical|License}}",
        "version-ext-colheader-description": "Column header for the description of an extension.\n{{Identical|Description}}",
index ee21932..6c40c26 100644 (file)
 //
 // Markup:
 // <form class="mw-ui-vform">
-//   <div class="mw-ui-vform-div">This is a form example.</div>
-//   <div class="mw-ui-vform-div">
+//   <div class="mw-ui-vform-field">This is a form example.</div>
+//   <div class="mw-ui-vform-field">
 //     <label>Username </label>
 //     <input value="input">
 //   </div>
-//   <div>
+//   <div class="mw-ui-vform-field">
 //     <button class="mw-ui-button mw-ui-constructive">Button in vform</button>
 //   </div>
 // </form>
 
        width: @defaultFormWidth;
 
-       // Immediate divs in a vform are block and spaced-out.
-       // XXX: We shouldn't depend on the tag name here...
-       & > div {
-               display: block;
-               margin: 0 0 15px 0;
-               padding: 0;
-               width: 100%;
-       }
-
        // MW currently doesn't use the type attribute everywhere on inputs.
        input,
        select,
        //   <div class="error">
        //     <ul><li>There are problems with some of your input.</li></ul>
        //   </div>
-       //   <div class="mw-ui-vform-div">
+       //   <div class="mw-ui-vform-field">
        //     <input type="text" value="input" class="mw-ui-input">
        //   </div>
-       //   <div class="mw-ui-vform-div">
+       //   <div class="mw-ui-vform-field">
        //     <select>
        //       <option value="1">Option 1</option>
        //       <option value="2">Option 2</option>
        //     </select>
        //     <span class="error">The value you specified is not a valid option.</span>
        //   </div>
-       //   <div>
+       //   <div class="mw-ui-vform-field">
        //     <button class="mw-ui-button">Button in vform</button>
        //   </div>
        // </form>
        // This specifies styling for individual field validation error messages.
        // Show them below the fields to prevent line break glitches, and leave
        // some space between the field and the error message box.
-       .mw-ui-vform-div .error {
+       .mw-ui-vform-div .error, /* for backwards-compatibility, remove before 1.24 */
+       .mw-ui-vform-field .error {
                display: block;
                margin-top: 5px;
        }
 // Elements
 // --------------------------------------------------------------------------
 
-// Apply this to individual elements to style them.
-// You generally don't need to use this class on divs within an Agora
-// form container such as mw-ui-vform
-// XXX DRY: This repeats earlier styling, use an @include agora-div-styling ?
-// XXX: What is this even for?
-.mw-ui-vform-div {
+// A wrapper for a single form field: the <input> / <select> / <button> element,
+// help text, labels, associated error/warning/success messages, and so on.
+// Elements with this class are generated by HTMLFormField in core MediaWiki.
+//
+// (We use a broad definition of 'field' here: a purely textual information
+// block is also a "field".)
+.mw-ui-vform-div, /* for backwards-compatibility, remove before 1.24 */
+.mw-ui-vform-field {
        display: block;
        margin: 0 0 15px;
        padding: 0;