SpecialVersion: Show 'Skins' and 'Extensions' in separate sections
authorBartosz Dziewoński <matma.rex@gmail.com>
Sun, 1 Jun 2014 00:02:18 +0000 (02:02 +0200)
committerJdlrobson <jrobson@wikimedia.org>
Thu, 26 Jun 2014 17:35:23 +0000 (17:35 +0000)
Change-Id: Ifa4aa1a2ad31228b4bff833f34727e80e19b9ae3

includes/specials/SpecialVersion.php
languages/i18n/en.json
languages/i18n/qqq.json

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 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}}",