ENH#169: Provide plugin interface for skins. See also module "sampleskin" in extensions.
authorJens Frank <jeluf@users.mediawiki.org>
Fri, 27 Aug 2004 05:23:52 +0000 (05:23 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Fri, 27 Aug 2004 05:23:52 +0000 (05:23 +0000)
includes/DefaultSettings.php
includes/Setup.php
includes/SpecialPreferences.php

index 1892487..7ce4518 100644 (file)
@@ -511,6 +511,7 @@ $wgDefaultSkin = 'monobook';
 $wgAllowRealName = true;
 
 # Extensions
+$wgSkinExtensionFunctions = array();
 $wgExtensionFunctions = array();
 
 # Allow user Javascript page?
index c1a303e..701a022 100644 (file)
@@ -236,6 +236,14 @@ $wgBlockCache = new BlockCache( true );
 wfProfileOut( $fname.'-BlockCache' );
 wfProfileIn( $fname.'-User' );
 
+# Extension setup functions
+# Entries should be added to this variable during the inclusion 
+# of the extension file. This allows the extension to perform 
+# any necessary initialisation in the fully initialised environment
+foreach ( $wgSkinExtensionFunctions as $func ) {
+       $func();
+}
+
 if( $wgCommandLineMode ) {
        # Used for some maintenance scripts; user session cookies can screw things up
        # when the database is in an in-between state.
index 596b2b8..e8bfc32 100644 (file)
@@ -382,8 +382,13 @@ class PreferencesForm {
                        } else { 
                                $checked = ""; 
                        }
+                       if ( isset( $skinNames[$skinkey] ) ) {
+                               $sn = $skinNames[$skinkey];
+                       } else {
+                               $sn = $skinname;
+                       }
                        $wgOut->addHTML( "<div><label><input type='radio' name=\"wpSkin\"
-       value=\"$skinkey\"$checked /> {$skinNames[$skinkey]}</label></div>\n" );
+       value=\"$skinkey\"$checked /> {$sn}</label></div>\n" );
                }
                $wgOut->addHTML( "</fieldset>\n\n" );