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/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 10073)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 10074)
@@ -1225,6 +1225,20 @@
 /** Extensions */
 $wgSkinExtensionFunctions = array();
 $wgExtensionFunctions = array();
+/**
+ * An array of extension types, their authors, url and name, add to it from
+ * an extension like:
+ *
+ * <code>
+ * $wgExtensionCredits[$type][] = array(
+ * 	'name' => 'Example extension',
+ *	'author' => 'Foo Barstein',
+ *	'url' => 'http://wwww.example.com/Example%20Extension/',
+ * );
+ * </code>
+ * Where $type is 'specialpage', 'parserhook', or 'other'.
+ */
+$wgExtensionCredits = array();
 
 /**
  * Allow user Javascript page?
Index: trunk/phase3/includes/SpecialVersion.php
===================================================================
--- trunk/phase3/includes/SpecialVersion.php	(revision 10073)
+++ trunk/phase3/includes/SpecialVersion.php	(revision 10074)
@@ -10,11 +10,11 @@
  * constructor
  */
 function wfSpecialVersion() {
-	global $wgOut, $wgVersion;
+	global $wgOut, $wgVersion, $wgExtensionCredits;
 	
 	$dbr =& wfGetDB( DB_SLAVE );
 	
-	$wgOut->addWikiText( "
+	$out = "
 <div dir='ltr'>
 This wiki is powered by '''[http://www.mediawiki.org/ MediaWiki]''',  
 copyright (C) 2001-2005 Magnus Manske, Brion Vibber, Lee Daniel Crocker,
@@ -38,6 +38,27 @@
 * [http://www.mediawiki.org/ MediaWiki]: $wgVersion
 * [http://www.php.net/ PHP]: " . phpversion() . " (" . php_sapi_name() . ")
 * " . $dbr->getSoftwareLink() . ": " . $dbr->getServerVersion() . "
-</div>" );
+</div>
+";
+	if ( count( $wgExtensionCredits ) > 0 ) {
+		$extensionTypes = array(
+			'specialpage' => 'Special pages',
+			'parserhook' => 'Parser hooks',
+			'other' => 'Other'
+		);
+		
+		$out .= "== Extensions ==\n";
+		
+		foreach ( $extensionTypes as $type => $text ) {
+			if ( count( @$wgExtensionCredits[$type] ) > 0 ) {
+				$out .= "=== $text ===\n";
+				foreach ( $wgExtensionCredits[$type] as $extension ) {
+					$out .= '* [' . $extension['url'] . ' ' . $extension['name'] . '] by ' . $extension['author'] . "\n";
+				}
+			}
+
+		}
+	}
+	$wgOut->addWikiText( $out );
 }
 ?>
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 10073)
+++ trunk/phase3/RELEASE-NOTES	(revision 10074)
@@ -563,9 +563,10 @@
 * (bug 655) Provide empty search form when searching for nothing
 * (bug 2802) Display more than one character of the sort key
 * Nynorsk numeric format fix
+* Added a new array for extensions to use, $wgExtensionCredits, see
+  documentation in DefaultSettings.php
 * (bug 2825) Fix regression in newtalk notifications for anons w/ enotif off
 
-
 === Caveats ===
 
 Some output, particularly involving user-supplied inline HTML, may not

Status & tagging log

  • 01:58, 13 October 2010 ^demon (Talk | contribs) changed the status of r10074 [removed: new added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox