MediaWiki r10074 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r10073‎ | r10074 (on ViewVC)‎ | r10075 >
Date:23:42, 12 July 2005
Author:avar
Status:old
Tags:
Comment:
* Added a new array for extensions to use, $wgExtensionCredits, see
documentation in DefaultSettings.php
Modified paths:

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES
@@ -563,9 +563,10 @@
564564 * (bug 655) Provide empty search form when searching for nothing
565565 * (bug 2802) Display more than one character of the sort key
566566 * Nynorsk numeric format fix
 567+* Added a new array for extensions to use, $wgExtensionCredits, see
 568+ documentation in DefaultSettings.php
567569 * (bug 2825) Fix regression in newtalk notifications for anons w/ enotif off
568570
569 -
570571 === Caveats ===
571572
572573 Some output, particularly involving user-supplied inline HTML, may not
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1225,6 +1225,20 @@
12261226 /** Extensions */
12271227 $wgSkinExtensionFunctions = array();
12281228 $wgExtensionFunctions = array();
 1229+/**
 1230+ * An array of extension types, their authors, url and name, add to it from
 1231+ * an extension like:
 1232+ *
 1233+ * <code>
 1234+ * $wgExtensionCredits[$type][] = array(
 1235+ * 'name' => 'Example extension',
 1236+ * 'author' => 'Foo Barstein',
 1237+ * 'url' => 'http://wwww.example.com/Example%20Extension/',
 1238+ * );
 1239+ * </code>
 1240+ * Where $type is 'specialpage', 'parserhook', or 'other'.
 1241+ */
 1242+$wgExtensionCredits = array();
12291243
12301244 /**
12311245 * Allow user Javascript page?
Index: trunk/phase3/includes/SpecialVersion.php
@@ -10,11 +10,11 @@
1111 * constructor
1212 */
1313 function wfSpecialVersion() {
14 - global $wgOut, $wgVersion;
 14+ global $wgOut, $wgVersion, $wgExtensionCredits;
1515
1616 $dbr =& wfGetDB( DB_SLAVE );
1717
18 - $wgOut->addWikiText( "
 18+ $out = "
1919 <div dir='ltr'>
2020 This wiki is powered by '''[http://www.mediawiki.org/ MediaWiki]''',
2121 copyright (C) 2001-2005 Magnus Manske, Brion Vibber, Lee Daniel Crocker,
@@ -38,6 +38,27 @@
3939 * [http://www.mediawiki.org/ MediaWiki]: $wgVersion
4040 * [http://www.php.net/ PHP]: " . phpversion() . " (" . php_sapi_name() . ")
4141 * " . $dbr->getSoftwareLink() . ": " . $dbr->getServerVersion() . "
42 -</div>" );
 42+</div>
 43+";
 44+ if ( count( $wgExtensionCredits ) > 0 ) {
 45+ $extensionTypes = array(
 46+ 'specialpage' => 'Special pages',
 47+ 'parserhook' => 'Parser hooks',
 48+ 'other' => 'Other'
 49+ );
 50+
 51+ $out .= "== Extensions ==\n";
 52+
 53+ foreach ( $extensionTypes as $type => $text ) {
 54+ if ( count( @$wgExtensionCredits[$type] ) > 0 ) {
 55+ $out .= "=== $text ===\n";
 56+ foreach ( $wgExtensionCredits[$type] as $extension ) {
 57+ $out .= '* [' . $extension['url'] . ' ' . $extension['name'] . '] by ' . $extension['author'] . "\n";
 58+ }
 59+ }
 60+
 61+ }
 62+ }
 63+ $wgOut->addWikiText( $out );
4364 }
4465 ?>

Status & tagging log

  • 01:58, 13 October 2010 ^demon (talk | contribs) changed the status of r10074 [removed: new added: old]