Index: trunk/extensions/WikiEditor/WikiEditor.php |
— | — | @@ -17,26 +17,26 @@ |
18 | 18 | |
19 | 19 | // Each module may be configured individually to be globally on/off or user preference based |
20 | 20 | $wgWikiEditorFeatures = array( |
21 | | - |
| 21 | + |
22 | 22 | /* Textarea / i-frame compatible (OK to deploy) */ |
23 | | - |
| 23 | + |
24 | 24 | 'toolbar' => array( 'global' => false, 'user' => true ), |
25 | 25 | // Provides interactive tools |
26 | 26 | 'dialogs' => array( 'global' => false, 'user' => true ), |
27 | 27 | // Hide signature button from main namespace |
28 | 28 | 'hidesig' => array( 'global' => true, 'user' => false ), |
29 | | - |
| 29 | + |
30 | 30 | /* Textarea / i-frame compatible, but still experimental and unstable (do not deploy!) */ |
31 | | - |
| 31 | + |
32 | 32 | // Adds a tab for previewing in-line |
33 | 33 | 'preview' => array( 'global' => false, 'user' => true ), |
34 | 34 | // Adds a button for previewing in a dialog |
35 | 35 | 'previewDialog' => array( 'global' => false, 'user' => false ), |
36 | 36 | // Adds a button and dialog for step-by-step publishing |
37 | 37 | 'publish' => array( 'global' => false, 'user' => true ), |
38 | | - |
| 38 | + |
39 | 39 | /* I-frame dependent (do not deploy!) */ |
40 | | - |
| 40 | + |
41 | 41 | // Failry stable table of contents |
42 | 42 | 'toc' => array( 'global' => false, 'user' => true ), |
43 | 43 | // Pretty broken template collapsing/editing |
— | — | @@ -71,13 +71,13 @@ |
72 | 72 | |
73 | 73 | $wgResourceModules += array( |
74 | 74 | /* Third-party modules */ |
75 | | - |
| 75 | + |
76 | 76 | 'contentCollector' => $wikiEditorTpl + array( |
77 | 77 | 'scripts' => 'contentCollector.js', |
78 | 78 | ), |
79 | | - |
| 79 | + |
80 | 80 | /* WikiEditor jQuery plugin Resources */ |
81 | | - |
| 81 | + |
82 | 82 | 'jquery.wikiEditor' => $wikiEditorTpl + array( |
83 | 83 | 'scripts' => 'jquery.wikiEditor.js', |
84 | 84 | 'styles' => 'jquery.wikiEditor.css', |
— | — | @@ -392,9 +392,9 @@ |
393 | 393 | 'wikieditor-toolbar-help-content-indent-result', |
394 | 394 | ), |
395 | 395 | ), |
396 | | - |
| 396 | + |
397 | 397 | /* WikiEditor Resources */ |
398 | | - |
| 398 | + |
399 | 399 | 'ext.wikiEditor' => $wikiEditorTpl + array( |
400 | 400 | 'scripts' => 'ext.wikiEditor.js', |
401 | 401 | 'styles' => 'ext.wikiEditor.css', |
Index: trunk/extensions/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -167,7 +167,8 @@ |
168 | 168 | * This method is public to allow other extensions that use WikiEditor to use the |
169 | 169 | * same configuration as WikiEditor itself |
170 | 170 | * |
171 | | - * @param $name Name of the feature, should be a key of $features |
| 171 | + * @param $name string Name of the feature, should be a key of $features |
| 172 | + * @return bool |
172 | 173 | */ |
173 | 174 | public static function isEnabled( $name ) { |
174 | 175 | global $wgWikiEditorFeatures, $wgUser; |
— | — | @@ -198,6 +199,7 @@ |
199 | 200 | * Adds the modules to the edit form |
200 | 201 | * |
201 | 202 | * @param $toolbar array list of toolbar items |
| 203 | + * @return bool |
202 | 204 | */ |
203 | 205 | public static function editPageShowEditFormInitial( &$toolbar ) { |
204 | 206 | global $wgOut; |
— | — | @@ -218,6 +220,7 @@ |
219 | 221 | * |
220 | 222 | * @param $user User current user |
221 | 223 | * @param $defaultPreferences array list of default user preference controls |
| 224 | + * @return bool |
222 | 225 | */ |
223 | 226 | public static function getPreferences( $user, &$defaultPreferences ) { |
224 | 227 | global $wgWikiEditorFeatures; |
— | — | @@ -239,6 +242,8 @@ |
240 | 243 | * MakeGlobalVariablesScript hook |
241 | 244 | * |
242 | 245 | * Adds enabled/disabled switches for WikiEditor modules |
| 246 | + * @param $vars array |
| 247 | + * @return bool |
243 | 248 | */ |
244 | 249 | public static function resourceLoaderGetConfigVars( &$vars ) { |
245 | 250 | global $wgWikiEditorFeatures; |
— | — | @@ -261,9 +266,11 @@ |
262 | 267 | return true; |
263 | 268 | } |
264 | 269 | |
| 270 | + /** |
| 271 | + * @param $vars array |
| 272 | + * @return bool |
| 273 | + */ |
265 | 274 | public static function makeGlobalVariablesScript( &$vars ) { |
266 | | - global $wgWikiEditorFeatures; |
267 | | - |
268 | 275 | // Build and export old-style wgWikiEditorEnabledModules object for back compat |
269 | 276 | $enabledModules = array(); |
270 | 277 | foreach ( self::$features as $name => $feature ) { |