Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -3630,3 +3630,9 @@ |
3631 | 3631 | * See http://universaleditbutton.org for more background information |
3632 | 3632 | */ |
3633 | 3633 | $wgUniversalEditButton = true; |
| 3634 | + |
| 3635 | +/** |
| 3636 | +* Enable the Interwiki special page. |
| 3637 | +* Disable for wikis that have their interwiki table updated automatically from a central location (like Wikimedia) |
| 3638 | +*/ |
| 3639 | +$wgEnableSpecialInterwiki = true; |
Index: trunk/phase3/includes/specials/SpecialInterwiki.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | } |
13 | 13 | |
14 | 14 | function execute( $par ) { |
15 | | - global $wgRequest, $wgOut, $wgUser; |
| 15 | + global $wgRequest, $wgOut, $wgUser, $wgEnableSpecialInterwiki; |
16 | 16 | |
17 | 17 | $this->setHeaders(); |
18 | 18 | $this->outputHeader(); |
— | — | @@ -28,6 +28,10 @@ |
29 | 29 | case "delete": |
30 | 30 | case "edit" : |
31 | 31 | case "add" : |
| 32 | + if( !$wgEnableSpecialInterwiki ) { |
| 33 | + $wgOut->addWikiMsg( 'interwiki-not-enabled' ); |
| 34 | + return; |
| 35 | + } |
32 | 36 | if( !$admin ){ |
33 | 37 | $wgOut->permissionRequired( 'interwiki' ); |
34 | 38 | return; |
— | — | @@ -35,6 +39,10 @@ |
36 | 40 | $this->showForm( $action ); |
37 | 41 | break; |
38 | 42 | case "submit": |
| 43 | + if( !$wgEnableSpecialInterwiki ) { |
| 44 | + $wgOut->addWikiMsg( 'interwiki-not-enabled' ); |
| 45 | + return; |
| 46 | + } |
39 | 47 | if( !$admin ){ |
40 | 48 | $wgOut->permissionRequired( 'interwiki' ); |
41 | 49 | return; |
— | — | @@ -205,7 +213,7 @@ |
206 | 214 | } |
207 | 215 | |
208 | 216 | function showList( $admin ) { |
209 | | - global $wgUser, $wgOut; |
| 217 | + global $wgUser, $wgOut, $wgEnableSpecialInterwiki; |
210 | 218 | $prefixmessage = wfMsgHtml( 'interwiki_prefix' ); |
211 | 219 | $urlmessage = wfMsgHtml( 'interwiki_url' ); |
212 | 220 | $localmessage = wfMsgHtml( 'interwiki_local' ); |
— | — | @@ -214,7 +222,7 @@ |
215 | 223 | $wgOut->addWikiMsg( 'interwiki_intro' ); |
216 | 224 | $selfTitle = $this->getTitle(); |
217 | 225 | |
218 | | - if ( $admin ) { |
| 226 | + if ( $admin && $wgEnableSpecialInterwiki ) { |
219 | 227 | $skin = $wgUser->getSkin(); |
220 | 228 | $addtext = wfMsgHtml( 'interwiki_addtext' ); |
221 | 229 | $addlink = $skin->link( $selfTitle, $addtext, array(), array( 'action' => 'add' ) ); |
— | — | @@ -233,7 +241,7 @@ |
234 | 242 | <br /> |
235 | 243 | <table width='100%' style='border:1px solid #aaa;' class='wikitable'> |
236 | 244 | <tr id='interwikitable-header'><th>$prefixmessage</th> <th>$urlmessage</th> <th>$localmessage</th> <th>$transmessage</th>"; |
237 | | - if( $admin ) { |
| 245 | + if( $admin && $wgEnableSpecialInterwiki ) { |
238 | 246 | $deletemessage = wfMsgHtml( 'delete' ); |
239 | 247 | $editmessage = wfMsgHtml( 'edit' ); |
240 | 248 | $out .= "<th>$editmessage</th>"; |
— | — | @@ -250,7 +258,7 @@ |
251 | 259 | <td class='mw-interwikitable-url'>$url</td> |
252 | 260 | <td class='mw-interwikitable-local'>$local</td> |
253 | 261 | <td class='mw-interwikitable-trans'>$trans</td>"; |
254 | | - if( $admin ) { |
| 262 | + if( $admin && $wgEnableSpecialInterwiki ) { |
255 | 263 | $out .= '<td class="mw-interwikitable-modify">'; |
256 | 264 | $out .= $skin->link( $selfTitle, $editmessage, array(), |
257 | 265 | array( 'action' => 'edit', 'prefix' => $s->iw_prefix ) ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2217,6 +2217,7 @@ |
2218 | 2218 | 'interwiki_log_deleted' => 'removed prefix "$2" from the interwiki table', |
2219 | 2219 | 'interwiki_log_edited' => 'modified prefix "$2" : ($3) (trans: $4) (local: $5) in the interwiki table', |
2220 | 2220 | 'interwiki_logentry' => '', # do not translate or duplicate this message to other languages |
| 2221 | +'interwiki-not-enabled' => 'Editing of the interwiki table is not on the wiki.', |
2221 | 2222 | 'interwiki_prefix' => 'Prefix', |
2222 | 2223 | 'interwiki_reasonfield' => 'Reason', |
2223 | 2224 | 'interwiki_trans' => 'Allow interwiki transclusions', |