* Fix notice on search index update due to non-array
[lhc/web/wiklou.git] / includes / SpecialVersion.php
index 553ed8c..a525d35 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 /**
+ * Give information about the version MediaWiki, PHP, and the database
  *
  * @package MediaWiki
  * @subpackage SpecialPage
  * constructor
  */
 function wfSpecialVersion() {
-       global $wgUser, $wgOut, $wgVersion, $wgScriptPath;
-       $fname = 'wfSpecialVersion';
-
-       $wgOut->addWikiText( "
+       global $wgOut, $wgVersion, $wgExtensionCredits;
+       
+       $dbr =& wfGetDB( DB_SLAVE );
+       
+       $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,
 Tim Starling, Erik Möller, and others.
@@ -27,23 +30,48 @@ 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.
 
-You should have received [{{SERVER}}$wgScriptPath/COPYING a copy of the GNU General Public License]
+You should have received [{{SERVER}}{{SCRIPTPATH}}/COPYING a copy of the GNU General Public License]
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-or [http://www.gnu.org/copyleft/gpl.html read it online]");
-       $versions = array(
-               "[http://wikipedia.sf.net/ MediaWiki]" => $wgVersion,
-               "[http://www.php.net/ PHP]" => phpversion() . " (" . php_sapi_name() . ")"
-       );
-       
-       $dbr =& wfGetDB( DB_SLAVE );
-       $dblink = $dbr->getSoftwareLink();
-       $versions[$dblink] = $dbr->getServerVersion();
-       
-       $out = '';
-       foreach( $versions as $module => $ver ) {
-               $out .= "*$module: $ver\n";
+or [http://www.gnu.org/copyleft/gpl.html read it online]
+
+* [http://www.mediawiki.org/ MediaWiki]: $wgVersion
+* [http://www.php.net/ PHP]: " . phpversion() . " (" . php_sapi_name() . ")
+* " . $dbr->getSoftwareLink() . ": " . $dbr->getServerVersion() . "
+</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 .= formatExtensionCredits( $extension['name'], $extension['author'], @$extension['url'], @$extension['version'] ); 
+                               }
+                       }
+
+               }
        }
        $wgOut->addWikiText( $out );
 }
+
+function formatExtensionCredits( $name, $author, $url = null, $version = null ) {
+       $ret = '* ';
+       if ( isset( $url ) )
+               $ret .= "[$url ";
+       $ret .= $name;
+       if ( isset( $url ) )
+               $ret .= ']';
+       if ( isset( $version ) )
+               $ret .= " $version";
+       $ret .= " by $author\n";
+       return $ret;
+}
 ?>