SamanthaNguyen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354885 )
Change subject: [WIP] Generalize SoftwareVersion so it's easier to use by third-parties ...................................................................... [WIP] Generalize SoftwareVersion so it's easier to use by third-parties Change-Id: Ief2c8ea7bb7ca8987c9267c274ffd0295ab5266f --- R SoftwareVersion.class.php M extension.json M i18n/en.json M i18n/qqq.json 4 files changed, 33 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SoftwareVersion refs/changes/85/354885/1 diff --git a/ShoutWikiSoftwareVersion.class.php b/SoftwareVersion.class.php similarity index 81% rename from ShoutWikiSoftwareVersion.class.php rename to SoftwareVersion.class.php index 60a6c90..b16dbee 100644 --- a/ShoutWikiSoftwareVersion.class.php +++ b/SoftwareVersion.class.php @@ -10,7 +10,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ -class ShoutWikiSoftwareVersion { +class SoftwareVersion { /** * Adds ShoutWiki component into Special:Version and sets MW's version to $wgVersion @@ -18,8 +18,8 @@ * @param array $software Array of software information * @return bool */ - public static function addShoutWikiInfo( &$software ) { - global $wgVersion, $IP; + public static function addSVNInfo( &$software ) { + global $wgVersion, $wgCanonicalServer, $wgSitename, $IP; // Set MW version to $wgVersion $software['[https://www.mediawiki.org/ MediaWiki]'] = $wgVersion; @@ -48,8 +48,14 @@ $json = json_encode( $svnInfo ); $exploded = explode( $newline, $svnInfo ); - // Add ShoutWiki component (revision number and last changed date) - $software['[http://www.shoutwiki.com/ ShoutWiki]'] = + if ( $this->getMsg( 'softwareversion-wiki-link' )->isDisabled() ) { + $wikiLink = "[" . $wgCanonicalServer . " " . $wgSitename . "]"; + } else { + $wikiLink = wfMessage('softwareversion-wiki-link')->text(); + } + + // Add component (revision number and last changed date) + $software[$wikiLink] = str_replace( 'Revision: ', 'r', $exploded[6] ) /* Revision */ . ' (' . str_replace( 'Last Changed Date: ', '', preg_replace( '/ \(.*\)/', '', $exploded[11] ) ) ./* Last Changed Date */ @@ -58,4 +64,4 @@ return true; } -} \ No newline at end of file +} diff --git a/extension.json b/extension.json index 79bda3d..f1a81b2 100644 --- a/extension.json +++ b/extension.json @@ -1,15 +1,16 @@ { "name": "SoftwareVersion", - "version": "0.6.1", + "version": "0.6.2", "author": [ - "Jack Phoenix" + "Jack Phoenix", + "Samantha Nguyen" ], "license-name": "GPL-2.0+", "url": "https://www.mediawiki.org/wiki/Extension:SoftwareVersion", "descriptionmsg": "softwareversion-desc", "type": "other", "AutoloadClasses": { - "ShoutWikiSoftwareVersion": "ShoutWikiSoftwareVersion.class.php" + "SoftwareVersion": "SoftwareVersion.class.php" }, "MessagesDirs": { "SoftwareVersion": [ @@ -18,7 +19,7 @@ }, "Hooks": { "SoftwareInfo": [ - "ShoutWikiSoftwareVersion::addShoutWikiInfo" + "SoftwareVersion::addSVNInfo" ] }, "manifest_version": 1 diff --git a/i18n/en.json b/i18n/en.json index cc962d2..273f436 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1,4 +1,10 @@ { - "@metadata": {}, - "softwareversion-desc": "Customizes [[Special:Version]] for ShoutWiki" + "@metadata": { + "authors": [ + "Jack Phoenix", + "Samantha Nguyen" + ] + }, + "softwareversion-desc": "Customizes [[Special:Version]], originally for ShoutWiki but can be used by other third-parties.", + "softwareversion-wiki-link": "" } diff --git a/i18n/qqq.json b/i18n/qqq.json index e870784..9633922 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -1,4 +1,10 @@ { - "@metadata": {}, - "softwareversion-desc": "{{desc|name=SoftwareVersion|url=https://www.mediawiki.org/wiki/Extension:SoftwareVersion}}" + "@metadata": { + "authors": [ + "Jack Phoenix", + "Samantha Nguyen" + ] + }, + "softwareversion-desc": "{{desc|name=SoftwareVersion|url=https://www.mediawiki.org/wiki/Extension:SoftwareVersion}}", + "softwareversion-wiki-link": "Wiki link to be customized so it can be used on Special:Version. {{ignore}}" } -- To view, visit https://gerrit.wikimedia.org/r/354885 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief2c8ea7bb7ca8987c9267c274ffd0295ab5266f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SoftwareVersion Gerrit-Branch: master Gerrit-Owner: SamanthaNguyen <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
