(bug 40641) Implement Special:Version/Credits
authorMarius Hoch <hoo@online.de>
Tue, 23 Oct 2012 00:21:47 +0000 (02:21 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 28 Oct 2012 22:32:34 +0000 (22:32 +0000)
I've implemented Special:Version/Credits to have a nice list of contributors,
without having to download a file. The page takes it's data from the
CREDITS file and parses it as wiki text.

(As I was on it, I was so bold to add my name to the CREDITS)

Change-Id: Ic956c303d57fdccfd214c2fcb78d04c6bd30449a

CREDITS
RELEASE-NOTES-1.21
includes/specials/SpecialVersion.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

diff --git a/CREDITS b/CREDITS
index 68c945c..6555b07 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -2,6 +2,7 @@ MediaWiki 1.21 is a collaborative project released under the
 GNU General Public License v2. We would like to recognize the
 following names for their contribution to the product.
 
+<!-- Please notice that the following can be found parsed under Special:Version/Credits -->
 == Developers ==
 * Aaron Schulz
 * Alex Z.
@@ -44,6 +45,7 @@ following names for their contribution to the product.
 * Leon Weber
 * Leslie Hoare
 * Marco Schuster
+* Marius Hoch
 * Matěj Grabovský
 * Matt Johnston
 * Max Semenik
@@ -206,4 +208,4 @@ following names for their contribution to the product.
 * Meno25
 * Rotem Liss
 * Shinjiman
-* Translatewiki.net Translators https://translatewiki.net/wiki/Special:ListUsers/translator
+* [https://translatewiki.net/wiki/Special:ListUsers/translator Translatewiki.net Translators]
index d8314a3..7b9e101 100644 (file)
@@ -34,6 +34,7 @@ production.
 * Added ApiQueryORM class to facilitate creation of query API modules based on
   tables that have a corresponding ORMTable class.
 * (bug 40876) Icon for PSD (Adobe Photoshop) file types.
+* (bug 40641) Implemented Special:Version/Credits with a list of contributors.
 
 === Bug fixes in 1.21 ===
 * (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
index 4e5b6bf..87ea943 100644 (file)
@@ -48,29 +48,43 @@ class SpecialVersion extends SpecialPage {
         * main()
         */
        public function execute( $par ) {
-               global $wgSpecialVersionShowHooks;
+               global $wgSpecialVersionShowHooks, $IP;
 
                $this->setHeaders();
                $this->outputHeader();
                $out = $this->getOutput();
                $out->allowClickjacking();
 
-               $text =
-                       $this->getMediaWikiCredits() .
-                       $this->softwareInformation() .
-                       $this->getEntryPointInfo() .
-                       $this->getExtensionCredits();
-               if ( $wgSpecialVersionShowHooks ) {
-                       $text .= $this->getWgHooks();
-               }
+               if( $par !== 'Credits' ) {
+                       $text =
+                               $this->getMediaWikiCredits() .
+                               $this->softwareInformation() .
+                               $this->getEntryPointInfo() .
+                               $this->getExtensionCredits();
+                       if ( $wgSpecialVersionShowHooks ) {
+                               $text .= $this->getWgHooks();
+                       }
 
-               $out->addWikiText( $text );
-               $out->addHTML( $this->IPInfo() );
+                       $out->addWikiText( $text );
+                       $out->addHTML( $this->IPInfo() );
 
-               if ( $this->getRequest()->getVal( 'easteregg' ) ) {
-                       if ( $this->showEasterEgg() ) {
-                               // TODO: put something interesting here
+                       if ( $this->getRequest()->getVal( 'easteregg' ) ) {
+                               if ( $this->showEasterEgg() ) {
+                                       // TODO: put something interesting here
+                               }
                        }
+               } else {
+                       // Credits sub page
+
+                       // Header
+                       $out->addHTML( wfMessage( 'version-credits-summary' )->parseAsBlock() );
+
+                       $wikiText = file_get_contents( $IP . '/CREDITS' );
+
+                       // Take everything from the first section onwards, to remove the (not localized) header
+                       $wikiText = substr( $wikiText, strpos( $wikiText, '==' ) );
+
+                       $out->addWikiText( $wikiText );
                }
        }
 
@@ -109,9 +123,9 @@ class SpecialVersion extends SpecialPage {
                        'Roan Kattouw', 'Trevor Parscal', 'Bryan Tong Minh', 'Sam Reed',
                        'Victor Vasiliev', 'Rotem Liss', 'Platonides', 'Antoine Musso',
                        'Timo Tijhof',
-                       '[{{SERVER}}{{SCRIPTPATH}}/CREDITS ' .
+                       '[[Special:Version/Credits|' .
                        wfMessage( 'version-poweredby-others' )->text() .
-                       ']'
+                       ']]'
                );
 
                return wfMessage( 'version-poweredby-credits', date( 'Y' ),
index a61ab82..b27cb18 100644 (file)
@@ -4712,6 +4712,7 @@ You can also [[Special:EditWatchlist|use the standard editor]].',
 'version-license'                       => 'License',
 'version-poweredby-credits'             => "This wiki is powered by '''[//www.mediawiki.org/ MediaWiki]''', copyright © 2001-$1 $2.",
 'version-poweredby-others'              => 'others',
+'version-credits-summary'               => 'We would like to recognize the following persons for their contribution to [[Special:Version|MediaWiki]].',
 'version-license-info'                  => 'MediaWiki is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
 
 MediaWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
index 82cf299..581ac34 100644 (file)
@@ -4695,6 +4695,7 @@ This is being used in [[Special:Version]], preceeding the subversion revision nu
 *$1: the current year
 *$2: a list of selected MediaWiki authors',
 'version-poweredby-others' => 'Used at the very end of {{msg-mw|version-poweredby-credits}} on [[Special:Version]]. First, there\'s a long list of selected MediaWiki authors, then the word "and" (from {{msg-mw|and}}) follows and then this translation, which is supposed to credit the many other people than developer helping with MediaWiki.',
+'version-credits-summary'               => 'Summary of the [[Special:Version/Credits]] sub page, which lists all developers etc. who contributed to MediaWiki. Shown at the top.',
 'version-license-info' => '[[wikipedia:GNU GPL|GNU GPL]] notice shown at [[Special:Version]]. See //www.gnu.org/licenses/old-licenses/gpl-2.0-translations.html for available translations.',
 'version-software-product' => 'Shown in [[Special:Version]]',
 'version-software-version' => '{{Identical|Version}}',
index 60e0f30..916edd9 100644 (file)
@@ -3569,6 +3569,7 @@ $wgMessageStructure = array(
                'version-license',
                'version-poweredby-credits',
                'version-poweredby-others',
+               'version-credits-summary',
                'version-license-info',
                'version-software',
                'version-software-product',