Index: trunk/extensions/Narayam/Narayam.hooks.php |
— | — | @@ -28,6 +28,7 @@ |
29 | 29 | global $wgNarayamRecentItemsLength, $wgNarayamEnabledByDefault; |
30 | 30 | $vars['wgNarayamEnabledByDefault'] = $wgNarayamEnabledByDefault; |
31 | 31 | $vars['wgNarayamRecentItemsLength'] = $wgNarayamRecentItemsLength; |
| 32 | + $vars['wgNarayamHelpPage'] = wfMsgForContent( 'narayam-help-page' ); |
32 | 33 | return true; |
33 | 34 | } |
34 | 35 | |
— | — | @@ -41,7 +42,6 @@ |
42 | 43 | |
43 | 44 | $vars['wgNarayamAvailableSchemes'] = self::getSchemes(); // Note: scheme names must be keys, not values |
44 | 45 | $vars['wgNarayamAllSchemes'] = $wgNarayamSchemes; |
45 | | - $vars['wgNarayamHelpPage'] = wfMsgForContent( 'narayam-help-page' ); |
46 | 46 | return true; |
47 | 47 | } |
48 | 48 | |
— | — | @@ -50,28 +50,25 @@ |
51 | 51 | * @return array( scheme name => module name ) |
52 | 52 | */ |
53 | 53 | protected static function getSchemes() { |
54 | | - global $wgLanguageCode, $wgLang, $wgNarayamSchemes, $wgTitle; |
| 54 | + global $wgLanguageCode, $wgLang, $wgNarayamSchemes, $wgRequest; |
55 | 55 | |
56 | 56 | $userlangCode = $wgLang->getCode(); |
57 | 57 | $contlangSchemes = isset( $wgNarayamSchemes[$wgLanguageCode] ) ? |
58 | | - $wgNarayamSchemes[$wgLanguageCode] : array(); |
| 58 | + $wgNarayamSchemes[$wgLanguageCode] : array(); |
59 | 59 | $userlangSchemes = isset( $wgNarayamSchemes[$userlangCode] ) ? |
60 | | - $wgNarayamSchemes[$userlangCode] : array(); |
61 | | - $pagelang = $wgTitle->getPageLanguage()->getCode(); |
62 | | - $pagelangSchemes = isset( $wgNarayamSchemes[$pagelang] ) ? |
63 | | - $wgNarayamSchemes[$pagelang] : array(); |
| 60 | + $wgNarayamSchemes[$userlangCode] : array(); |
64 | 61 | |
65 | | - $schemes = $userlangSchemes + $contlangSchemes + $pagelangSchemes; |
| 62 | + $schemes = $userlangSchemes + $contlangSchemes; |
66 | 63 | |
67 | 64 | return $schemes; |
68 | 65 | } |
69 | 66 | |
70 | 67 | /// Hook: GetPreferences |
71 | 68 | public static function addPreference( $user, &$preferences ) { |
72 | | - // A checkbox in preferences to diable Narayam |
| 69 | + // A checkbox in preferences to disable Narayam |
73 | 70 | $preferences['narayamDisable'] = array( |
74 | 71 | 'type' => 'toggle', |
75 | | - 'label-message' => 'narayam-disable-preference', // a system message |
| 72 | + 'label-message' => 'narayam-disable-preference', |
76 | 73 | 'section' => 'editing/advancedediting', // under 'Advanced options' section of 'Editing' tab |
77 | 74 | ); |
78 | 75 | |