Index: trunk/extensions/Configure/Configure.obj.php |
— | — | @@ -291,10 +291,12 @@ |
292 | 292 | /** |
293 | 293 | * Save a new configuration |
294 | 294 | * @param $settings array of settings |
| 295 | + * @param $user User doing the modification |
295 | 296 | * @param $wiki String: wiki name or false to use the current one |
| 297 | + * @param $reason String |
296 | 298 | * @return bool true on success |
297 | 299 | */ |
298 | | - public function saveNewSettings( $settings, $wiki = false, $reason = '' ) { |
| 300 | + public function saveNewSettings( $settings, User $user, $wiki = false, $reason = '' ) { |
299 | 301 | if ( !is_array( $settings ) ) |
300 | 302 | # hmmm |
301 | 303 | return false; |
— | — | @@ -308,7 +310,7 @@ |
309 | 311 | $this->mConf[$wiki] = $settings; |
310 | 312 | } |
311 | 313 | |
312 | | - return $this->getHandler()->saveNewSettings( $this->mConf, $wiki, false, $reason ); |
| 314 | + return $this->getHandler()->saveNewSettings( $this->mConf, $user, $wiki, false, $reason ); |
313 | 315 | } |
314 | 316 | |
315 | 317 | /** |
Index: trunk/extensions/Configure/CHANGELOG |
— | — | @@ -1,6 +1,12 @@ |
2 | 2 | This file lists changes on this extension. Localisation updates are done |
3 | 3 | through translatewiki.net and are not listed here. |
4 | 4 | |
| 5 | +0.17.0 - 13 January 2012 |
| 6 | + Rewrote the extension to use local context instead of global variables where |
| 7 | + possible. |
| 8 | + THIS VERSION NOW REQUIRES MediaWiki 1.18 TO WORK. |
| 9 | + |
| 10 | + |
5 | 11 | 0.16.3 - 3 March 2011 |
6 | 12 | Updated the extension to work with the current development version. |
7 | 13 | |
Index: trunk/extensions/Configure/scripts/migrateToDB.php |
— | — | @@ -76,11 +76,12 @@ |
77 | 77 | |
78 | 78 | protected function migrateVersion( $version ){ |
79 | 79 | $now = $this->mFilesHandler->getOldSettings( $version ); |
| 80 | + $user = User::newFromName( 'Maintenance script' ); |
80 | 81 | $this->output( "doing $version...\n" ); |
81 | 82 | foreach( $now as $wiki => $settings ){ |
82 | 83 | if( !isset( $this->mPreviousVersion[$wiki] ) || $this->mPreviousVersion[$wiki] != $settings ){ |
83 | 84 | $this->output( " $wiki..." ); |
84 | | - $this->mDBHandler->saveNewSettings( $now, $wiki, $version ); |
| 85 | + $this->mDBHandler->saveNewSettings( $now, $user, $wiki, $version ); |
85 | 86 | $this->output( "ok\n" ); |
86 | 87 | } |
87 | 88 | } |
Index: trunk/extensions/Configure/scripts/manage.php |
— | — | @@ -92,7 +92,8 @@ |
93 | 93 | $this->error( "revert: The version given ($version) is invalid\n" ); |
94 | 94 | return; |
95 | 95 | } |
96 | | - $wgConf->saveNewSettings( $arr, null, "Reverting to verion $version" ); |
| 96 | + $user = User::newFromName( 'Maintenance script' ); |
| 97 | + $wgConf->saveNewSettings( $arr, $user, null, "Reverting to verion $version" ); |
97 | 98 | } |
98 | 99 | } |
99 | 100 | |
Index: trunk/extensions/Configure/settings/WebExtension.php |
— | — | @@ -180,30 +180,35 @@ |
181 | 181 | * @return String |
182 | 182 | */ |
183 | 183 | public static function prettifyForDisplay( $val ) { |
184 | | - if ( is_bool( $val ) ) |
| 184 | + if ( is_bool( $val ) ) { |
185 | 185 | return wfBoolToStr( $val ); |
186 | | - return $val; |
| 186 | + } else { |
| 187 | + return $val; |
| 188 | + } |
187 | 189 | } |
188 | 190 | |
189 | 191 | /** |
190 | 192 | * Generate html to configure this extension |
191 | 193 | * |
| 194 | + * @param $context |
192 | 195 | * @return String: XHTML |
193 | 196 | */ |
194 | | - public function getHtml() { |
195 | | - if ( !$this->isUsable() ) |
| 197 | + public function getHtml( $context ) { |
| 198 | + if ( !$this->isUsable() ) { |
196 | 199 | return ''; |
| 200 | + } |
| 201 | + |
197 | 202 | $ret = '<fieldset><legend>' . htmlspecialchars( $this->mName ) . '</legend>'; |
198 | 203 | if ( count( $errors = $this->checkSettingsDependencies() ) ) { |
199 | 204 | $ret .= "<span class=\"errorbox\">"; |
200 | | - $ret .= wfMessage( 'configure-ext-settings-dep-errors', count( $errors ) )->parse(); |
| 205 | + $ret .= $context->msg( 'configure-ext-settings-dep-errors', count( $errors ) )->parse(); |
201 | 206 | $ret .= "<ul>\n"; |
202 | 207 | foreach ( $errors as $err ) { |
203 | 208 | list( $setting, $req, $cur ) = $err; |
204 | 209 | $setting = '$'.$setting; |
205 | 210 | $req = self::prettifyForDisplay( $req ); |
206 | 211 | $cur = self::prettifyForDisplay( $cur ); |
207 | | - $ret .= '<li>' . wfMessage( 'configure-ext-settings-dep-error', $setting, $req, $cur )->parse() . "</li>\n"; |
| 212 | + $ret .= '<li>' . $context->msg( 'configure-ext-settings-dep-error', $setting, $req, $cur )->parse() . "</li>\n"; |
208 | 213 | } |
209 | 214 | return $ret . "</ul>\n</span>\n</fieldset>"; |
210 | 215 | } |
— | — | @@ -211,11 +216,11 @@ |
212 | 217 | $warnings = array(); |
213 | 218 | |
214 | 219 | if ( $this->mDbChange ) { |
215 | | - $warnings[] = wfMessage( 'configure-ext-schemachange' )->parse(); |
| 220 | + $warnings[] = $context->msg( 'configure-ext-schemachange' )->parse(); |
216 | 221 | } |
217 | 222 | if ( count( $this->mExtensionsDependencies ) ) { |
218 | | - global $wgLang; |
219 | | - $warnings[] = wfMessage( 'configure-ext-ext-dependencies', $wgLang->listToText( $this->mExtensionsDependencies ), count( $this->mExtensionsDependencies ) )->parse(); |
| 223 | + $warnings[] = $context->msg( 'configure-ext-ext-dependencies', |
| 224 | + $context->getLang()->listToText( $this->mExtensionsDependencies ), count( $this->mExtensionsDependencies ) )->parse(); |
220 | 225 | } |
221 | 226 | |
222 | 227 | if ( count( $warnings ) ) { |
— | — | @@ -230,20 +235,20 @@ |
231 | 236 | $ret .= "</span><br clear=\"left\" />\n"; |
232 | 237 | } |
233 | 238 | |
234 | | - $use = wfMessage( 'configure-ext-use' )->parse(); |
| 239 | + $use = $context->msg( 'configure-ext-use' )->parse(); |
235 | 240 | $ret .= "<h2>{$use}</h2>\n"; |
236 | 241 | $ret .= "<table class=\"configure-table configure-table-ext\"><tr><td>\n"; |
237 | 242 | $checkName = $this->getCheckName(); |
238 | | - $ret .= Xml::checkLabel( wfMessage( 'configure-ext-use-extension' )->text(), $checkName, $checkName, $this->isActivated() ); |
| 243 | + $ret .= Xml::checkLabel( $context->msg( 'configure-ext-use-extension' )->text(), $checkName, $checkName, $this->isActivated() ); |
239 | 244 | $ret .= "</td></tr>\n"; |
240 | 245 | if ( !empty( $this->mDoc ) ) { |
241 | 246 | $ret .= "<tr><td>\n"; |
242 | | - $ret .= '<p>' . Xml::element( 'a', array( 'href' => $this->mDoc ), wfMessage( 'configure-ext-doc' )->text() ) . "</p>\n"; |
| 247 | + $ret .= '<p>' . Xml::element( 'a', array( 'href' => $this->mDoc ), $context->msg( 'configure-ext-doc' )->text() ) . "</p>\n"; |
243 | 248 | $ret .= "</td></tr>"; |
244 | 249 | } |
245 | 250 | $ret .= "</table>\n"; |
246 | 251 | if ( count( $this->mSettings ) ) { |
247 | | - $settings = wfMessage( 'configure-ext-settings' )->parse(); |
| 252 | + $settings = $context->msg( 'configure-ext-settings' )->parse(); |
248 | 253 | $ret .= "<h2>{$settings}</h2>\n"; |
249 | 254 | $ret .= "<table class=\"configure-table\">\n"; |
250 | 255 | foreach ( $this->mSettings as $name => $type ) { |
Index: trunk/extensions/Configure/specials/SpecialExtensions.php |
— | — | @@ -23,8 +23,8 @@ |
24 | 24 | * Submit a posted form |
25 | 25 | */ |
26 | 26 | public function doSubmit() { |
27 | | - global $wgConf, $wgOut, $wgRequest; |
28 | | - $reason = $wgRequest->getText( 'wpReason' ); |
| 27 | + global $wgConf; |
| 28 | + $reason = $this->getRequest()->getText( 'wpReason' ); |
29 | 29 | $current = $wgConf->getCurrent( $this->mWiki ); |
30 | 30 | $settings = $this->importFromRequest(); |
31 | 31 | $new = $settings + $current; |
— | — | @@ -36,25 +36,24 @@ |
37 | 37 | } |
38 | 38 | $new = $this->removeDefaults( $new ); |
39 | 39 | $new['__includes'] = $this->getRequiredFiles(); |
40 | | - $ok = $wgConf->saveNewSettings( $new, $this->mWiki, $reason ); |
| 40 | + $ok = $wgConf->saveNewSettings( $new, $this->getUser(), $this->mWiki, $reason ); |
41 | 41 | |
42 | 42 | $result = $ok ? 'success' : 'failure'; |
43 | 43 | |
44 | | - $url = $this->getTitle()->getLocalURL( "result=$result" ); |
45 | | - $wgOut->redirect( $url ); |
| 44 | + $this->getOutput()->redirect( $this->getTitle()->getFullURL( "result=$result" ) ); |
46 | 45 | } |
47 | 46 | |
48 | 47 | /** |
49 | 48 | * Show the diff between the current version and the posted version |
50 | 49 | */ |
51 | 50 | protected function showDiff() { |
52 | | - global $wgConf, $wgOut; |
| 51 | + global $wgConf; |
53 | 52 | $wiki = $this->mWiki; |
54 | 53 | $old = array( $wiki => $wgConf->getCurrent( $wiki ) ); |
55 | 54 | $new = array( $wiki => $this->conf ); |
56 | | - $diff = new ExtPreviewConfigurationDiff( $old, $new, array( $wiki ) ); |
| 55 | + $diff = new ExtPreviewConfigurationDiff( $this->getContext(), $old, $new, array( $wiki ) ); |
57 | 56 | $diff->setViewCallback( array( $this, 'userCanRead' ) ); |
58 | | - $wgOut->addHTML( $diff->getHtml() ); |
| 57 | + $this->getOut()->addHTML( $diff->getHtml() ); |
59 | 58 | } |
60 | 59 | |
61 | 60 | /** |
— | — | @@ -63,18 +62,18 @@ |
64 | 63 | * @return Boolean: success |
65 | 64 | */ |
66 | 65 | protected function checkExtensionsDependencies() { |
67 | | - global $wgRequest, $wgOut; |
68 | | - |
| 66 | + $request = $this->getRequest(); |
69 | 67 | foreach ( $this->mConfSettings->getAllExtensionsObjects() as $ext ) { |
70 | | - if ( !count( $ext->getExtensionsDependencies() ) || !$wgRequest->getCheck( $ext->getCheckName() ) ) |
| 68 | + if ( !count( $ext->getExtensionsDependencies() ) || !$request->getCheck( $ext->getCheckName() ) ) |
71 | 69 | continue; |
72 | 70 | |
73 | 71 | foreach ( $ext->getExtensionsDependencies() as $depName ) { |
74 | 72 | $dep = $this->mConfSettings->getExtension( $depName ); |
75 | 73 | if ( !is_object( $dep ) ) |
76 | 74 | throw new MWException( "Unable to find \"{$depName}\" dependency for \"{$ext->getName()}\" extension" ); |
77 | | - if ( !$wgRequest->getCheck( $dep->getCheckName() ) ) { |
78 | | - $wgOut->wrapWikiMsg( '<span class="errorbox">$1</span>', array( 'configure-ext-ext-dependency-err', $ext->getName(), $depName ) ); |
| 75 | + if ( !$request->getCheck( $dep->getCheckName() ) ) { |
| 76 | + $this->getOutput()->wrapWikiMsg( '<span class="errorbox">$1</span>', |
| 77 | + array( 'configure-ext-ext-dependency-err', $ext->getName(), $depName ) ); |
79 | 78 | return false; |
80 | 79 | } |
81 | 80 | } |
— | — | @@ -87,7 +86,7 @@ |
88 | 87 | * @return array |
89 | 88 | */ |
90 | 89 | protected function getRequiredFiles() { |
91 | | - global $wgRequest, $wgConfigureOnlyUseVarForExt; |
| 90 | + global $wgConfigureOnlyUseVarForExt; |
92 | 91 | if ( $wgConfigureOnlyUseVarForExt ) |
93 | 92 | return array(); |
94 | 93 | $arr = array(); |
— | — | @@ -96,7 +95,7 @@ |
97 | 96 | continue; // must exist |
98 | 97 | if ( $ext->useVariable() ) |
99 | 98 | continue; |
100 | | - if ( $wgRequest->getCheck( $ext->getCheckName() ) ) |
| 99 | + if ( $this->getRequest()->getCheck( $ext->getCheckName() ) ) |
101 | 100 | $arr[] = $ext->getFile(); |
102 | 101 | } |
103 | 102 | return $arr; |
— | — | @@ -122,8 +121,6 @@ |
123 | 122 | * @return xhtml |
124 | 123 | */ |
125 | 124 | protected function buildAllSettings() { |
126 | | - global $wgRequest; |
127 | | - |
128 | 125 | $ret = ''; |
129 | 126 | $globalDone = false; |
130 | 127 | foreach ( $this->mConfSettings->getAllExtensionsObjects() as $wikiExt ) { |
— | — | @@ -133,7 +130,7 @@ |
134 | 131 | $wikiExt->setPageObj( $this ); |
135 | 132 | |
136 | 133 | if ( $this->mIsPreview ) |
137 | | - $wikiExt->setTempActivated( $wgRequest->getCheck( $ext->getCheckName() ) ); |
| 134 | + $wikiExt->setTempActivated( $this->getRequest()->getCheck( $ext->getCheckName() ) ); |
138 | 135 | |
139 | 136 | $settings = $wikiExt->getSettings(); |
140 | 137 | foreach ( $settings as $setting => $type ) { |
— | — | @@ -152,7 +149,7 @@ |
153 | 150 | if ( $globalDone ) |
154 | 151 | $GLOBALS['wgHooks'] = $oldHooks; |
155 | 152 | |
156 | | - $ret .= $wikiExt->getHtml(); |
| 153 | + $ret .= $wikiExt->getHtml( $this->getContext() ); |
157 | 154 | } |
158 | 155 | |
159 | 156 | return $ret; |
Index: trunk/extensions/Configure/specials/SpecialViewConfig.php |
— | — | @@ -22,13 +22,14 @@ |
23 | 23 | } |
24 | 24 | |
25 | 25 | protected function showOldVersionMessage( $version ) { |
26 | | - global $wgConf, $wgOut, $wgRequest; |
| 26 | + global $wgConf; |
27 | 27 | |
28 | 28 | $this->version = $version; |
29 | 29 | |
30 | | - if ( $diff = $wgRequest->getVal( 'diff' ) ) { |
| 30 | + $diff = $this->getRequest()->getVal( 'diff' ); |
| 31 | + if ( $diff ) { |
31 | 32 | if ( !$wgConf->versionExists( $diff ) ) { |
32 | | - $wgOut->wrapWikiMsg( '<div class="errorbox">$1</div>', |
| 33 | + $this->getOutput()->wrapWikiMsg( '<div class="errorbox">$1</div>', |
33 | 34 | array( 'configure-old-not-available', $diff ) ); |
34 | 35 | return false; |
35 | 36 | } |
— | — | @@ -46,24 +47,21 @@ |
47 | 48 | * Show diff |
48 | 49 | */ |
49 | 50 | protected function showDiff() { |
50 | | - global $wgOut; |
51 | 51 | $wikis = $this->isUserAllowedAll() ? true : array( $this->mWiki ); |
52 | | - $diffEngine = new HistoryConfigurationDiff( $this->diff, $this->version, $wikis ); |
| 52 | + $diffEngine = new HistoryConfigurationDiff( $this->getContext(), $this->diff, $this->version, $wikis ); |
53 | 53 | $diffEngine->setViewCallback( array( $this, 'userCanRead' ) ); |
54 | | - $wgOut->addHTML( $diffEngine->getHTML() ); |
| 54 | + $this->getOutput()->addHTML( $diffEngine->getHTML() ); |
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | 58 | * Show the main form |
59 | 59 | */ |
60 | 60 | protected function showForm() { |
61 | | - global $wgOut, $wgRequest; |
62 | | - |
63 | 61 | if ( !empty( $this->conf ) || isset( $this->diff ) ) { |
64 | 62 | if ( isset( $this->diff ) ) { |
65 | 63 | $this->showDiff(); |
66 | 64 | } else { |
67 | | - $wgOut->addHTML( |
| 65 | + $this->getOutput()->addHTML( |
68 | 66 | $this->buildSearchForm() . "\n" . |
69 | 67 | Xml::openElement( 'div', array( 'id' => 'configure-form' ) ) . "\n" . |
70 | 68 | Xml::openElement( 'div', array( 'id' => 'configure' ) ) . "\n" . |
— | — | @@ -75,7 +73,7 @@ |
76 | 74 | ); |
77 | 75 | } |
78 | 76 | } else { |
79 | | - $wgOut->addHTML( $this->buildOldVersionSelect() ); |
| 77 | + $this->getOutput()->addHTML( $this->buildOldVersionSelect() ); |
80 | 78 | } |
81 | 79 | $this->injectScriptsAndStyles(); |
82 | 80 | } |
— | — | @@ -84,27 +82,27 @@ |
85 | 83 | * Build links to old version of the configuration |
86 | 84 | */ |
87 | 85 | protected function buildOldVersionSelect() { |
88 | | - global $wgConf, $wgUser, $wgRequest, $wgScript; |
| 86 | + global $wgConf, $wgScript; |
89 | 87 | |
90 | 88 | $self = $this->getTitle(); |
91 | 89 | $pager = $wgConf->getPager(); |
92 | 90 | $pager->setFormatCallback( array( $this, 'formatVersionRow' ) ); |
93 | 91 | |
94 | | - $wiki = $this->isUserAllowedInterwiki() && $wgRequest->getVal( 'view', 'all' ) == 'all' ? false : $this->mWiki; |
| 92 | + $wiki = $this->isUserAllowedInterwiki() && $this->getRequest()->getVal( 'view', 'all' ) == 'all' ? false : $this->mWiki; |
95 | 93 | $pager->setWiki( $wiki ); |
96 | 94 | |
97 | 95 | $showDiff = $pager->getNumRows() > 1; |
98 | 96 | |
| 97 | + $user = $this->getUser(); |
99 | 98 | $formatConf = array( |
100 | 99 | 'showDiff' => $showDiff, |
101 | | - 'allowedConfig' => $wgUser->isAllowed( 'configure' ), |
102 | | - 'allowedExtensions' => $wgUser->isAllowed( 'extensions' ), |
| 100 | + 'allowedConfig' => $user->isAllowed( 'configure' ), |
| 101 | + 'allowedExtensions' => $user->isAllowed( 'extensions' ), |
103 | 102 | 'allowedAll' => $this->isUserAllowedInterwiki(), |
104 | | - 'allowedConfigAll' => $wgUser->isAllowed( 'configure-interwiki' ), |
105 | | - 'allowedExtensionsAll' => $wgUser->isAllowed( 'extensions-interwiki' ), |
| 103 | + 'allowedConfigAll' => $user->isAllowed( 'configure-interwiki' ), |
| 104 | + 'allowedExtensionsAll' => $user->isAllowed( 'extensions-interwiki' ), |
106 | 105 | 'self' => $self, |
107 | | - 'skin' => $wgUser->getSkin(), |
108 | | - 'editMsg' => wfMessage( 'edit' )->text() . wfMessage( 'colon-separator' )->text(), |
| 106 | + 'editMsg' => $this->msg( 'edit' )->text() . $this->msg( 'colon-separator' )->text(), |
109 | 107 | ); |
110 | 108 | |
111 | 109 | if ( $formatConf['allowedConfig'] ) |
— | — | @@ -115,7 +113,7 @@ |
116 | 114 | |
117 | 115 | $this->formatConf = $formatConf; |
118 | 116 | |
119 | | - $text = wfMessage( 'configure-old-versions' )->parseAsBlock(); |
| 117 | + $text = $this->msg( 'configure-old-versions' )->parseAsBlock(); |
120 | 118 | if( $this->isUserAllowedInterwiki() ) |
121 | 119 | $text .= $this->getWikiSelectForm(); |
122 | 120 | $text .= $pager->getNavigationBar(); |
— | — | @@ -133,28 +131,28 @@ |
134 | 132 | } |
135 | 133 | |
136 | 134 | public function formatVersionRow( $arr ) { |
137 | | - global $wgLang; |
138 | | - |
139 | 135 | $ts = $arr['timestamp']; |
140 | 136 | $wikis = $arr['wikis']; |
141 | 137 | $c = $arr['count']; |
142 | 138 | $hasSelf = in_array( $this->mWiki, $wikis ); |
143 | 139 | |
144 | 140 | extract( $this->formatConf ); |
145 | | - $datime = $wgLang->timeanddate( $ts ); |
146 | | - $date = $wgLang->date( $ts ); |
147 | | - $time = $wgLang->time( $ts ); |
148 | 141 | |
| 142 | + $lang = $this->getLang(); |
| 143 | + $datime = $lang->timeanddate( $ts ); |
| 144 | + $date = $lang->date( $ts ); |
| 145 | + $time = $lang->time( $ts ); |
| 146 | + |
149 | 147 | ## Make user link... |
150 | 148 | $userLink = ''; |
151 | 149 | if (!$arr['user_wiki'] && !$arr['user_name'] ) { |
152 | 150 | $userLink = ''; # Nothing... |
153 | 151 | $username = ''; |
154 | 152 | } elseif ( $arr['user_wiki'] == wfWikiId() ) { |
155 | | - $userLink = $skin->link( Title::makeTitle( NS_USER, $arr['user_name'] ), htmlspecialchars( $arr['user_name'] ) ); |
| 153 | + $userLink = Linker::link( Title::makeTitle( NS_USER, $arr['user_name'] ), htmlspecialchars( $arr['user_name'] ) ); |
156 | 154 | $username = $arr['user_name']; |
157 | 155 | } elseif ( $wiki = WikiMap::getWiki( $arr['user_wiki'] ) ) { |
158 | | - $userLink = $skin->makeExternalLink( $wiki->getUrl( 'User:'.$arr['user_name'] ), htmlspecialchars( $arr['user_name'].'@'.$arr['user_wiki'] ) ); |
| 156 | + $userLink = Linker::makeExternalLink( $wiki->getUrl( 'User:'.$arr['user_name'] ), htmlspecialchars( $arr['user_name'].'@'.$arr['user_wiki'] ) ); |
159 | 157 | $username = ''; |
160 | 158 | } else { |
161 | 159 | ## Last-ditch |
— | — | @@ -165,16 +163,16 @@ |
166 | 164 | $actions = array(); |
167 | 165 | $view = ''; |
168 | 166 | if ( $hasSelf ) |
169 | | - $view .= $skin->linkKnown( $self, wfMessage( 'configure-view' )->escaped(), array(), array( 'version' => $ts ) ); |
| 167 | + $view .= Linker::linkKnown( $self, $this->msg( 'configure-view' )->escaped(), array(), array( 'version' => $ts ) ); |
170 | 168 | elseif( $allowedAll ) |
171 | | - $view .= wfMessage( 'configure-view' )->escaped(); |
| 169 | + $view .= $this->msg( 'configure-view' )->escaped(); |
172 | 170 | |
173 | 171 | if ( $allowedAll ) { |
174 | 172 | $viewWikis = array(); |
175 | 173 | foreach ( $wikis as $wiki ) { |
176 | | - $viewWikis[] = $skin->linkKnown( $self, htmlspecialchars( $wiki ), array(), array( 'version' => $ts, 'wiki' => $wiki ) ); |
| 174 | + $viewWikis[] = Linker::linkKnown( $self, htmlspecialchars( $wiki ), array(), array( 'version' => $ts, 'wiki' => $wiki ) ); |
177 | 175 | } |
178 | | - $view .= ' (' . $wgLang->commaList( $viewWikis ) . ')'; |
| 176 | + $view .= ' (' . $lang->commaList( $viewWikis ) . ')'; |
179 | 177 | } |
180 | 178 | |
181 | 179 | if( $view ) |
— | — | @@ -183,18 +181,18 @@ |
184 | 182 | $editDone = false; |
185 | 183 | if ( $allowedConfig ) { |
186 | 184 | if ( $hasSelf ) |
187 | | - $editCore = $editMsg . $skin->linkKnown( $configTitle, wfMessage( 'configure-edit-core' )->escaped(), array(), array( 'version' => $ts ) ); |
| 185 | + $editCore = $editMsg . Linker::linkKnown( $configTitle, $this->msg( 'configure-edit-core' )->escaped(), array(), array( 'version' => $ts ) ); |
188 | 186 | elseif( $allowedConfigAll ) |
189 | | - $editCore = $editMsg . wfMessage( 'configure-edit-core' )->escaped(); |
| 187 | + $editCore = $editMsg . $this->msg( 'configure-edit-core' )->escaped(); |
190 | 188 | else |
191 | 189 | $editCore = $editMsg; |
192 | 190 | |
193 | 191 | if ( $allowedConfigAll ) { |
194 | 192 | $viewWikis = array(); |
195 | 193 | foreach ( $wikis as $wiki ) { |
196 | | - $viewWikis[] = $skin->linkKnown( $configTitle, htmlspecialchars( $wiki ), array(), array( 'version' => $ts, 'wiki' => $wiki ) ); |
| 194 | + $viewWikis[] = Linker::linkKnown( $configTitle, htmlspecialchars( $wiki ), array(), array( 'version' => $ts, 'wiki' => $wiki ) ); |
197 | 195 | } |
198 | | - $editCore .= ' (' . $wgLang->commaList( $viewWikis ) . ')'; |
| 196 | + $editCore .= ' (' . $lang->commaList( $viewWikis ) . ')'; |
199 | 197 | } |
200 | 198 | $actions[] = $editCore; |
201 | 199 | } |
— | — | @@ -203,16 +201,16 @@ |
204 | 202 | if ( !$allowedConfig ) |
205 | 203 | $editExt .= $editMsg; |
206 | 204 | if ( $hasSelf ) |
207 | | - $editExt .= $skin->linkKnown( $extTitle, wfMessage( 'configure-edit-ext' )->escaped(), array(), array( 'version' => $ts ) ); |
| 205 | + $editExt .= Linker::linkKnown( $extTitle, $this->msg( 'configure-edit-ext' )->escaped(), array(), array( 'version' => $ts ) ); |
208 | 206 | elseif( $allowedExtensionsAll ) |
209 | | - $editExt .= wfMessage( 'configure-edit-ext' )->escaped(); |
| 207 | + $editExt .= $this->msg( 'configure-edit-ext' )->escaped(); |
210 | 208 | |
211 | 209 | if ( $allowedExtensionsAll ) { |
212 | 210 | $viewWikis = array(); |
213 | 211 | foreach ( $wikis as $wiki ) { |
214 | | - $viewWikis[] = $skin->linkKnown( $extTitle, htmlspecialchars( $wiki ), array(), array( 'version' => $ts, 'wiki' => $wiki ) ); |
| 212 | + $viewWikis[] = Linker::linkKnown( $extTitle, htmlspecialchars( $wiki ), array(), array( 'version' => $ts, 'wiki' => $wiki ) ); |
215 | 213 | } |
216 | | - $editExt .= ' (' . $wgLang->commaList( $viewWikis ) . ')'; |
| 214 | + $editExt .= ' (' . $lang->commaList( $viewWikis ) . ')'; |
217 | 215 | } |
218 | 216 | $actions[] = $editExt; |
219 | 217 | } |
— | — | @@ -227,17 +225,17 @@ |
228 | 226 | array( 'type' => 'radio', 'name' => 'version', 'value' => $ts ), |
229 | 227 | $versionCheck ) ); |
230 | 228 | |
231 | | - $actions[] = $skin->link( $this->getTitle(), wfMessage( 'configure-viewconfig-default-diff' )->escaped(), |
| 229 | + $actions[] = Linker::link( $this->getTitle(), $this->msg( 'configure-viewconfig-default-diff' )->escaped(), |
232 | 230 | array(), array( 'version' => $ts, 'diff' => 'default' ) ); |
233 | 231 | } else { |
234 | 232 | $buttons = ''; |
235 | 233 | } |
236 | 234 | |
237 | | - $comment = $arr['reason'] ? $skin->commentBlock( $arr['reason'] ) : ''; |
| 235 | + $comment = $arr['reason'] ? Linker::commentBlock( $arr['reason'] ) : ''; |
238 | 236 | |
239 | | - $action = $wgLang->commaList( $actions ); |
| 237 | + $action = $lang->commaList( $actions ); |
240 | 238 | |
241 | | - $msg = wfMessage( 'configure-viewconfig-line' )->rawParams( $buttons )->params( |
| 239 | + $msg = $this->msg( 'configure-viewconfig-line' )->rawParams( $buttons )->params( |
242 | 240 | $datime )->rawParams( $userLink, $action, $comment )->params( $date, $time, $username )->parse(); |
243 | 241 | return Xml::tags( 'li', null, $msg )."\n"; |
244 | 242 | } |
— | — | @@ -246,17 +244,17 @@ |
247 | 245 | * Get a form to select the wiki to configure |
248 | 246 | */ |
249 | 247 | protected function getWikiSelectForm() { |
250 | | - global $wgConfigureWikis, $wgScript, $wgRequest; |
| 248 | + global $wgConfigureWikis, $wgScript; |
251 | 249 | if ( $wgConfigureWikis === false || !$this->isUserAllowedInterwiki() ) |
252 | 250 | return ''; |
253 | | - $form = '<fieldset><legend>' . wfMessage( 'configure-select-wiki' )->escaped() . '</legend>'; |
254 | | - $form .= wfMessage( 'configure-select-wiki-view-desc' )->parseAsBlock(); |
| 251 | + $form = '<fieldset><legend>' . $this->msg( 'configure-select-wiki' )->escaped() . '</legend>'; |
| 252 | + $form .= $this->msg( 'configure-select-wiki-view-desc' )->parseAsBlock(); |
255 | 253 | $form .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
256 | 254 | $form .= Html::Hidden( 'title', $this->getTitle()->getPrefixedDBkey() ); |
257 | | - $all = ( $wgRequest->getVal( 'view', 'all' ) == 'all' ); |
258 | | - $form .= Xml::radioLabel( wfMessage( 'configure-select-wiki-view-all' )->text(), 'view', 'all', 'wiki-all', $all ); |
| 255 | + $all = ( $this->getRequest()->getVal( 'view', 'all' ) == 'all' ); |
| 256 | + $form .= Xml::radioLabel( $this->msg( 'configure-select-wiki-view-all' )->text(), 'view', 'all', 'wiki-all', $all ); |
259 | 257 | $form .= "<br />\n"; |
260 | | - $form .= Xml::radioLabel( wfMessage( 'configure-select-wiki-view-specific' )->text(), 'view', 'specific', 'wiki-specific', !$all ) . ' '; |
| 258 | + $form .= Xml::radioLabel( $this->msg( 'configure-select-wiki-view-specific' )->text(), 'view', 'specific', 'wiki-specific', !$all ) . ' '; |
261 | 259 | |
262 | 260 | if ( is_array( $wgConfigureWikis ) ) { |
263 | 261 | $selector = new XmlSelect( 'wiki', 'wiki', $this->mWiki ); |
— | — | @@ -268,7 +266,7 @@ |
269 | 267 | $form .= Xml::input( 'wiki', false, $this->mWiki )."<br />"; |
270 | 268 | } |
271 | 269 | |
272 | | - $form .= Xml::submitButton( wfMessage( 'configure-select-wiki-submit' )->text() ); |
| 270 | + $form .= Xml::submitButton( $this->msg( 'configure-select-wiki-submit' )->text() ); |
273 | 271 | $form .= '</form></fieldset>'; |
274 | 272 | return $form; |
275 | 273 | } |
— | — | @@ -277,11 +275,11 @@ |
278 | 276 | * Taken from PageHistory.php |
279 | 277 | */ |
280 | 278 | protected function getButton() { |
281 | | - return Xml::submitButton( wfMessage( 'compareselectedversions' )->text(), |
| 279 | + return Xml::submitButton( $this->msg( 'compareselectedversions' )->text(), |
282 | 280 | array( |
283 | 281 | 'class' => 'historysubmit', |
284 | | - 'accesskey' => wfMessage( 'accesskey-compareselectedversions' )->text(), |
285 | | - 'title' => wfMessage( 'tooltip-compareselectedversions' )->text(), |
| 282 | + 'accesskey' => $this->msg( 'accesskey-compareselectedversions' )->text(), |
| 283 | + 'title' => $this->msg( 'tooltip-compareselectedversions' )->text(), |
286 | 284 | ) |
287 | 285 | ); |
288 | 286 | } |
Index: trunk/extensions/Configure/specials/SpecialConfigure.php |
— | — | @@ -17,9 +17,9 @@ |
18 | 18 | } |
19 | 19 | |
20 | 20 | protected function doSubmit() { |
21 | | - global $wgConf, $wgOut, $wgConfigureUpdateCacheEpoch, $wgUser, $wgRequest; |
| 21 | + global $wgConf, $wgConfigureUpdateCacheEpoch; |
22 | 22 | |
23 | | - $reason = $wgRequest->getText( 'wpReason' ); |
| 23 | + $reason = $this->getRequest()->getText( 'wpReason' ); |
24 | 24 | $settings = $this->importFromRequest(); |
25 | 25 | |
26 | 26 | ## Add extensions settings, so we don't lose them.. |
— | — | @@ -35,11 +35,11 @@ |
36 | 36 | $settings = $this->removeDefaults( $settings ); |
37 | 37 | if ( $wgConfigureUpdateCacheEpoch ) |
38 | 38 | $settings['wgCacheEpoch'] = max( $settings['wgCacheEpoch'], wfTimestampNow() ); |
39 | | - $ok = $wgConf->saveNewSettings( $settings, $this->mWiki, $reason ); |
| 39 | + $ok = $wgConf->saveNewSettings( $settings, $this->getUser(), $this->mWiki, $reason ); |
40 | 40 | $result = $ok ? 'success' : 'failure'; |
41 | 41 | |
42 | 42 | $url = $this->getTitle()->getLocalURL( "result=$result" ); |
43 | | - $wgOut->redirect( $url ); |
| 43 | + $this->getOutput()->redirect( $url ); |
44 | 44 | } |
45 | 45 | |
46 | 46 | protected function getSettingMask() { |
— | — | @@ -62,13 +62,13 @@ |
63 | 63 | * Show the diff between the current version and the posted version |
64 | 64 | */ |
65 | 65 | protected function showDiff() { |
66 | | - global $wgConf, $wgOut; |
| 66 | + global $wgConf; |
67 | 67 | $wiki = $this->mWiki; |
68 | 68 | $old = array( $wiki => $this->removeDefaults( $wgConf->getCurrent( $wiki ) ) ); |
69 | 69 | $new = array( $wiki => $this->removeDefaults( $this->conf ) ); |
70 | | - $diff = new CorePreviewConfigurationDiff( $old, $new, array( $wiki ) ); |
| 70 | + $diff = new CorePreviewConfigurationDiff( $this->getContext(), $old, $new, array( $wiki ) ); |
71 | 71 | $diff->setViewCallback( array( $this, 'isSettingEditable' ) ); |
72 | | - $wgOut->addHTML( $diff->getHtml() ); |
| 72 | + $this->getOutput()->addHTML( $diff->getHtml() ); |
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
Index: trunk/extensions/Configure/specials/ConfigurationPage.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | -if ( !defined( 'MEDIAWIKI' ) ) die(); |
4 | 3 | |
5 | 4 | /** |
6 | 5 | * Special page allows authorised users to configure the wiki |
— | — | @@ -29,11 +28,12 @@ |
30 | 29 | * @param $par Mixed: parameter passed to the page or null |
31 | 30 | */ |
32 | 31 | public function execute( $par ) { |
33 | | - global $wgUser, $wgRequest, $wgOut, $wgConf, $wgConfigureWikis, $wgLang; |
| 32 | + global $wgConf, $wgConfigureWikis; |
34 | 33 | |
35 | 34 | $this->setHeaders(); |
36 | 35 | |
37 | | - if ( !$this->userCanExecute( $wgUser ) ) { |
| 36 | + $user = $this->getUser(); |
| 37 | + if ( !$this->userCanExecute( $user ) ) { |
38 | 38 | $this->displayRestrictionError(); |
39 | 39 | return; |
40 | 40 | } |
— | — | @@ -41,26 +41,27 @@ |
42 | 42 | // Since efConfigureSetup() should be explicitly called, don't go |
43 | 43 | // further if that function wasn't called |
44 | 44 | if ( !$wgConf instanceof WebConfiguration ) { |
45 | | - $wgOut->wrapWikiMsg( '<div class="errorbox"><strong>$1</strong></div>', 'configure-no-setup' ); |
| 45 | + $this->getOutput()->wrapWikiMsg( '<div class="errorbox"><strong>$1</strong></div>', 'configure-no-setup' ); |
46 | 46 | return; |
47 | 47 | } |
48 | 48 | |
49 | 49 | $ret = $wgConf->doChecks(); |
50 | 50 | if ( count( $ret ) ) { |
51 | | - $wgOut->wrapWikiMsg( '<div class="errorbox"><strong>$1</strong></div>', $ret ); |
| 51 | + $this->getOutput()->wrapWikiMsg( '<div class="errorbox"><strong>$1</strong></div>', $ret ); |
52 | 52 | return; |
53 | 53 | } |
54 | 54 | |
55 | | - $wikiParam = ( $this->mCanEdit && $wgRequest->wasPosted() ) ? 'wpWiki' : 'wiki'; |
56 | | - if ( $wiki = $wgRequest->getVal( $wikiParam, false ) ) { |
| 55 | + $request = $this->getRequest(); |
| 56 | + $wikiParam = ( $this->mCanEdit && $request->wasPosted() ) ? 'wpWiki' : 'wiki'; |
| 57 | + if ( $wiki = $request->getVal( $wikiParam, false ) ) { |
57 | 58 | if ( $wgConf->getWiki() != $wiki ) { |
58 | 59 | if ( !$this->isUserAllowedInterwiki() || $wgConfigureWikis === false ) { |
59 | | - $wgOut->wrapWikiMsg( '<div class="errorbox"><strong>$1</strong></div>', 'configure-no-transwiki' ); |
| 60 | + $this->getOutput()->wrapWikiMsg( '<div class="errorbox"><strong>$1</strong></div>', 'configure-no-transwiki' ); |
60 | 61 | return; |
61 | 62 | } |
62 | 63 | if ( is_array( $wgConfigureWikis ) && !in_array( $wiki, $wgConfigureWikis ) ) { |
63 | | - $wgOut->wrapWikiMsg( '<div class="errorbox"><strong>$1</strong></div>', |
64 | | - array( 'configure-transwiki-not-in-range', $wiki, $wgLang->commaList( $wgConfigureWikis ), count( $wgConfigureWikis ) ) ); |
| 64 | + $this->getOutput()->wrapWikiMsg( '<div class="errorbox"><strong>$1</strong></div>', |
| 65 | + array( 'configure-transwiki-not-in-range', $wiki, $this->getLang()->commaList( $wgConfigureWikis ), count( $wgConfigureWikis ) ) ); |
65 | 66 | return; |
66 | 67 | } |
67 | 68 | } |
— | — | @@ -74,29 +75,29 @@ |
75 | 76 | if ( !$this->getVersion() ) |
76 | 77 | return; |
77 | 78 | |
78 | | - if ( $this->mCanEdit && $wgRequest->wasPosted() ) { |
79 | | - if ( $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { |
80 | | - if ( $wgRequest->getCheck( 'wpSave' ) ) { |
| 79 | + if ( $this->mCanEdit && $request->wasPosted() ) { |
| 80 | + if ( $user->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) { |
| 81 | + if ( $request->getCheck( 'wpSave' ) ) { |
81 | 82 | $type = 'submit'; |
82 | 83 | } else { |
83 | 84 | $type = 'diff'; |
84 | 85 | } |
85 | 86 | } else { |
86 | | - $wgOut->addWikiMsg( 'sessionfailure' ); |
| 87 | + $this->getOutput()->addWikiMsg( 'sessionfailure' ); |
87 | 88 | $type = 'diff'; |
88 | 89 | } |
89 | 90 | } else { |
90 | 91 | $type = 'initial'; |
91 | 92 | } |
92 | 93 | |
93 | | - if ( $result = $wgRequest->getVal( 'result' ) ) { |
| 94 | + if ( $result = $request->getVal( 'result' ) ) { |
94 | 95 | $this->showResult( $result ); |
95 | 96 | return; |
96 | 97 | } |
97 | 98 | |
98 | 99 | switch( $type ) { |
99 | 100 | case 'submit': |
100 | | - if( $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) |
| 101 | + if( $user->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) |
101 | 102 | $this->doSubmit(); |
102 | 103 | else |
103 | 104 | $this->showForm(); |
— | — | @@ -139,8 +140,7 @@ |
140 | 141 | protected function isUserAllowedAll() { |
141 | 142 | static $allowed = null; |
142 | 143 | if ( $allowed === null ) { |
143 | | - global $wgUser; |
144 | | - $allowed = $wgUser->isAllowed( $this->getRestriction() . '-all' ); |
| 144 | + $allowed = $this->getUser()->isAllowed( $this->getRestriction() . '-all' ); |
145 | 145 | } |
146 | 146 | return $allowed; |
147 | 147 | } |
— | — | @@ -152,8 +152,7 @@ |
153 | 153 | protected function isUserAllowedInterwiki() { |
154 | 154 | static $allowed = null; |
155 | 155 | if ( $allowed === null ) { |
156 | | - global $wgUser; |
157 | | - $allowed = $wgUser->isAllowed( $this->getRestriction() . '-interwiki' ); |
| 156 | + $allowed = $this->getUser()->isAllowed( $this->getRestriction() . '-interwiki' ); |
158 | 157 | } |
159 | 158 | return $allowed; |
160 | 159 | } |
— | — | @@ -179,9 +178,8 @@ |
180 | 179 | global $wgConfigureEditRestrictions; |
181 | 180 | if ( !isset( $wgConfigureEditRestrictions[$setting] ) ) |
182 | 181 | return true; |
183 | | - global $wgUser; |
184 | 182 | foreach ( $wgConfigureEditRestrictions[$setting] as $right ) { |
185 | | - if ( !$wgUser->isAllowed( $right ) ) |
| 183 | + if ( !$this->getUser()->isAllowed( $right ) ) |
186 | 184 | return false; |
187 | 185 | } |
188 | 186 | return true; |
— | — | @@ -199,9 +197,8 @@ |
200 | 198 | global $wgConfigureViewRestrictions; |
201 | 199 | if ( !isset( $wgConfigureViewRestrictions[$setting] ) ) |
202 | 200 | return true; |
203 | | - global $wgUser; |
204 | 201 | foreach ( $wgConfigureViewRestrictions[$setting] as $right ) { |
205 | | - if ( !$wgUser->isAllowed( $right ) ) |
| 202 | + if ( !$this->getUser()->isAllowed( $right ) ) |
206 | 203 | return false; |
207 | 204 | } |
208 | 205 | return true; |
— | — | @@ -285,16 +282,15 @@ |
286 | 283 | * Show a 'success' page. |
287 | 284 | */ |
288 | 285 | protected function showResult( $result ) { |
289 | | - global $wgOut, $wgUser; |
290 | 286 | $ok = $result == 'success'; |
291 | 287 | $msg = $ok ? 'configure-saved' : 'configure-error'; |
292 | 288 | $class = $ok ? 'successbox' : 'errorbox'; |
293 | 289 | |
294 | | - $wgOut->wrapWikiMsg( Html::rawElement( 'div', array( 'class' => $class ), '$1' ), $msg ); |
| 290 | + $out = $this->getOutput(); |
| 291 | + $out->wrapWikiMsg( Html::rawElement( 'div', array( 'class' => $class ), '$1' ), $msg ); |
295 | 292 | |
296 | | - $sk = $wgUser->getSkin(); |
297 | | - $linkText = wfMessage( 'configure-backlink' )->parse(); |
298 | | - $wgOut->addHTML( Html::rawElement( 'p', array( 'style' => 'clear:both;' ), $sk->link( $this->getTitle(), $linkText ) ) ); |
| 293 | + $out->addHTML( Html::rawElement( 'p', array( 'style' => 'clear:both;' ), |
| 294 | + Linker::link( $this->getTitle(), $this->msg( 'configure-backlink' )->parse() ) ) ); |
299 | 295 | } |
300 | 296 | |
301 | 297 | /** |
— | — | @@ -308,12 +304,11 @@ |
309 | 305 | * Show "you are editing old version" message |
310 | 306 | */ |
311 | 307 | protected function showOldVersionMessage( $version ) { |
312 | | - global $wgOut, $wgLang; |
313 | | - |
314 | | - $wgOut->addWikiMsg( 'configure-edit-old', |
315 | | - $wgLang->timeanddate( $version ), |
316 | | - $wgLang->date( $version ), |
317 | | - $wgLang->time( $version ) |
| 308 | + $lang = $this->getLang(); |
| 309 | + $this->getOutput()->addWikiMsg( 'configure-edit-old', |
| 310 | + $lang->timeanddate( $version ), |
| 311 | + $lang->date( $version ), |
| 312 | + $lang->time( $version ) |
318 | 313 | ); |
319 | 314 | } |
320 | 315 | |
— | — | @@ -321,9 +316,10 @@ |
322 | 317 | * Get the version |
323 | 318 | */ |
324 | 319 | protected function getVersion() { |
325 | | - global $wgConf, $wgOut, $wgRequest; |
| 320 | + global $wgConf; |
326 | 321 | |
327 | | - if ( $version = $wgRequest->getVal( 'version' ) ) { |
| 322 | + $request = $this->getRequest(); |
| 323 | + if ( $version = $request->getVal( 'version' ) ) { |
328 | 324 | if ( $version == 'default' || $wgConf->versionExists( $version ) ) { |
329 | 325 | if ( $version == 'default' ) { ## Hacky special case. |
330 | 326 | $this->conf = $wgConf->getDefaultsForWiki( $this->mWiki ); |
— | — | @@ -331,7 +327,7 @@ |
332 | 328 | $conf = $wgConf->getOldSettings( $version ); |
333 | 329 | |
334 | 330 | if ( !isset( $conf[$this->mWiki] ) ) { |
335 | | - $wgOut->wrapWikiMsg( '<div class="errorbox">$1</div>', |
| 331 | + $this->getOutput()->wrapWikiMsg( '<div class="errorbox">$1</div>', |
336 | 332 | array( 'configure-old-not-available', $version ) ); |
337 | 333 | return false; |
338 | 334 | } |
— | — | @@ -351,7 +347,7 @@ |
352 | 348 | if ( !$this->showOldVersionMessage( $version ) ) |
353 | 349 | return false; |
354 | 350 | } else { |
355 | | - $wgOut->wrapWikiMsg( '<div class="errorbox">$1</div>', |
| 351 | + $this->getOutput()->wrapWikiMsg( '<div class="errorbox">$1</div>', |
356 | 352 | array( 'configure-old-not-available', $version ) ); |
357 | 353 | return false; |
358 | 354 | } |
— | — | @@ -365,14 +361,14 @@ |
366 | 362 | * Build links to old version of the configuration |
367 | 363 | */ |
368 | 364 | protected function buildOldVersionSelect() { |
369 | | - global $wgConf, $wgLang, $wgUser; |
| 365 | + global $wgConf; |
370 | 366 | |
371 | 367 | $count = 0; |
372 | 368 | $links = array(); |
373 | 369 | |
374 | 370 | $versions = $wgConf->getArchiveVersions( array( 'wiki' => $this->mWiki, 'limit' => 11 ) ); |
375 | | - $skin = $wgUser->getSkin(); |
376 | 371 | $title = $this->getTitle(); |
| 372 | + $lang = $this->getLang(); |
377 | 373 | $prev = null; |
378 | 374 | |
379 | 375 | ksort( $versions ); ## Put in ascending order for now. |
— | — | @@ -380,16 +376,17 @@ |
381 | 377 | foreach ( $versions as $data ) { |
382 | 378 | $ts = $data['timestamp']; |
383 | 379 | $count++; |
384 | | - $datetime = wfMessage( 'configure-old-summary-datetime', |
385 | | - $wgLang->timeanddate( $ts ), |
386 | | - $wgLang->date( $ts ), |
387 | | - $wgLang->time( $ts ) |
| 380 | + $datetime = $this->msg( 'configure-old-summary-datetime', |
| 381 | + $lang->timeanddate( $ts ), |
| 382 | + $lang->date( $ts ), |
| 383 | + $lang->time( $ts ) |
388 | 384 | )->escaped(); |
389 | | - $link = $skin->linkKnown( $title, $datetime, array(), array( 'version' => $ts ) ); |
| 385 | + $link = Linker::linkKnown( $title, $datetime, array(), array( 'version' => $ts ) ); |
390 | 386 | $diffLink = ''; |
391 | | - if ( $prev ) |
392 | | - $diffLink = '(' . $skin->linkKnown( SpecialPage::getTitleFor( 'ViewConfig' ), |
393 | | - wfMessage( 'configure-old-changes' )->escaped(), array(), array( 'version' => $ts, 'diff' => $prev ) ) . ')'; |
| 387 | + if ( $prev ) { |
| 388 | + $diffLink = '(' . Linker::linkKnown( SpecialPage::getTitleFor( 'ViewConfig' ), |
| 389 | + $this->msg( 'configure-old-changes' )->escaped(), array(), array( 'version' => $ts, 'diff' => $prev ) ) . ')'; |
| 390 | + } |
394 | 391 | |
395 | 392 | ## Make user link... |
396 | 393 | $userLink = ''; |
— | — | @@ -397,10 +394,10 @@ |
398 | 395 | $userLink = ''; |
399 | 396 | $username = ''; |
400 | 397 | } elseif ( $data['userwiki'] == wfWikiId() ) { |
401 | | - $userLink = $skin->link( Title::makeTitle( NS_USER, $data['username'] ), htmlspecialchars( $data['username'] ) ); |
| 398 | + $userLink = Linker::link( Title::makeTitle( NS_USER, $data['username'] ), htmlspecialchars( $data['username'] ) ); |
402 | 399 | $username = $data['username']; |
403 | 400 | } elseif ( $wiki = WikiMap::getWiki( $data['userwiki'] ) ) { |
404 | | - $userLink = $skin->makeExternalLink( $wiki->getUrl( 'User:'.$data['username'] ), htmlspecialchars( $data['username'].'@'.$data['userwiki'] ) ); |
| 401 | + $userLink = Linker::makeExternalLink( $wiki->getUrl( 'User:'.$data['username'] ), htmlspecialchars( $data['username'].'@'.$data['userwiki'] ) ); |
405 | 402 | $username = ''; |
406 | 403 | } else { |
407 | 404 | ## Last-ditch |
— | — | @@ -408,9 +405,9 @@ |
409 | 406 | $username = ''; |
410 | 407 | } |
411 | 408 | |
412 | | - $comment = $data['reason'] ? $skin->commentBlock( $data['reason'] ) : ''; |
| 409 | + $comment = $data['reason'] ? Linker::commentBlock( $data['reason'] ) : ''; |
413 | 410 | |
414 | | - $text = wfMessage( 'configure-old-summary' )->rawParams( $link, $userLink, $diffLink, $comment )->params( $username )->parse(); |
| 411 | + $text = $this->msg( 'configure-old-summary' )->rawParams( $link, $userLink, $diffLink, $comment )->params( $username )->parse(); |
415 | 412 | |
416 | 413 | $prev = $ts; |
417 | 414 | |
— | — | @@ -422,18 +419,18 @@ |
423 | 420 | ## Take out the first ten... |
424 | 421 | $links = array_slice( $links, 0, 10 ); |
425 | 422 | |
426 | | - $text = Html::element( 'legend', null, wfMessage( 'configure-old' )->text() ); |
| 423 | + $text = Html::element( 'legend', null, $this->msg( 'configure-old' )->text() ); |
427 | 424 | if ( !count( $links ) ) { |
428 | | - $text .= wfMessage( 'configure-no-old' )->parseAsBlock(); |
| 425 | + $text .= $this->msg( 'configure-no-old' )->parseAsBlock(); |
429 | 426 | } else { |
430 | | - $text .= wfMessage( 'configure-old-versions' )->parseAsBlock(); |
| 427 | + $text .= $this->msg( 'configure-old-versions' )->parseAsBlock(); |
431 | 428 | $text .= "<ul>\n<li>"; |
432 | 429 | $text .= implode( "</li>\n<li>", $links ); |
433 | 430 | $text .= "</li>\n</ul>\n"; |
434 | 431 | } |
435 | 432 | $link = SpecialPage::getTitleFor( 'ViewConfig' ); |
436 | | - $text .= Html::rawElement( 'p', null, $skin->linkKnown( $link, wfMessage( 'configure-view-all-versions' )->escaped() ) ); |
437 | | - $text .= Html::rawElement( 'p', null, $skin->linkKnown( $link, wfMessage( 'configure-view-default' )->escaped(), array(), array( 'version' => 'default' ) ) ); |
| 433 | + $text .= Html::rawElement( 'p', null, Linker::linkKnown( $link, $this->msg( 'configure-view-all-versions' )->escaped() ) ); |
| 434 | + $text .= Html::rawElement( 'p', null, Linker::linkKnown( $link, $this->msg( 'configure-view-default' )->escaped(), array(), array( 'version' => 'default' ) ) ); |
438 | 435 | |
439 | 436 | return Html::rawElement( 'fieldset', null, $text ); |
440 | 437 | } |
— | — | @@ -445,8 +442,8 @@ |
446 | 443 | global $wgConfigureWikis, $wgScript; |
447 | 444 | if ( $wgConfigureWikis === false || !$this->isUserAllowedInterwiki() ) |
448 | 445 | return ''; |
449 | | - $form = Html::element( 'legend', null, wfMessage( 'configure-select-wiki' )->text() ); |
450 | | - $form .= wfMessage( 'configure-select-wiki-desc' )->parseAsBlock(); |
| 446 | + $form = Html::element( 'legend', null, $this->msg( 'configure-select-wiki' )->text() ); |
| 447 | + $form .= $this->msg( 'configure-select-wiki-desc' )->parseAsBlock(); |
451 | 448 | $form .= Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
452 | 449 | $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ); |
453 | 450 | if ( is_array( $wgConfigureWikis ) ) { |
— | — | @@ -458,7 +455,7 @@ |
459 | 456 | } else { |
460 | 457 | $form .= Html::input( 'wiki', $this->mWiki, 'text' ) . ' '; |
461 | 458 | } |
462 | | - $form .= Html::input( null, wfMessage( 'configure-select-wiki-submit' )->text(), 'submit' ); |
| 459 | + $form .= Html::input( null, $this->msg( 'configure-select-wiki-submit' )->text(), 'submit' ); |
463 | 460 | $form .= Html::closeElement( 'form' ); |
464 | 461 | return Html::rawElement( 'fieldset', null, $form ); |
465 | 462 | } |
— | — | @@ -469,9 +466,10 @@ |
470 | 467 | * @return array |
471 | 468 | */ |
472 | 469 | protected function importFromRequest() { |
473 | | - global $wgRequest; |
| 470 | + global $wgContLang; |
474 | 471 | |
475 | | - if ( !$this->mCanEdit || !$wgRequest->wasPosted() ) |
| 472 | + $request = $this->getRequest(); |
| 473 | + if ( !$this->mCanEdit || !$request->wasPosted() ) |
476 | 474 | return array(); |
477 | 475 | |
478 | 476 | $settings = array(); |
— | — | @@ -487,7 +485,7 @@ |
488 | 486 | $arrType = $this->getArrayType( $name ); |
489 | 487 | switch( $arrType ) { |
490 | 488 | case 'simple': |
491 | | - $text = rtrim($wgRequest->getText( 'wp' . $name )); |
| 489 | + $text = rtrim( $request->getText( 'wp' . $name ) ); |
492 | 490 | if ( $text == '' ) |
493 | 491 | $arr = array(); |
494 | 492 | else |
— | — | @@ -509,7 +507,7 @@ |
510 | 508 | $settings[$name] = $arr; |
511 | 509 | break; |
512 | 510 | case 'simple-dual': |
513 | | - $text = $wgRequest->getText( 'wp' . $name ); |
| 511 | + $text = $request->getText( 'wp' . $name ); |
514 | 512 | if ( $text == '' ) { |
515 | 513 | $arr = array(); |
516 | 514 | } else { |
— | — | @@ -523,37 +521,33 @@ |
524 | 522 | $settings[$name] = $arr; |
525 | 523 | break; |
526 | 524 | case 'ns-bool': |
527 | | - global $wgContLang; |
528 | 525 | $arr = array(); |
529 | 526 | foreach ( $wgContLang->getNamespaces() as $ns => $unused ) { |
530 | | - $arr[$ns] = $wgRequest->getCheck( 'wp' . $name . '-ns' . strval( $ns ) ); |
| 527 | + $arr[$ns] = $request->getCheck( 'wp' . $name . '-ns' . strval( $ns ) ); |
531 | 528 | } |
532 | 529 | $settings[$name] = $arr; |
533 | 530 | break; |
534 | 531 | case 'ns-text': |
535 | | - global $wgContLang; |
536 | 532 | $arr = array(); |
537 | 533 | foreach ( $wgContLang->getNamespaces() as $ns => $unused ) { |
538 | | - $arr[$ns] = $wgRequest->getVal( 'wp' . $name . '-ns' . strval( $ns ) ); |
| 534 | + $arr[$ns] = $request->getVal( 'wp' . $name . '-ns' . strval( $ns ) ); |
539 | 535 | } |
540 | 536 | $settings[$name] = $arr; |
541 | 537 | break; |
542 | 538 | case 'ns-simple': |
543 | | - global $wgContLang; |
544 | 539 | $arr = array(); |
545 | 540 | foreach ( $wgContLang->getNamespaces() as $ns => $unused ) { |
546 | | - if ( $wgRequest->getCheck( 'wp' . $name . '-ns' . strval( $ns ) ) ) |
| 541 | + if ( $request->getCheck( 'wp' . $name . '-ns' . strval( $ns ) ) ) |
547 | 542 | $arr[] = $ns; |
548 | 543 | } |
549 | 544 | $settings[$name] = $arr; |
550 | 545 | break; |
551 | 546 | case 'ns-array': |
552 | | - global $wgContLang; |
553 | 547 | $arr = array(); |
554 | 548 | foreach ( $wgContLang->getNamespaces() as $ns => $unused ) { |
555 | 549 | if ( $ns < 0 ) |
556 | 550 | continue; |
557 | | - $text = rtrim($wgRequest->getText( 'wp' . $name . '-ns' . strval( $ns ) ) ); |
| 551 | + $text = rtrim( $request->getText( 'wp' . $name . '-ns' . strval( $ns ) ) ); |
558 | 552 | if ( $text == '' ) |
559 | 553 | $nsProtection = array(); |
560 | 554 | else |
— | — | @@ -566,7 +560,7 @@ |
567 | 561 | case 'group-array': |
568 | 562 | $all = array(); |
569 | 563 | if ( isset( $_REQUEST['wp' . $name . '-vals'] ) ) { |
570 | | - $iter = explode( "\n", trim($wgRequest->getText( 'wp' . $name . '-vals' ) ) ); |
| 564 | + $iter = explode( "\n", trim( $request->getText( 'wp' . $name . '-vals' ) ) ); |
571 | 565 | foreach ( $iter as &$group ) { |
572 | 566 | // Our own Sanitizer::unescapeId() :) |
573 | 567 | $group = urldecode( str_replace( array( '.', "\r" ), array( '%', '' ), |
— | — | @@ -587,14 +581,14 @@ |
588 | 582 | if ( $arrType == 'group-bool' ) { |
589 | 583 | $encId = Sanitizer::escapeId( $id ); |
590 | 584 | if ( $id != $encId ) { |
591 | | - $val = $wgRequest->getCheck( str_replace( '.', '_', $encId ) ) || |
592 | | - $wgRequest->getCheck( $encId ) || $wgRequest->getCheck( $id ); |
| 585 | + $val = $request->getCheck( str_replace( '.', '_', $encId ) ) || |
| 586 | + $request->getCheck( $encId ) || $request->getCheck( $id ); |
593 | 587 | } else { |
594 | | - $val = $wgRequest->getCheck( $id ); |
| 588 | + $val = $request->getCheck( $id ); |
595 | 589 | } |
596 | 590 | if ( $val ) |
597 | 591 | $settings[$name][$group][$right] = true; |
598 | | - } elseif ( $wgRequest->getCheck( $id ) ) { |
| 592 | + } elseif ( $request->getCheck( $id ) ) { |
599 | 593 | $settings[$name][$group][] = $right; |
600 | 594 | } |
601 | 595 | } |
— | — | @@ -610,8 +604,8 @@ |
611 | 605 | foreach( $validActions as $action ) { |
612 | 606 | $all[$action] = array(); |
613 | 607 | foreach( $validGroups as $group ) { |
614 | | - $count = $wgRequest->getIntOrNull( "wp$name-key-$action-$group-count" ); |
615 | | - $period = $wgRequest->getIntOrNull( "wp$name-key-$action-$group-period" ); |
| 608 | + $count = $request->getIntOrNull( "wp$name-key-$action-$group-count" ); |
| 609 | + $period = $request->getIntOrNull( "wp$name-key-$action-$group-period" ); |
616 | 610 | |
617 | 611 | if ($count && $period) { |
618 | 612 | $all[$action][$group] = array( $count, $period ); |
— | — | @@ -630,7 +624,7 @@ |
631 | 625 | APCOND_AGE_FROM_EDIT => 'int' ); |
632 | 626 | |
633 | 627 | if ( isset( $_REQUEST['wp' . $name . '-vals'] ) ) { |
634 | | - $groups = explode( "\n", trim( $wgRequest->getText( 'wp' . $name . '-vals' ) ) ); |
| 628 | + $groups = explode( "\n", trim( $request->getText( 'wp' . $name . '-vals' ) ) ); |
635 | 629 | foreach ( $groups as &$group ) { |
636 | 630 | // Our own Sanitizer::unescapeId() :) |
637 | 631 | $group = urldecode( str_replace( array( '.', "\r" ), array( '%', '' ), |
— | — | @@ -642,7 +636,7 @@ |
643 | 637 | } |
644 | 638 | |
645 | 639 | foreach( $groups as $group ) { |
646 | | - $op = $wgRequest->getText( 'wp' . $name . '-' . $group . '-opt' ); |
| 640 | + $op = $request->getText( 'wp' . $name . '-' . $group . '-opt' ); |
647 | 641 | if ( empty( $op ) ) { |
648 | 642 | $op = 'and'; |
649 | 643 | } |
— | — | @@ -655,22 +649,22 @@ |
656 | 650 | foreach ( $conds as $condName => $condType ) { |
657 | 651 | switch( $condType ) { |
658 | 652 | case 'bool': |
659 | | - $val = $wgRequest->getCheck( 'wp' . $name . '-' . $group . '-cond-' . $condName ); |
| 653 | + $val = $request->getCheck( 'wp' . $name . '-' . $group . '-cond-' . $condName ); |
660 | 654 | if( $val ) |
661 | 655 | $condsVal[] = array( $condName ); |
662 | 656 | break; |
663 | 657 | case 'int': |
664 | | - $val = $wgRequest->getInt( 'wp' . $name . '-' . $group . '-cond-' . $condName ); |
| 658 | + $val = $request->getInt( 'wp' . $name . '-' . $group . '-cond-' . $condName ); |
665 | 659 | if( $val ) |
666 | 660 | $condsVal[] = array( $condName, $val ); |
667 | 661 | break; |
668 | 662 | case 'text': |
669 | | - $val = $wgRequest->getVal( 'wp' . $name . '-' . $group . '-cond-' . $condName ); |
| 663 | + $val = $request->getVal( 'wp' . $name . '-' . $group . '-cond-' . $condName ); |
670 | 664 | if( $val ) |
671 | 665 | $condsVal[] = array( $condName, $val ); |
672 | 666 | break; |
673 | 667 | case 'array': |
674 | | - $val = trim( $wgRequest->getText( 'wp' . $name . '-' . $group . '-cond-' . $condName ) ); |
| 668 | + $val = trim( $request->getText( 'wp' . $name . '-' . $group . '-cond-' . $condName ) ); |
675 | 669 | if( !$val ) |
676 | 670 | break; |
677 | 671 | $val = array_map( 'trim', explode( "\n", $val ) ); |
— | — | @@ -694,7 +688,7 @@ |
695 | 689 | case 'text': |
696 | 690 | case 'lang': |
697 | 691 | case 'image-url': |
698 | | - $setting = $wgRequest->getVal( 'wp' . $name ); |
| 692 | + $setting = $request->getVal( 'wp' . $name ); |
699 | 693 | |
700 | 694 | if ( $file = wfFindFile( $setting ) ) { |
701 | 695 | ## It's actually a local file. |
— | — | @@ -705,14 +699,14 @@ |
706 | 700 | |
707 | 701 | break; |
708 | 702 | case 'int': |
709 | | - $settings[$name] = $wgRequest->getInt( 'wp' . $name ); |
| 703 | + $settings[$name] = $request->getInt( 'wp' . $name ); |
710 | 704 | break; |
711 | 705 | case 'bool': |
712 | | - $settings[$name] = $wgRequest->getCheck( 'wp' . $name ); |
| 706 | + $settings[$name] = $request->getCheck( 'wp' . $name ); |
713 | 707 | break; |
714 | 708 | default: |
715 | 709 | if ( is_array( $type ) ) { |
716 | | - $val = $wgRequest->getVal( 'wp' . $name ); |
| 710 | + $val = $request->getVal( 'wp' . $name ); |
717 | 711 | if ( !array_key_exists( $val, $type ) && $val !== null ) { |
718 | 712 | $perm = implode( ', ', $type ); |
719 | 713 | throw new MWException( "Value for \$$name setting is not in permitted (given: $val, permitted: $perm)" ); |
— | — | @@ -841,17 +835,11 @@ |
842 | 836 | * Show the main form |
843 | 837 | */ |
844 | 838 | protected function showForm() { |
845 | | - global $wgOut, $wgUser, $wgRequest; |
846 | | - |
847 | | - $action = $this->getTitle()->getLocalURL(); |
848 | | - |
849 | | - $reason = $wgRequest->getText( 'wpReason' ); |
850 | | - |
851 | | - $wgOut->addHTML( |
| 839 | + $this->getOutput()->addHTML( |
852 | 840 | ( $this->mCanEdit ? |
853 | 841 | $this->getWikiSelectForm() . |
854 | | - Html::openElement( 'form', array( 'method' => 'post', 'action' => $action, |
855 | | - 'id' => 'configure-form' ) ) . "\n" : |
| 842 | + Html::openElement( 'form', array( 'method' => 'post', |
| 843 | + 'action' => $this->getTitle()->getLocalURL(), 'id' => 'configure-form' ) ) . "\n" : |
856 | 844 | Html::openElement( 'div', array( 'id' => 'configure-form' ) ) |
857 | 845 | ) . |
858 | 846 | $this->buildOldVersionSelect() . "\n" . |
— | — | @@ -859,15 +847,15 @@ |
860 | 848 | Html::openElement( 'div', array( 'id' => 'configure' ) ) . "\n" . |
861 | 849 | $this->buildAllSettings() . "\n" . |
862 | 850 | ( $this->mCanEdit ? |
863 | | - wfMessage( 'configure-form-reason' )->text() . ' ' . Html::input( 'wpReason', $reason, 'text', array( 'size' => 45 ) ) . "\n" . |
| 851 | + $this->msg( 'configure-form-reason' )->text() . ' ' . Html::input( 'wpReason', |
| 852 | + $this->getRequest()->getText( 'wpReason' ), 'text', array( 'size' => 45 ) ) . "\n" . |
864 | 853 | Html::openElement( 'div', array( 'id' => 'prefsubmit' ) ) . "\n" . |
865 | 854 | Html::openElement( 'div', array() ) . "\n" . |
866 | | - Html::hidden( 'wpEditToken', $wgUser->editToken() ) . "\n" . |
867 | | - Html::input( 'wpSave', wfMessage( 'configure-btn-save' )->text(), 'submit', array( 'class' => 'btnSavePrefs' ) ) . "\n" . |
868 | | - Html::input( 'wpPreview', wfMessage( 'showdiff' )->text(), 'submit' ) . "\n" . |
| 855 | + Html::input( 'wpSave', $this->msg( 'configure-btn-save' )->text(), 'submit', array( 'class' => 'btnSavePrefs' ) ) . "\n" . |
| 856 | + Html::input( 'wpPreview', $this->msg( 'showdiff' )->text(), 'submit' ) . "\n" . |
869 | 857 | Html::closeElement( 'div' ) . "\n" . |
870 | 858 | Html::closeElement( 'div' ) . "\n" . |
871 | | - Html::hidden( 'wpEditToken', $wgUser->editToken() ) . "\n" . |
| 859 | + Html::hidden( 'wpEditToken', $this->getUser()->editToken() ) . "\n" . |
872 | 860 | ( $this->mWiki ? Html::hidden( 'wpWiki', $this->mWiki ) . "\n" : '' ) |
873 | 861 | : '' |
874 | 862 | ) . |
— | — | @@ -879,9 +867,9 @@ |
880 | 868 | |
881 | 869 | /** Show a hidden-by-default search form */ |
882 | 870 | protected function buildSearchForm() { |
883 | | - $input = wfMessage( 'configure-js-search-prompt' )->parse() . wfMessage( 'word-separator' )->escaped() . |
| 871 | + $input = $this->msg( 'configure-js-search-prompt' )->parse() . $this->msg( 'word-separator' )->escaped() . |
884 | 872 | Html::element( 'input', array( 'id' => 'configure-search-input', 'size' => 45 ), null ); |
885 | | - $form = Html::element( 'legend', null, wfMessage( 'configure-js-search-legend' )->text() ) . Html::rawElement( 'p', null, $input ) . "\n" . |
| 873 | + $form = Html::element( 'legend', null, $this->msg( 'configure-js-search-legend' )->text() ) . Html::rawElement( 'p', null, $input ) . "\n" . |
886 | 874 | Html::openElement( 'ul', array( 'id' => 'configure-search-results' ) ) . Html::closeElement( 'ul' ); |
887 | 875 | $form = Html::rawElement( 'fieldset', array( 'style' => 'display: none;', 'id' => 'configure-search-form' ), $form ); |
888 | 876 | return $form; |
— | — | @@ -891,9 +879,7 @@ |
892 | 880 | * Inject JavaScripts and Stylesheets in page output |
893 | 881 | */ |
894 | 882 | protected function injectScriptsAndStyles() { |
895 | | - global $wgOut; |
896 | | - |
897 | | - $wgOut->addModules( 'ext.configure' ); |
| 883 | + $this->getOutput()->addModules( 'ext.configure' ); |
898 | 884 | } |
899 | 885 | |
900 | 886 | /** |
— | — | @@ -903,7 +889,7 @@ |
904 | 890 | * @return String xhtml fragment |
905 | 891 | */ |
906 | 892 | protected function buildTableHeading( $msg ) { |
907 | | - $msgObj = wfMessage( 'configure-section-' . $msg ); |
| 893 | + $msgObj = $this->msg( 'configure-section-' . $msg ); |
908 | 894 | if ( $msgObj->exists() ) { |
909 | 895 | $msgVal = $msgObj->parse(); |
910 | 896 | } else { |
— | — | @@ -922,7 +908,7 @@ |
923 | 909 | protected function buildInput( $conf, $params = array() ) { |
924 | 910 | $read = isset( $params['read'] ) ? $params['read'] : $this->userCanRead( $conf ); |
925 | 911 | if ( !$read ) |
926 | | - return Html::rawElement( 'span', array( 'class' => 'disabled' ), wfMessage( 'configure-view-not-allowed' )->parse() ); |
| 912 | + return Html::rawElement( 'span', array( 'class' => 'disabled' ), $this->msg( 'configure-view-not-allowed' )->parse() ); |
927 | 913 | $allowed = isset( $params['edit'] ) ? $params['edit'] : $this->userCanEdit( $conf ); |
928 | 914 | $type = isset( $params['type'] ) ? $params['type'] : $this->getSettingType( $conf ); |
929 | 915 | $default = isset( $params['value'] ) ? $params['value'] : $this->getSettingValue( $conf ); |
— | — | @@ -934,7 +920,7 @@ |
935 | 921 | if ( $type == 'image-url' ) { |
936 | 922 | if ( !$allowed ) |
937 | 923 | return '<code>' . htmlspecialchars( (string)$default ) . '</code>'; |
938 | | - return wfMessage( 'configure-image-url-explanation' )->parse() . '<br />' . |
| 924 | + return $this->msg( 'configure-image-url-explanation' )->parse() . '<br />' . |
939 | 925 | Html::element( 'input', array( 'name' => "wp$conf", 'size' => 45, 'value' => (string)$default, |
940 | 926 | 'class' => 'image-selector', 'id' => 'image-url-textbox-' . $conf ) |
941 | 927 | ) . ' ' . |
— | — | @@ -944,7 +930,7 @@ |
945 | 931 | if ( !$allowed ) |
946 | 932 | return '<code>' . ( $default ? 'true' : 'false' ) . '</code>'; |
947 | 933 | $attribs = array( 'type' => 'checkbox', 'name' => "wp$conf", 'value' => '1' ); |
948 | | - if ( $allowed ) { |
| 934 | + if ( $default ) { |
949 | 935 | $attribs['checked'] = 'checked'; |
950 | 936 | } |
951 | 937 | return Html::element( 'input', $attribs ); |
— | — | @@ -1014,7 +1000,7 @@ |
1015 | 1001 | htmlspecialchars( ( is_array( $default ) ? implode( "\n", $default ) : $default ) ) . |
1016 | 1002 | "\n</pre>"; |
1017 | 1003 | } |
1018 | | - $text = wfMessage( 'configure-arrayinput-oneperline' )->parse(); |
| 1004 | + $text = $this->msg( 'configure-arrayinput-oneperline' )->parse(); |
1019 | 1005 | $text .= Html::textarea( "wp{$conf}", is_array( $default ) ? implode( "\n", $default ) : '', |
1020 | 1006 | array( 'id' => "wp{$conf}", 'rows' => 8, 'style' => 'width:95%;' ) ); |
1021 | 1007 | return $text; |
— | — | @@ -1022,18 +1008,18 @@ |
1023 | 1009 | if ( $type == 'assoc' ) { |
1024 | 1010 | ## See if the key/value has a special description |
1025 | 1011 | |
1026 | | - $keydescmsg = wfMessage( "configure-setting-$conf-key" ); |
| 1012 | + $keydescmsg = $this->msg( "configure-setting-$conf-key" ); |
1027 | 1013 | if ( $keydescmsg->exists() ) { |
1028 | 1014 | $keydesc = $keydescmsg->parse(); |
1029 | 1015 | } else { |
1030 | | - $keydesc = wfMessage( 'configure-desc-key' )->escaped(); |
| 1016 | + $keydesc = $this->msg( 'configure-desc-key' )->escaped(); |
1031 | 1017 | } |
1032 | 1018 | |
1033 | | - $valdescmsg = wfMessage( "configure-setting-$conf-value" ); |
| 1019 | + $valdescmsg = $this->msg( "configure-setting-$conf-value" ); |
1034 | 1020 | if ( $valdescmsg->exists() ) { |
1035 | 1021 | $valdesc = $valdescmsg->parse(); |
1036 | 1022 | } else { |
1037 | | - $valdesc = wfMessage( 'configure-desc-val' )->escaped(); |
| 1023 | + $valdesc = $this->msg( 'configure-desc-val' )->escaped(); |
1038 | 1024 | } |
1039 | 1025 | |
1040 | 1026 | $classes = array( 'configure-array-table', 'assoc' ); |
— | — | @@ -1093,18 +1079,18 @@ |
1094 | 1080 | return $text; |
1095 | 1081 | } |
1096 | 1082 | if ( $type == 'rate-limits' ) { ## Some of this is stolen from assoc, since it's an assoc with an assoc. |
1097 | | - $keydescmsg = wfMessage( "configure-setting-$conf-key" ); |
| 1083 | + $keydescmsg = $this->msg( "configure-setting-$conf-key" ); |
1098 | 1084 | if ( $keydescmsg->exists() ) { |
1099 | 1085 | $keydesc = $keydescmsg->parse(); |
1100 | 1086 | } else { |
1101 | | - $keydesc = wfMessage( 'configure-desc-key' )->escaped(); |
| 1087 | + $keydesc = $this->msg( 'configure-desc-key' )->escaped(); |
1102 | 1088 | } |
1103 | 1089 | |
1104 | | - $valdescmsg = wfMessage( "configure-setting-$conf-value" ); |
| 1090 | + $valdescmsg = $this->msg( "configure-setting-$conf-value" ); |
1105 | 1091 | if ( $valdescmsg->exists() ) { |
1106 | 1092 | $valdesc = $valdescmsg->parse(); |
1107 | 1093 | } else { |
1108 | | - $valdesc = wfMessage( 'configure-desc-val' )->escaped(); |
| 1094 | + $valdesc = $this->msg( 'configure-desc-val' )->escaped(); |
1109 | 1095 | } |
1110 | 1096 | |
1111 | 1097 | $classes = array( 'configure-array-table', 'configure-rate-limits' ); |
— | — | @@ -1123,11 +1109,11 @@ |
1124 | 1110 | if ( isset( $default[$action] ) ) |
1125 | 1111 | $val = $default[$action]; |
1126 | 1112 | |
1127 | | - $key = Html::rawElement( 'td', array(), wfMessage( "configure-throttle-action-$action" )->parse() ); |
| 1113 | + $key = Html::rawElement( 'td', array(), $this->msg( "configure-throttle-action-$action" )->parse() ); |
1128 | 1114 | |
1129 | 1115 | ## Build YET ANOTHER ASSOC TABLE ARGH! |
1130 | | - $innerRows = Html::rawElement( 'tr', array(), Html::rawElement( 'th', array(), wfMessage( 'configure-throttle-group' )->parse() ) . ' ' . |
1131 | | - Html::rawElement( 'th', array(), wfMessage( 'configure-throttle-limit' )->parse() ) )."\n"; |
| 1116 | + $innerRows = Html::rawElement( 'tr', array(), Html::rawElement( 'th', array(), $this->msg( 'configure-throttle-group' )->parse() ) . ' ' . |
| 1117 | + Html::rawElement( 'th', array(), $this->msg( 'configure-throttle-limit' )->parse() ) )."\n"; |
1132 | 1118 | foreach( $validGroups as $type ) { |
1133 | 1119 | $limits = null; |
1134 | 1120 | if ( isset( $default[$action][$type] ) ) |
— | — | @@ -1138,16 +1124,16 @@ |
1139 | 1125 | $count = $period = 0; |
1140 | 1126 | |
1141 | 1127 | $id = 'wp'.$conf.'-key-'.$action.'-'.$type; |
1142 | | - $left_col = Html::rawElement( 'td', array(), wfMessage( "configure-throttle-group-$type" )->parse() ); |
| 1128 | + $left_col = Html::rawElement( 'td', array(), $this->msg( "configure-throttle-group-$type" )->parse() ); |
1143 | 1129 | |
1144 | 1130 | if ( $allowed ) { |
1145 | | - $right_col = Html::element( 'label', array( 'for' => "$id-count" ), wfMessage( 'configure-throttle-count' )->text() ) . |
| 1131 | + $right_col = Html::element( 'label', array( 'for' => "$id-count" ), $this->msg( 'configure-throttle-count' )->text() ) . |
1146 | 1132 | ' ' . Html::input( "$id-count", $count, 'text', array( 'name' => "$id-count", 'size' => 15 ) ) . |
1147 | 1133 | Html::element( 'br' ) . |
1148 | | - Html::element( 'label', array( 'for' => "$id-period" ), wfMessage( 'configure-throttle-period' )->text() ) . |
| 1134 | + Html::element( 'label', array( 'for' => "$id-period" ), $this->msg( 'configure-throttle-period' )->text() ) . |
1149 | 1135 | ' ' . Html::input( "$id-period", $period, 'text', array( 'name' => "$id-period", 'size' => 15 ) ); |
1150 | 1136 | } else { |
1151 | | - $right_col = ($count && $period) ? wfMessage( 'configure-throttle-summary', $count, $period )->text() : wfMessage( 'configure-throttle-none' )->text(); |
| 1137 | + $right_col = ($count && $period) ? $this->msg( 'configure-throttle-summary', $count, $period )->text() : $this->msg( 'configure-throttle-none' )->text(); |
1152 | 1138 | ## Laziness: Make summaries work by putting the data in hidden fields, rather than a special case in JS. |
1153 | 1139 | $right_col .= "\n" . Html::hidden( "$id-count", $count, array( 'id' => "$id-count" ) ) . Html::hidden( "$id-period", $period, array( 'id' => "$id-period" ) ); |
1154 | 1140 | } |
— | — | @@ -1185,7 +1171,7 @@ |
1186 | 1172 | foreach ( $wgContLang->getNamespaces() as $ns => $name ) { |
1187 | 1173 | $name = str_replace( '_', ' ', $name ); |
1188 | 1174 | if ( '' == $name ) { |
1189 | | - $name = wfMessage( 'blanknamespace' )->parse(); |
| 1175 | + $name = $this->msg( 'blanknamespace' )->parse(); |
1190 | 1176 | } |
1191 | 1177 | if ( $type == 'ns-bool' ) { |
1192 | 1178 | $checked = isset( $default[$ns] ) && $default[$ns]; |
— | — | @@ -1211,12 +1197,12 @@ |
1212 | 1198 | } |
1213 | 1199 | if ( $type == 'ns-text' ) { |
1214 | 1200 | global $wgContLang; |
1215 | | - $nsdesc = wfMessage( 'configure-desc-ns' )->escaped(); |
1216 | | - $valdescmsg = wfMessage( "configure-setting-$conf-value" ); |
| 1201 | + $nsdesc = $this->msg( 'configure-desc-ns' )->escaped(); |
| 1202 | + $valdescmsg = $this->msg( "configure-setting-$conf-value" ); |
1217 | 1203 | if ( $valdescmsg->exists() ) { |
1218 | 1204 | $valdesc = $valdescmsg->parse(); |
1219 | 1205 | } else { |
1220 | | - $valdesc = wfMessage( 'configure-desc-val' )->escaped(); |
| 1206 | + $valdesc = $this->msg( 'configure-desc-val' )->escaped(); |
1221 | 1207 | } |
1222 | 1208 | |
1223 | 1209 | $text = Html::openElement( 'table', array( 'class' => 'configure-array-table ns-text configure-biglist' ) ) . "\n" . |
— | — | @@ -1224,7 +1210,7 @@ |
1225 | 1211 | foreach ( $wgContLang->getNamespaces() as $ns => $name ) { |
1226 | 1212 | $name = str_replace( '_', ' ', $name ); |
1227 | 1213 | if ( '' == $name ) { |
1228 | | - $name = wfMessage( 'blanknamespace' )->parse(); |
| 1214 | + $name = $this->msg( 'blanknamespace' )->parse(); |
1229 | 1215 | } |
1230 | 1216 | $text .= Html::openElement( 'tr', array() ) . Html::rawElement( 'td', array(), $name ) . Html::openElement( 'td', array() ); |
1231 | 1217 | if ( $allowed ) |
— | — | @@ -1242,12 +1228,12 @@ |
1243 | 1229 | } |
1244 | 1230 | if ( $type == 'ns-array' ) { |
1245 | 1231 | global $wgContLang; |
1246 | | - $nsdesc = wfMessage( 'configure-desc-ns' )->escaped(); |
1247 | | - $valdescmsg = wfMessage( "configure-setting-$conf-value" ); |
| 1232 | + $nsdesc = $this->msg( 'configure-desc-ns' )->escaped(); |
| 1233 | + $valdescmsg = $this->msg( "configure-setting-$conf-value" ); |
1248 | 1234 | if ( $valdescmsg->exists() ) { |
1249 | 1235 | $valdesc = $valdescmsg->parse(); |
1250 | 1236 | } else { |
1251 | | - $valdesc = wfMessage( 'configure-desc-val' )->escaped(); |
| 1237 | + $valdesc = $this->msg( 'configure-desc-val' )->escaped(); |
1252 | 1238 | } |
1253 | 1239 | |
1254 | 1240 | $text = Html::openElement( 'table', array( 'class' => 'ns-array configure-biglist configure-array-table' ) ) . "\n" . |
— | — | @@ -1257,7 +1243,7 @@ |
1258 | 1244 | continue; |
1259 | 1245 | $name = str_replace( '_', ' ', $name ); |
1260 | 1246 | if ( '' == $name ) { |
1261 | | - $name = wfMessage( 'blanknamespace' )->parse(); |
| 1247 | + $name = $this->msg( 'blanknamespace' )->parse(); |
1262 | 1248 | } |
1263 | 1249 | $text .= Html::openElement( 'tr' ) . Html::rawElement( 'td', array(), |
1264 | 1250 | Html::rawElement( 'label', array( 'for' => "wp{$conf}-ns{$ns}" ), $name ) ) . Html::openElement( 'td' ); |
— | — | @@ -1298,12 +1284,12 @@ |
1299 | 1285 | $all = array_diff( $all, $this->getSettingValue( 'wgImplicitGroups' ) ); |
1300 | 1286 | } |
1301 | 1287 | sort( $all ); |
1302 | | - $groupdesc = wfMessage( 'configure-desc-group' )->escaped(); |
1303 | | - $valdescmsg = wfMessage( "configure-setting-$conf-value" ); |
| 1288 | + $groupdesc = $this->msg( 'configure-desc-group' )->escaped(); |
| 1289 | + $valdescmsg = $this->msg( "configure-setting-$conf-value" ); |
1304 | 1290 | if ( $valdescmsg->exists() ) { |
1305 | 1291 | $valdesc = $valdescmsg->parse(); |
1306 | 1292 | } else { |
1307 | | - $valdesc = wfMessage( 'configure-desc-val' )->escaped(); |
| 1293 | + $valdesc = $this->msg( 'configure-desc-val' )->escaped(); |
1308 | 1294 | } |
1309 | 1295 | |
1310 | 1296 | $classes = "{$type} configure-array-table" . ( $type == 'group-bool' ? ' ajax-group' : '' ); |
— | — | @@ -1323,12 +1309,12 @@ |
1324 | 1310 | } |
1325 | 1311 | if ( $type == 'promotion-conds' ) { |
1326 | 1312 | |
1327 | | - $groupdesc = wfMessage( 'configure-desc-group' )->escaped(); |
1328 | | - $valdescmsg = wfMessage( "configure-setting-$conf-value" ); |
| 1313 | + $groupdesc = $this->msg( 'configure-desc-group' )->escaped(); |
| 1314 | + $valdescmsg = $this->msg( "configure-setting-$conf-value" ); |
1329 | 1315 | if ( $valdescmsg->exists() ) { |
1330 | 1316 | $valdesc = $valdescmsg->parse(); |
1331 | 1317 | } else { |
1332 | | - $valdesc = wfMessage( 'configure-desc-val' )->escaped(); |
| 1318 | + $valdesc = $this->msg( 'configure-desc-val' )->escaped(); |
1333 | 1319 | } |
1334 | 1320 | |
1335 | 1321 | $text = Html::openElement( 'table', array( 'id' => $conf, 'class' => "{$type} configure-array-table ajax-group" ) ) ."\n"; |
— | — | @@ -1504,7 +1490,7 @@ |
1505 | 1491 | $link = $rawVal; |
1506 | 1492 | } |
1507 | 1493 | |
1508 | | - $msgObj = wfMessage( $msg ); |
| 1494 | + $msgObj = $this->msg( $msg ); |
1509 | 1495 | if ( $msgObj->exists() ) { |
1510 | 1496 | $msgVal = $msgObj->parse() . " ($link)"; |
1511 | 1497 | } else { |
— | — | @@ -1512,7 +1498,7 @@ |
1513 | 1499 | } |
1514 | 1500 | |
1515 | 1501 | if ( $params['customised'] ) { |
1516 | | - $msgVal = Html::rawElement( 'p', null, $msgVal ) . wfMessage( 'configure-customised' )->parseAsBlock(); |
| 1502 | + $msgVal = Html::rawElement( 'p', null, $msgVal ) . $this->msg( 'configure-customised' )->parseAsBlock(); |
1517 | 1503 | } |
1518 | 1504 | |
1519 | 1505 | $attribs = array(); |
— | — | @@ -1618,7 +1604,7 @@ |
1619 | 1605 | } |
1620 | 1606 | |
1621 | 1607 | if ( $thisSection ) { |
1622 | | - $thisSection = Html::rawElement( 'legend', null, wfMessage( "configure-section-$title" )->parse() ) . $thisSection; |
| 1608 | + $thisSection = Html::rawElement( 'legend', null, $this->msg( "configure-section-$title" )->parse() ) . $thisSection; |
1623 | 1609 | $ret .= Html::rawElement( 'fieldset', null, $thisSection ); |
1624 | 1610 | } |
1625 | 1611 | } |
Index: trunk/extensions/Configure/Configure.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | 'author' => array( 'Alexandre Emsenhuber', 'Andrew Garrett' ), |
19 | 19 | 'url' => 'https://www.mediawiki.org/wiki/Extension:Configure', |
20 | 20 | 'descriptionmsg' => 'configure-desc', |
21 | | - 'version' => '0.16.3', |
| 21 | + 'version' => '0.17.0', |
22 | 22 | ); |
23 | 23 | |
24 | 24 | # Configuration part |
Index: trunk/extensions/Configure/handler/Handler.php |
— | — | @@ -46,12 +46,13 @@ |
47 | 47 | * Save a new configuration |
48 | 48 | * |
49 | 49 | * @param $settings array of settings |
| 50 | + * @param $user User doing the modification |
50 | 51 | * @param $wiki String: wiki name or true for all |
51 | 52 | * @param $ts 14 chars timestamps |
52 | 53 | * @param $reason String: Reason, as given by the user. |
53 | 54 | * @return bool true on success |
54 | 55 | */ |
55 | | - public function saveNewSettings( $settings, $wiki, $ts = false, $reason = '' ); |
| 56 | + public function saveNewSettings( $settings, User $user, $wiki, $ts = false, $reason = '' ); |
56 | 57 | |
57 | 58 | /** |
58 | 59 | * List all archived versions |
Index: trunk/extensions/Configure/handler/HandlerFiles.php |
— | — | @@ -89,19 +89,18 @@ |
90 | 90 | /** |
91 | 91 | * Save a new configuration |
92 | 92 | * @param $settings array of settings |
| 93 | + * @param $user User doing the modification |
93 | 94 | * @param $wiki String: wiki name or true for all |
94 | 95 | * @return bool true on success |
95 | 96 | */ |
96 | | - public function saveNewSettings( $settings, $wiki, $ts = false, $reason = '' ) { |
97 | | - global $wgUser; |
98 | | - |
| 97 | + public function saveNewSettings( $settings, User $user, $wiki, $ts = false, $reason = '' ) { |
99 | 98 | $arch = $this->getArchiveFileName(); |
100 | 99 | $cur = $this->getFileName(); |
101 | 100 | |
102 | 101 | ## Add meta-data |
103 | 102 | $settings['__metadata'] = array( |
104 | 103 | 'user_wiki' => wfWikiID(), |
105 | | - 'user_name' => $wgUser->getName(), |
| 104 | + 'user_name' => $user->getName(), |
106 | 105 | 'reason' => $reason |
107 | 106 | ); |
108 | 107 | |
Index: trunk/extensions/Configure/handler/HandlerDb.php |
— | — | @@ -192,20 +192,21 @@ |
193 | 193 | * Save a new configuration |
194 | 194 | * |
195 | 195 | * @param $settings array of settings |
| 196 | + * @param $user User doing the modification |
196 | 197 | * @param $wiki String: wiki name or true for all |
197 | 198 | * @param $ts 14 chars timestamps |
198 | 199 | * @param $reason String: Reason, as given by the user. |
199 | 200 | * @return bool true on success |
200 | 201 | */ |
201 | | - public function saveNewSettings( $settings, $wiki, $ts = false, $reason = '' ) { |
| 202 | + public function saveNewSettings( $settings, User $user, $wiki, $ts = false, $reason = '' ) { |
202 | 203 | if ( $wiki === true ) { |
203 | 204 | foreach ( $settings as $name => $val ) { |
204 | | - $this->saveSettingsForWiki( $val, $name, $ts, $reason ); |
| 205 | + $this->saveSettingsForWiki( $val, $user, $name, $ts, $reason ); |
205 | 206 | } |
206 | 207 | } else { |
207 | 208 | if ( !isset( $settings[$wiki] ) ) |
208 | 209 | return false; |
209 | | - $this->saveSettingsForWiki( $settings[$wiki], $wiki, $ts, $reason ); |
| 210 | + $this->saveSettingsForWiki( $settings[$wiki], $user, $wiki, $ts, $reason ); |
210 | 211 | } |
211 | 212 | $this->getCache()->delete( $this->cacheKey( 'configure', 'current' ) ); |
212 | 213 | return true; |
— | — | @@ -214,9 +215,7 @@ |
215 | 216 | /** |
216 | 217 | * save the configuration for $wiki |
217 | 218 | */ |
218 | | - protected function saveSettingsForWiki( $settings, $wiki, $ts, $reason = '' ) { |
219 | | - global $wgUser; |
220 | | - |
| 219 | + protected function saveSettingsForWiki( $settings, User $user, $wiki, $ts, $reason = '' ) { |
221 | 220 | $dbw = $this->getMasterDB(); |
222 | 221 | if ( !$ts ) |
223 | 222 | $ts = wfTimestampNow(); |
— | — | @@ -233,7 +232,7 @@ |
234 | 233 | 'cv_wiki' => $wiki, |
235 | 234 | 'cv_timestamp' => $dbw->timestamp( $ts ), |
236 | 235 | 'cv_is_latest' => 1, |
237 | | - 'cv_user_text' => $wgUser->getName(), |
| 236 | + 'cv_user_text' => $user->getName(), |
238 | 237 | 'cv_user_wiki' => wfWikiId(), |
239 | 238 | 'cv_reason' => $reason |
240 | 239 | ), |
Index: trunk/extensions/Configure/Configure.diff.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | * |
8 | 8 | * @ingroup Extensions |
9 | 9 | */ |
10 | | -abstract class ConfigurationDiff { |
| 10 | +abstract class ConfigurationDiff extends ContextSource { |
11 | 11 | protected $diff; |
12 | 12 | protected $version; |
13 | 13 | protected $wikis; |
— | — | @@ -19,7 +19,8 @@ |
20 | 20 | * @param $version String: new versions |
21 | 21 | * @param $wikis Array: array of wiki names |
22 | 22 | */ |
23 | | - public function __construct( $diff, $version, $wikis ) { |
| 23 | + public function __construct( $context, $diff, $version, $wikis ) { |
| 24 | + $this->setContext( $context ); |
24 | 25 | $this->diff = $diff; |
25 | 26 | $this->version = $version; |
26 | 27 | $this->wikis = $wikis; |
— | — | @@ -113,12 +114,11 @@ |
114 | 115 | * Get the HTML of the diff |
115 | 116 | */ |
116 | 117 | function getHTML() { |
117 | | - global $wgOut; |
118 | | - $wgOut->addStyle( 'common/diff.css' ); |
| 118 | + $this->getOutput()->addStyle( 'common/diff.css' ); |
119 | 119 | $old = $this->getOldVersion(); |
120 | 120 | $new = $this->getNewVersion(); |
121 | 121 | if ( !( $wikis = $this->cleanWikis( $old, $new ) ) ) { |
122 | | - return wfMessage( 'configure-no-diff' )->parseAsBlock(); |
| 122 | + return $this->msg( 'configure-no-diff' )->parseAsBlock(); |
123 | 123 | } |
124 | 124 | $text = ''; |
125 | 125 | foreach ( $wikis as $wiki ) { |
— | — | @@ -152,7 +152,7 @@ |
153 | 153 | $groupDiff .= $this->processDiffSetting( $setting, $oldSetting, $newSetting, $type ) . "\n"; |
154 | 154 | } |
155 | 155 | if ( $groupDiff != '' ) { |
156 | | - $msg = wfMessage( 'configure-section-' . $groupName ); |
| 156 | + $msg = $this->msg( 'configure-section-' . $groupName ); |
157 | 157 | if ( $msg->exists() ) { |
158 | 158 | $name = $msg->parse(); |
159 | 159 | } else { |
— | — | @@ -163,14 +163,14 @@ |
164 | 164 | } |
165 | 165 | } |
166 | 166 | if ( $sectionDiff != '' ) { |
167 | | - $name = wfMessage( 'configure-section-' . $sectionName )->parse(); |
| 167 | + $name = $this->msg( 'configure-section-' . $sectionName )->parse(); |
168 | 168 | $text .= "<tr><td colspan=\"4\"><h3 class=\"config-diff-section\">{$name}</h3></td></tr>\n"; |
169 | 169 | $text .= $sectionDiff; |
170 | 170 | } |
171 | 171 | } |
172 | 172 | |
173 | 173 | if ( empty( $text ) ) |
174 | | - return wfMessage( 'configure-no-diff' )->parseAsBlock(); |
| 174 | + return $this->msg( 'configure-no-diff' )->parseAsBlock(); |
175 | 175 | |
176 | 176 | $ret = "<table class='diff'>\n"; |
177 | 177 | $ret .= "<col class='diff-marker' />"; |
— | — | @@ -192,7 +192,7 @@ |
193 | 193 | * @return String: XHTML |
194 | 194 | */ |
195 | 195 | function processDiffSetting( $name, $old, $new, $type ) { |
196 | | - $msg = wfMessage( 'configure-setting-' . $name ); |
| 196 | + $msg = $this->msg( 'configure-setting-' . $name ); |
197 | 197 | $rawVal = Xml::element( 'tt', null, "\$$name" ); |
198 | 198 | if ( $msg->exists() ) { |
199 | 199 | $msgVal = $msg->parse() . " ($rawVal)"; |
— | — | @@ -275,7 +275,7 @@ |
276 | 276 | if ($count == 0 || $period == 0) |
277 | 277 | continue; |
278 | 278 | |
279 | | - $val[] = "$action, $group: " . wfMessage( 'configure-throttle-summary', $count, $period )->text(); |
| 279 | + $val[] = "$action, $group: " . $this->msg( 'configure-throttle-summary', $count, $period )->text(); |
280 | 280 | } |
281 | 281 | } |
282 | 282 | } |
— | — | @@ -288,11 +288,11 @@ |
289 | 289 | |
290 | 290 | foreach( $setting as $group => $conds ) { |
291 | 291 | if ( !is_array( $conds ) ) { |
292 | | - $val[] = "$group: ".wfMessage( "configure-condition-description-$conds" )->text(); |
| 292 | + $val[] = "$group: ".$this->msg( "configure-condition-description-$conds" )->text(); |
293 | 293 | continue; |
294 | 294 | } |
295 | 295 | if ( count( $conds ) == 0 ) { |
296 | | - $val[] = "$group: ".wfMessage( 'configure-autopromote-noconds' )->text(); |
| 296 | + $val[] = "$group: ".$this->msg( 'configure-autopromote-noconds' )->text(); |
297 | 297 | continue; |
298 | 298 | } |
299 | 299 | |
— | — | @@ -300,7 +300,7 @@ |
301 | 301 | $boolop = array_shift( $conds ); |
302 | 302 | $boolop = $opToName[$boolop]; |
303 | 303 | |
304 | | - $val[] = "$group: " . wfMessage( "configure-boolop-description-$boolop" )->text(); |
| 304 | + $val[] = "$group: " . $this->msg( "configure-boolop-description-$boolop" )->text(); |
305 | 305 | } else { |
306 | 306 | $conds = array( $conds ); |
307 | 307 | } |
— | — | @@ -308,7 +308,7 @@ |
309 | 309 | // Analyse each individual one... |
310 | 310 | foreach( $conds as $cond ) { |
311 | 311 | if ($cond == array( APCOND_AGE, -1 ) ) { |
312 | | - $val[] = "$group: " . wfMessage( 'configure-autopromote-noconds' )->text(); |
| 312 | + $val[] = "$group: " . $this->msg( 'configure-autopromote-noconds' )->text(); |
313 | 313 | continue; |
314 | 314 | } |
315 | 315 | |
— | — | @@ -321,7 +321,7 @@ |
322 | 322 | $argSummary = implode( ', ', $cond ); |
323 | 323 | $count = count( $cond ); |
324 | 324 | |
325 | | - $val[] = "$group: ".wfMessage( "configure-condition-description-$name", $argSummary, $count )->text(); |
| 325 | + $val[] = "$group: ".$this->msg( "configure-condition-description-$name", $argSummary, $count )->text(); |
326 | 326 | } |
327 | 327 | } |
328 | 328 | } else { |