From: Bartosz DziewoƄski Date: Sun, 1 Jun 2014 00:02:18 +0000 (+0200) Subject: SpecialVersion: Show 'Skins' and 'Extensions' in separate sections X-Git-Tag: 1.31.0-rc.0~15223^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=d423112b7f51d53b43e453a2d5e89c70f6fd1637;p=lhc%2Fweb%2Fwiklou.git SpecialVersion: Show 'Skins' and 'Extensions' in separate sections Change-Id: Ifa4aa1a2ad31228b4bff833f34727e80e19b9ae3 --- diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 543c8fee3f..026cb3432f 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -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' ), diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 33030c544b..2633155319 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -3216,11 +3216,11 @@ "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", @@ -3235,6 +3235,7 @@ "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", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index ef5d567b8a..ee3b6a9cd8 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -3378,11 +3378,11 @@ "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.", @@ -3397,6 +3397,7 @@ "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}}",