http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73185
Revision: 73185
Author: tparscal
Date: 2010-09-17 00:01:27 +0000 (Fri, 17 Sep 2010)
Log Message:
-----------
Removed unnessecary dependency on UsabilityInitiative.php. Refactored a bit,
mostly just naming things nicer and adding comments.
Modified Paths:
--------------
trunk/extensions/UsabilityInitiative/DontSwitchMeOver/DontSwitchMeOver.hooks.php
trunk/extensions/UsabilityInitiative/DontSwitchMeOver/DontSwitchMeOver.php
Modified:
trunk/extensions/UsabilityInitiative/DontSwitchMeOver/DontSwitchMeOver.hooks.php
===================================================================
---
trunk/extensions/UsabilityInitiative/DontSwitchMeOver/DontSwitchMeOver.hooks.php
2010-09-16 23:52:28 UTC (rev 73184)
+++
trunk/extensions/UsabilityInitiative/DontSwitchMeOver/DontSwitchMeOver.hooks.php
2010-09-17 00:01:27 UTC (rev 73185)
@@ -1,5 +1,4 @@
<?php
-
/**
* Hooks for DontSwitchMeOver extension
*
@@ -8,11 +7,17 @@
*/
class DontSwitchMeOverHooks {
- public static function addPreferences( $user, &$defaultPreferences ) {
+
+ /* Static Methods */
+
+ /**
+ * GetPreferences hook
+ */
+ public static function getPreferences( $user, &$defaultPreferences ) {
$defaultPreferences['dontswitchmeover'] = array(
'type' => 'toggle',
'label-message' => 'dontswitchmeover-pref',
- 'section' => 'rendering/skin', // May move after
discussion
+ 'section' => 'rendering/skin',
);
return true;
}
Modified:
trunk/extensions/UsabilityInitiative/DontSwitchMeOver/DontSwitchMeOver.php
===================================================================
--- trunk/extensions/UsabilityInitiative/DontSwitchMeOver/DontSwitchMeOver.php
2010-09-16 23:52:28 UTC (rev 73184)
+++ trunk/extensions/UsabilityInitiative/DontSwitchMeOver/DontSwitchMeOver.php
2010-09-17 00:01:27 UTC (rev 73185)
@@ -1,55 +1,41 @@
<?php
/**
* "Don't switch me over" extension
- *
+ *
* @file
* @ingroup Extensions
- *
- * This file contains the include for the "don't switch me over" extension
*
- * This allows users to indicate that they don't want to be switched over to
- * Vector in any future rollout.
- *
- * Usage: Include the following line in your LocalSettings.php
- * require_once(
"$IP/extensions/UsabilityInitiative/DontSwitchMeOver/DontSwitchMeOver.php" );
- *
+ * This allows users to indicate that they don't want to be affected by a
default preference change.
+ *
+ * @author Roan Kattouw <[email protected]>
* @author Nimish Gautam <[email protected]>
+ * @author Trevor Parscal <[email protected]>
* @license GPL v2 or later
- * @version 0.1.1
+ * @version 0.2.0
*/
/* Configuration */
-// Preferences to switch back to. This has to be set because the old default
-// skin isn't remembered after a switchover.
-// You can also add more preferences here, and on wikis with PrefSwitch setting
-// $wgDontSwitchMeOverPrefs = $wgPrefSwitchPrefs['off']; is probably wise
+// Preferences to switch back to. This has to be set because the old default
skin isn't remembered after a switchover.
+// You can also add more preferences here, and on wikis with PrefSwitch
running, adding...
+// $wgDontSwitchMeOverPrefs = $wgPrefSwitchPrefs['off'];
+// to your LocalSettings.php file is probably wise.
$wgDontSwitchMeOverPrefs = array(
'skin' => 'monobook'
);
+// Set default preference value
+$wgDefaultUserOptions['dontswitchmeover'] = 0;
-// Credits
+/* Setup */
+
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name' => "Don't Switch Me Over",
- 'author' => array( 'Roan Kattouw', 'Nimish Gautam' ),
- 'version' => '0.1',
+ 'author' => array( 'Roan Kattouw', 'Nimish Gautam', 'Trevor Parscal' ),
+ 'version' => '0.2.0',
'url' => 'http://www.mediawiki.org/wiki/Extension:UsabilityInitiative',
'descriptionmsg' => 'dontswitchmeover-desc',
);
-
-// Includes parent extension
-require_once( dirname( dirname( __FILE__ ) ) . "/UsabilityInitiative.php" );
-
-// Adds autoload classes
-$dir = dirname( __FILE__ ) . '/';
-$wgAutoloadClasses['DontSwitchMeOverHooks'] = $dir .
'DontSwitchMeOver.hooks.php';
-
-// Adds internationalized messages
-$wgExtensionMessagesFiles['DontSwitchMeOver'] = $dir .
'DontSwitchMeOver.i18n.php';
-
-// Hooked functions
-$wgHooks['GetPreferences'][] = 'DontSwitchMeOverHooks::addPreferences';
-
-// Set default
-$wgDefaultUserOptions['dontswitchmeover'] = 0;
+$wgAutoloadClasses['DontSwitchMeOverHooks'] = dirname( __FILE__ ) .
'/DontSwitchMeOver.hooks.php';
+$wgExtensionMessagesFiles['DontSwitchMeOver'] = dirname( __FILE__ ) .
'/DontSwitchMeOver.i18n.php';
+$wgHooks['GetPreferences'][] = 'DontSwitchMeOverHooks::getPreferences';
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs