Index: trunk/extensions/Interwiki/SpecialInterwiki.alias.php |
— | — | @@ -2,7 +2,8 @@ |
3 | 3 | /** |
4 | 4 | * Aliases for Special:Interwiki |
5 | 5 | * |
6 | | - * @addtogroup Extensions |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
7 | 8 | */ |
8 | 9 | |
9 | 10 | $aliases = array(); |
— | — | @@ -11,7 +12,7 @@ |
12 | 13 | * @author Jon Harald Søby |
13 | 14 | */ |
14 | 15 | $aliases['en'] = array( |
15 | | - 'Interwiki' => array('Interwiki'), |
| 16 | + 'Interwiki' => array( 'Interwiki' ), |
16 | 17 | ); |
17 | 18 | |
18 | 19 | /** Arabic (العربية) |
Index: trunk/extensions/Interwiki/SpecialInterwiki_body.php |
— | — | @@ -1,14 +1,23 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * implements Special:Interwiki |
| 4 | + * Implements Special:Interwiki |
5 | 5 | * @ingroup SpecialPage |
6 | 6 | */ |
7 | 7 | class SpecialInterwiki extends SpecialPage { |
8 | | - function __construct() { |
| 8 | + |
| 9 | + /** |
| 10 | + * Constructor - sets up the new special page |
| 11 | + */ |
| 12 | + public function __construct() { |
9 | 13 | parent::__construct( 'Interwiki' ); |
10 | 14 | } |
11 | 15 | |
12 | | - function execute( $par ) { |
| 16 | + /** |
| 17 | + * Show the special page |
| 18 | + * |
| 19 | + * @param $par Mixed: parameter passed to the page or null |
| 20 | + */ |
| 21 | + public function execute( $par ) { |
13 | 22 | global $wgRequest, $wgOut, $wgUser; |
14 | 23 | |
15 | 24 | wfLoadExtensionMessages( 'Interwiki' ); |
— | — | @@ -20,27 +29,40 @@ |
21 | 30 | |
22 | 31 | $admin = $wgUser->isAllowed( 'interwiki' ); |
23 | 32 | if ( $admin ) { |
24 | | - $wgOut->setPagetitle( wfMsg( 'interwiki' ) ); |
| 33 | + $wgOut->setPageTitle( wfMsg( 'interwiki' ) ); |
25 | 34 | } else { |
26 | | - $wgOut->setPagetitle( wfMsg( 'interwiki-title-norights' ) ); |
| 35 | + $wgOut->setPageTitle( wfMsg( 'interwiki-title-norights' ) ); |
27 | 36 | } |
28 | 37 | $action = $wgRequest->getVal( 'action', $par ); |
29 | 38 | |
30 | 39 | switch( $action ){ |
31 | | - case "delete": |
32 | | - case "edit" : |
33 | | - case "add" : |
| 40 | + case 'delete': |
| 41 | + case 'edit': |
| 42 | + case 'add': |
| 43 | + // Check permissions |
34 | 44 | if( !$admin ){ |
35 | | - $wgOut->permissionRequired('interwiki'); |
| 45 | + $wgOut->permissionRequired( 'interwiki' ); |
36 | 46 | return; |
37 | 47 | } |
| 48 | + // Is the database in read-only mode? |
| 49 | + if( wfReadOnly() ) { |
| 50 | + $wgOut->readOnlyPage(); |
| 51 | + return; |
| 52 | + } |
38 | 53 | $this->showForm( $action ); |
39 | 54 | break; |
40 | | - case "submit": |
| 55 | + case 'submit': |
| 56 | + // Check permissions |
41 | 57 | if( !$admin ){ |
42 | 58 | $wgOut->permissionRequired( 'interwiki' ); |
43 | 59 | return; |
44 | 60 | } |
| 61 | + // Is the database in read-only mode? |
| 62 | + if( wfReadOnly() ) { |
| 63 | + $wgOut->readOnlyPage(); |
| 64 | + return; |
| 65 | + } |
| 66 | + // Prevent cross-site request forgeries |
45 | 67 | if( !$wgRequest->wasPosted() || !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { |
46 | 68 | $wgOut->addWikiMsg( 'sessionfailure' ); |
47 | 69 | return; |
— | — | @@ -55,13 +77,13 @@ |
56 | 78 | |
57 | 79 | function showForm( $action ) { |
58 | 80 | global $wgRequest, $wgUser, $wgOut; |
59 | | - |
| 81 | + |
60 | 82 | $actionUrl = $this->getTitle()->getLocalURL( 'action=submit' ); |
61 | 83 | $token = $wgUser->editToken(); |
62 | 84 | $defaultreason = $wgRequest->getVal( 'wpInterwikiReason', wfMsgForContent( 'interwiki_defaultreason' ) ); |
63 | | - |
| 85 | + |
64 | 86 | switch( $action ){ |
65 | | - case "delete": |
| 87 | + case 'delete': |
66 | 88 | |
67 | 89 | $prefix = $wgRequest->getVal( 'prefix' ); |
68 | 90 | $button = wfMsg( 'delete' ); |
— | — | @@ -72,13 +94,13 @@ |
73 | 95 | $wgOut->addHTML( |
74 | 96 | Xml::openElement( 'fieldset' ) . |
75 | 97 | Xml::element( 'legend', null, $topmessage ) . |
76 | | - Xml::openElement( 'form', array('id'=> 'mw-interwiki-deleteform', 'method'=> 'post', 'action' => $actionUrl ) ) . |
| 98 | + Xml::openElement( 'form', array( 'id' => 'mw-interwiki-deleteform', 'method' => 'post', 'action' => $actionUrl ) ) . |
77 | 99 | Xml::openElement( 'table' ) . |
78 | 100 | "<tr><td>$deletingmessage</td></tr>". |
79 | | - '<tr><td class="mw-label">' . Xml::label( $reasonmessage, 'mw-interwiki-deletereason') . '</td>' . |
| 101 | + '<tr><td class="mw-label">' . Xml::label( $reasonmessage, 'mw-interwiki-deletereason' ) . '</td>' . |
80 | 102 | '<td class="mw-input">' . |
81 | | - Xml::input( 'wpInterwikiReason', 60, $defaultreason, array( 'tabindex' => '1', 'id' => 'mw-interwiki-deletereason', 'maxlength' => '200' ) ) . |
82 | | - '</td></tr>' . |
| 103 | + Xml::input( 'wpInterwikiReason', 60, $defaultreason, array( 'tabindex' => '1', 'id' => 'mw-interwiki-deletereason', 'maxlength' => '200' ) ) . |
| 104 | + '</td></tr>' . |
83 | 105 | '<tr><td class="mw-submit">' . Xml::submitButton( $button, array( 'id' => 'mw-interwiki-submit' ) ) . |
84 | 106 | Xml::hidden( 'wpInterwikiPrefix', $prefix ) . |
85 | 107 | Xml::hidden( 'wpInterwikiAction', $action ) . |
— | — | @@ -89,12 +111,12 @@ |
90 | 112 | Xml::closeElement( 'fieldset' ) |
91 | 113 | ); |
92 | 114 | break; |
93 | | - case "edit" : |
94 | | - case "add" : |
95 | | - if( $action == "edit" ){ |
| 115 | + case 'edit': |
| 116 | + case 'add': |
| 117 | + if( $action == 'edit' ){ |
96 | 118 | $prefix = $wgRequest->getVal( 'prefix' ); |
97 | 119 | $dbr = wfGetDB( DB_SLAVE ); |
98 | | - $row = $dbr->selectRow( 'interwiki', '*', array( 'iw_prefix' => $prefix ) ); |
| 120 | + $row = $dbr->selectRow( 'interwiki', '*', array( 'iw_prefix' => $prefix ), __METHOD__ ); |
99 | 121 | if( !$row ){ |
100 | 122 | $this->error( 'interwiki_editerror', $prefix ); |
101 | 123 | return; |
— | — | @@ -109,7 +131,7 @@ |
110 | 132 | $button = wfMsg( 'edit' ); |
111 | 133 | } else { |
112 | 134 | $prefix = $wgRequest->getVal( 'wpInterwikiPrefix' ) ? $wgRequest->getVal( 'wpInterwikiPrefix' ) : $wgRequest->getVal( 'prefix' ); |
113 | | - $prefix = Xml::input( 'wpInterwikiPrefix', 20, $prefix, array( 'tabindex'=>'1', 'id'=>'mw-interwiki-prefix', 'maxlength'=>'20' ) ); |
| 135 | + $prefix = Xml::input( 'wpInterwikiPrefix', 20, $prefix, array( 'tabindex' => '1', 'id' => 'mw-interwiki-prefix', 'maxlength' => '20' ) ); |
114 | 136 | $local = $wgRequest->getCheck( 'wpInterwikiLocal' ); |
115 | 137 | $trans = $wgRequest->getCheck( 'wpInterwikiTrans' ); |
116 | 138 | $old = ''; |
— | — | @@ -129,22 +151,22 @@ |
130 | 152 | Xml::openElement( 'fieldset' ) . |
131 | 153 | Xml::element( 'legend', null, $topmessage ) . |
132 | 154 | $intromessage . |
133 | | - Xml::openElement( 'form', array('id'=> 'mw-interwiki-editform', 'method'=> 'post', 'action'=>$actionUrl) ) . |
134 | | - Xml::openElement( 'table', array('id'=>"mw-interwiki-$action") ) . |
| 155 | + Xml::openElement( 'form', array( 'id' => 'mw-interwiki-editform', 'method' => 'post', 'action' => $actionUrl ) ) . |
| 156 | + Xml::openElement( 'table', array( 'id' => "mw-interwiki-$action" ) ) . |
135 | 157 | "<tr><td class='mw-label'>$prefixmessage</td><td><tt>$prefix</tt></td></tr>" . |
136 | | - "<tr><td class='mw-label'>" . Xml::label( $localmessage, 'mw-interwiki-local' ) . '</td>' . |
137 | | - "<td class='mw-input'>" . Xml::check( 'wpInterwikiLocal', $local, array('id'=>'mw-interwiki-local') ) . '</td></tr>' . |
| 158 | + '<tr><td class="mw-label">' . Xml::label( $localmessage, 'mw-interwiki-local' ) . '</td>' . |
| 159 | + '<td class="mw-input">' . Xml::check( 'wpInterwikiLocal', $local, array( 'id' => 'mw-interwiki-local' ) ) . '</td></tr>' . |
138 | 160 | '<tr><td class="mw-label">' . Xml::label( $transmessage, 'mw-interwiki-trans' ) . '</td>' . |
139 | | - '<td class="mw-input">' . Xml::check( 'wpInterwikiTrans', $trans, array('id'=>'mw-interwiki-trans') ) . '</td></tr>' . |
| 161 | + '<td class="mw-input">' . Xml::check( 'wpInterwikiTrans', $trans, array( 'id' => 'mw-interwiki-trans' ) ) . '</td></tr>' . |
140 | 162 | '<tr><td class="mw-label">' . Xml::label( $urlmessage, 'mw-interwiki-url' ) . '</td>' . |
141 | | - '<td class="mw-input">' . Xml::input( 'wpInterwikiURL', 60, $defaulturl, array('tabindex'=>'1', 'maxlength'=>'200', 'id'=>'mw-interwiki-url') ) . '</td></tr>' . |
| 163 | + '<td class="mw-input">' . Xml::input( 'wpInterwikiURL', 60, $defaulturl, array( 'tabindex' => '1', 'maxlength' => '200', 'id' => 'mw-interwiki-url' ) ) . '</td></tr>' . |
142 | 164 | '<tr><td class="mw-label">' . Xml::label( $reasonmessage, 'mw-interwiki-editreason' ) . '</td>' . |
143 | | - '<td class="mw-input">' . Xml::input( 'wpInterwikiReason', 60, $defaultreason, array( 'tabindex'=>'1', 'id'=>'mw-interwiki-editreason', 'maxlength'=>'200') ) . |
| 165 | + '<td class="mw-input">' . Xml::input( 'wpInterwikiReason', 60, $defaultreason, array( 'tabindex' => '1', 'id' => 'mw-interwiki-editreason', 'maxlength' => '200' ) ) . |
144 | 166 | Xml::hidden( 'wpInterwikiAction', $action ) . |
145 | 167 | $old . |
146 | 168 | Xml::hidden( 'wpEditToken', $token ) . |
147 | 169 | '</td></tr>' . |
148 | | - '<tr><td class="mw-submit">' . Xml::submitButton( $button, array( 'id'=>'mw-interwiki-submit' ) ) . '</td></tr>' . |
| 170 | + '<tr><td class="mw-submit">' . Xml::submitButton( $button, array( 'id' => 'mw-interwiki-submit' ) ) . '</td></tr>' . |
149 | 171 | Xml::closeElement( 'table' ) . |
150 | 172 | Xml::closeElement( 'form' ) . |
151 | 173 | Xml::closeElement( 'fieldset' ) |
— | — | @@ -166,21 +188,21 @@ |
167 | 189 | $selfTitle = $this->getTitle(); |
168 | 190 | $dbw = wfGetDB( DB_MASTER ); |
169 | 191 | switch( $do ){ |
170 | | - case "delete": |
| 192 | + case 'delete': |
171 | 193 | $dbw->delete( 'interwiki', array( 'iw_prefix' => $prefix ), __METHOD__ ); |
172 | 194 | |
173 | 195 | if ( $dbw->affectedRows() == 0 ) { |
174 | 196 | $this->error( 'interwiki_delfailed', $prefix ); |
175 | 197 | $this->showForm( $do ); |
176 | 198 | } else { |
177 | | - $wgOut->addWikiText( wfMsg( 'interwiki_deleted', $prefix )); |
| 199 | + $wgOut->addWikiMsg( 'interwiki_deleted', $prefix ); |
178 | 200 | $wgOut->returnToMain( false, $selfTitle ); |
179 | 201 | $log = new LogPage( 'interwiki' ); |
180 | 202 | $log->addEntry( 'iw_delete', $selfTitle, $reason, array( $prefix ) ); |
181 | 203 | } |
182 | 204 | break; |
183 | | - case "edit": |
184 | | - case "add": |
| 205 | + case 'edit': |
| 206 | + case 'add': |
185 | 207 | $theurl = $wgRequest->getVal( 'wpInterwikiURL' ); |
186 | 208 | $local = $wgRequest->getCheck( 'wpInterwikiLocal' ) ? 1 : 0; |
187 | 209 | $trans = $wgRequest->getCheck( 'wpInterwikiTrans' ) ? 1 : 0; |
— | — | @@ -200,16 +222,16 @@ |
201 | 223 | $wgOut->addWikiMsg( "interwiki_{$do}ed", $prefix ); |
202 | 224 | $wgOut->returnToMain( false, $selfTitle ); |
203 | 225 | $log = new LogPage( 'interwiki' ); |
204 | | - $log->addEntry( 'iw_'.$do, $selfTitle, $reason, array( $prefix, $theurl, $trans, $local ) ); |
| 226 | + $log->addEntry( 'iw_' . $do, $selfTitle, $reason, array( $prefix, $theurl, $trans, $local ) ); |
205 | 227 | } |
206 | 228 | break; |
207 | 229 | } |
208 | 230 | } |
209 | 231 | |
210 | 232 | function trans_local( $tl, $msg0, $msg1 ) { |
211 | | - if( $tl==='0' ) |
| 233 | + if( $tl === '0' ) |
212 | 234 | return $msg0; |
213 | | - if( $tl==='1' ) |
| 235 | + if( $tl === '1' ) |
214 | 236 | return $msg1; |
215 | 237 | return htmlspecialchars( $tl ); |
216 | 238 | } |
— | — | @@ -243,6 +265,7 @@ |
244 | 266 | $wgOut->addWikiMsg( 'interwiki_intro_footer' ); |
245 | 267 | $selfTitle = $this->getTitle(); |
246 | 268 | |
| 269 | + // Privileged users can add new prefixes |
247 | 270 | if ( $admin ) { |
248 | 271 | $skin = $wgUser->getSkin(); |
249 | 272 | $addtext = wfMsgHtml( 'interwiki_addtext' ); |
— | — | @@ -251,23 +274,25 @@ |
252 | 275 | } |
253 | 276 | |
254 | 277 | $dbr = wfGetDB( DB_SLAVE ); |
255 | | - $res = $dbr->select( 'interwiki', '*' ); |
| 278 | + $res = $dbr->select( 'interwiki', '*', false, __METHOD__ ); |
256 | 279 | $numrows = $res->numRows(); |
257 | 280 | if ( $numrows == 0 ) { |
| 281 | + // If the interwiki table is empty, display an error message |
258 | 282 | $this->error( 'interwiki_error' ); |
259 | 283 | return; |
260 | 284 | } |
261 | | - |
| 285 | + |
262 | 286 | $out = " |
263 | 287 | <table width='100%' class='mw-interwikitable wikitable body'> |
264 | 288 | <tr id='interwikitable-header'><th>$prefixmessage</th> <th>$urlmessage</th> <th>$localmessage</th> <th>$transmessage</th>"; |
| 289 | + // Privileged users can modify and delete existing prefixes |
265 | 290 | if( $admin ) { |
266 | 291 | $deletemessage = wfMsgHtml( 'delete' ); |
267 | 292 | $editmessage = wfMsgHtml( 'edit' ); |
268 | | - $out .= '<th>'.wfMsgHtml( 'interwiki_edit' ).'</th>'; |
| 293 | + $out .= '<th>' . wfMsgHtml( 'interwiki_edit' ) . '</th>'; |
269 | 294 | } |
270 | 295 | $out .= "</tr>\n"; |
271 | | - |
| 296 | + |
272 | 297 | while( $s = $res->fetchObject() ) { |
273 | 298 | $prefix = htmlspecialchars( $s->iw_prefix ); |
274 | 299 | $url = htmlspecialchars( $s->iw_url ); |
— | — | @@ -291,13 +316,14 @@ |
292 | 317 | $out .= "\n</tr>\n"; |
293 | 318 | } |
294 | 319 | $res->free(); |
295 | | - $out .= "</table><br />"; |
| 320 | + $out .= '</table><br />'; |
296 | 321 | $wgOut->addHTML( $out ); |
297 | 322 | } |
298 | | - |
| 323 | + |
299 | 324 | function error() { |
300 | 325 | global $wgOut; |
301 | 326 | $args = func_get_args(); |
302 | 327 | $wgOut->wrapWikiMsg( "<p class='error'>$1</p>", $args ); |
303 | 328 | } |
304 | | -} |
| 329 | + |
| 330 | +} |
\ No newline at end of file |
Index: trunk/extensions/Interwiki/SpecialInterwiki.i18n.php |
— | — | @@ -1,8 +1,9 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Internationalisation file for extension Interwiki. |
| 4 | + * Internationalisation file for Interwiki extension. |
5 | 5 | * |
6 | | - * @addtogroup Extensions |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
7 | 8 | * |
8 | 9 | * This program is free software; you can redistribute it and/or modify |
9 | 10 | * it under the terms of the GNU General Public License as published by |
— | — | @@ -25,68 +26,68 @@ |
26 | 27 | */ |
27 | 28 | $messages['en'] = array( |
28 | 29 | # general messages |
29 | | - 'interwiki' => 'View and edit interwiki data', |
| 30 | + 'interwiki' => 'View and edit interwiki data', |
30 | 31 | 'interwiki-title-norights' => 'View interwiki data', |
31 | | - 'interwiki-desc' => 'Adds a [[Special:Interwiki|special page]] to view and edit the interwiki table', |
32 | | - 'interwiki_intro' => 'This is an overview of the interwiki table. Meanings of the data in the columns:', |
33 | | - 'interwiki_prefix' => 'Prefix', |
34 | | - 'interwiki_prefix_intro' => 'Interwiki prefix to be used in <code>[<nowiki />[prefix:<i>pagename</i>]]</code> wikitext syntax.', |
35 | | - 'interwiki_url' => 'URL', # only translate this message if you have to change it |
36 | | - 'interwiki_url_intro' => 'Template for URLs. The placeholder $1 will be replaced by the <i>pagename</i> of the wikitext, when the abovementioned wikitext syntax is used.', |
37 | | - 'interwiki_local' => 'Forward', |
38 | | - 'interwiki_local_intro' => 'An HTTP request to the local wiki with this interwiki prefix in the URL is:', |
39 | | - 'interwiki_local_0_intro' => 'not honored, usually blocked by "page not found",', |
40 | | - 'interwiki_local_1_intro' => 'redirected to the target URL given in the interwiki link definitions (i.e. treated like references in local pages)', |
41 | | - 'interwiki_trans' => 'Transclude', |
42 | | - 'interwiki_trans_intro' => 'If wikitext syntax <code>{<nowiki />{prefix:<i>pagename</i>}}</code> is used, then:', |
43 | | - 'interwiki_trans_1_intro' => 'allow transclusion from the foreign wiki, if interwiki transclusions are generally permitted in this wiki,', |
44 | | - 'interwiki_trans_0_intro' => 'do not allow it, rather look for a page in the template namespace.', |
45 | | - 'interwiki_intro_footer' => 'See [http://www.mediawiki.org/wiki/Interwiki_table MediaWiki.org] for more information about the interwiki table. |
| 32 | + 'interwiki-desc' => 'Adds a [[Special:Interwiki|special page]] to view and edit the interwiki table', |
| 33 | + 'interwiki_intro' => 'This is an overview of the interwiki table. Meanings of the data in the columns:', |
| 34 | + 'interwiki_prefix' => 'Prefix', |
| 35 | + 'interwiki_prefix_intro' => 'Interwiki prefix to be used in <code>[<nowiki />[prefix:<i>pagename</i>]]</code> wikitext syntax.', |
| 36 | + 'interwiki_url' => 'URL', # only translate this message if you have to change it |
| 37 | + 'interwiki_url_intro' => 'Template for URLs. The placeholder $1 will be replaced by the <i>pagename</i> of the wikitext, when the abovementioned wikitext syntax is used.', |
| 38 | + 'interwiki_local' => 'Forward', |
| 39 | + 'interwiki_local_intro' => 'An HTTP request to the local wiki with this interwiki prefix in the URL is:', |
| 40 | + 'interwiki_local_0_intro' => 'not honored, usually blocked by "page not found",', |
| 41 | + 'interwiki_local_1_intro' => 'redirected to the target URL given in the interwiki link definitions (i.e. treated like references in local pages)', |
| 42 | + 'interwiki_trans' => 'Transclude', |
| 43 | + 'interwiki_trans_intro' => 'If wikitext syntax <code>{<nowiki />{prefix:<i>pagename</i>}}</code> is used, then:', |
| 44 | + 'interwiki_trans_1_intro' => 'allow transclusion from the foreign wiki, if interwiki transclusions are generally permitted in this wiki,', |
| 45 | + 'interwiki_trans_0_intro' => 'do not allow it, rather look for a page in the template namespace.', |
| 46 | + 'interwiki_intro_footer' => 'See [http://www.mediawiki.org/wiki/Interwiki_table MediaWiki.org] for more information about the interwiki table. |
46 | 47 | There is a [[Special:Log/interwiki|log of changes]] to the interwiki table.', |
47 | | - 'interwiki_1' => 'yes', |
48 | | - 'interwiki_0' => 'no', |
49 | | - 'interwiki_error' => 'Error: The interwiki table is empty, or something else went wrong.', |
| 48 | + 'interwiki_1' => 'yes', |
| 49 | + 'interwiki_0' => 'no', |
| 50 | + 'interwiki_error' => 'Error: The interwiki table is empty, or something else went wrong.', |
50 | 51 | |
51 | | - # modifying permitted |
52 | | - 'interwiki_edit' => 'Edit', |
53 | | - 'interwiki_reasonfield' => 'Reason', |
54 | | - 'interwiki_defaultreason' => 'no reason given', |
| 52 | + # modifying permitted |
| 53 | + 'interwiki_edit' => 'Edit', |
| 54 | + 'interwiki_reasonfield' => 'Reason', |
| 55 | + 'interwiki_defaultreason' => 'no reason given', |
55 | 56 | |
56 | 57 | # deleting a prefix |
57 | | - 'interwiki_delquestion' => 'Deleting "$1"', |
58 | | - 'interwiki_deleting' => 'You are deleting prefix "$1".', |
59 | | - 'interwiki_deleted' => 'Prefix "$1" was successfully removed from the interwiki table.', |
60 | | - 'interwiki_delfailed' => 'Prefix "$1" could not be removed from the interwiki table.', |
| 58 | + 'interwiki_delquestion' => 'Deleting "$1"', |
| 59 | + 'interwiki_deleting' => 'You are deleting prefix "$1".', |
| 60 | + 'interwiki_deleted' => 'Prefix "$1" was successfully removed from the interwiki table.', |
| 61 | + 'interwiki_delfailed' => 'Prefix "$1" could not be removed from the interwiki table.', |
61 | 62 | |
62 | 63 | # adding a prefix |
63 | | - 'interwiki_addtext' => 'Add an interwiki prefix', |
64 | | - 'interwiki_addintro' => 'You are adding a new interwiki prefix. |
| 64 | + 'interwiki_addtext' => 'Add an interwiki prefix', |
| 65 | + 'interwiki_addintro' => 'You are adding a new interwiki prefix. |
65 | 66 | Remember that it cannot contain spaces ( ), colons (:), ampersands (&), or equal signs (=).', |
66 | | - 'interwiki_addbutton' => 'Add', |
67 | | - 'interwiki_added' => 'Prefix "$1" was successfully added to the interwiki table.', |
68 | | - 'interwiki_addfailed' => 'Prefix "$1" could not be added to the interwiki table. |
| 67 | + 'interwiki_addbutton' => 'Add', |
| 68 | + 'interwiki_added' => 'Prefix "$1" was successfully added to the interwiki table.', |
| 69 | + 'interwiki_addfailed' => 'Prefix "$1" could not be added to the interwiki table. |
69 | 70 | Possibly it already exists in the interwiki table.', |
70 | | - 'interwiki_defaulturl' => 'http://www.example.com/$1', # only translate this message to other languages if you have to change it |
| 71 | + 'interwiki_defaulturl' => 'http://www.example.com/$1', # only translate this message to other languages if you have to change it |
71 | 72 | |
72 | 73 | # editing a prefix |
73 | | - 'interwiki_edittext' => 'Editing an interwiki prefix', |
74 | | - 'interwiki_editintro' => 'You are editing an interwiki prefix. |
| 74 | + 'interwiki_edittext' => 'Editing an interwiki prefix', |
| 75 | + 'interwiki_editintro' => 'You are editing an interwiki prefix. |
75 | 76 | Remember that this can break existing links.', |
76 | | - 'interwiki_edited' => 'Prefix "$1" was successfully modified in the interwiki table.', |
77 | | - 'interwiki_editerror' => 'Prefix "$1" can not be modified in the interwiki table. |
| 77 | + 'interwiki_edited' => 'Prefix "$1" was successfully modified in the interwiki table.', |
| 78 | + 'interwiki_editerror' => 'Prefix "$1" can not be modified in the interwiki table. |
78 | 79 | Possibly it does not exist.', |
79 | 80 | 'interwiki-badprefix' => 'Specified interwiki prefix "$1" contains invalid characters', |
80 | 81 | |
81 | 82 | # interwiki log |
82 | | - 'interwiki_logpagename' => 'Interwiki table log', |
83 | | - 'interwiki_log_added' => 'added prefix "$2" ($3) (trans: $4) (local: $5) to the interwiki table', |
84 | | - 'interwiki_log_edited' => 'modified prefix "$2" : ($3) (trans: $4) (local: $5) in the interwiki table', |
85 | | - 'interwiki_log_deleted' => 'removed prefix "$2" from the interwiki table', |
86 | | - 'interwiki_logpagetext' => 'This is a log of changes to the [[Special:Interwiki|interwiki table]].', |
87 | | - 'interwiki_logentry' => '', # do not translate this message |
| 83 | + 'interwiki_logpagename' => 'Interwiki table log', |
| 84 | + 'interwiki_log_added' => 'added prefix "$2" ($3) (trans: $4) (local: $5) to the interwiki table', |
| 85 | + 'interwiki_log_edited' => 'modified prefix "$2" : ($3) (trans: $4) (local: $5) in the interwiki table', |
| 86 | + 'interwiki_log_deleted' => 'removed prefix "$2" from the interwiki table', |
| 87 | + 'interwiki_logpagetext' => 'This is a log of changes to the [[Special:Interwiki|interwiki table]].', |
| 88 | + 'interwiki_logentry' => '', # do not translate this message |
88 | 89 | |
89 | 90 | # rights |
90 | | - 'right-interwiki' => 'Edit interwiki data', |
| 91 | + 'right-interwiki' => 'Edit interwiki data', |
91 | 92 | 'action-interwiki' => 'change this interwiki entry', |
92 | 93 | ); |
93 | 94 | |
Index: trunk/extensions/Interwiki/SpecialInterwiki.php |
— | — | @@ -1,43 +1,53 @@ |
2 | 2 | <?php |
3 | | -/* |
| 3 | +/** |
4 | 4 | * This program is free software; you can redistribute it and/or modify |
5 | 5 | * it under the terms of the GNU General Public License as published by |
6 | 6 | * the Free Software Foundation; either version 2 of the License, or |
7 | 7 | * (at your option) any later version. |
8 | 8 | * |
| 9 | + * @file |
| 10 | + * @ingroup Extensions |
| 11 | + * @version 1.3 |
9 | 12 | * @author Stephanie Amanda Stevens <phroziac@gmail.com> |
10 | 13 | * @author SPQRobin <robin_1273@hotmail.com> |
11 | | - * @copyright Copyright (C) 2005-2007 Stephanie Amanda Stevens |
12 | | - * @copyright Copyright (C) 2007 SPQRobin |
| 14 | + * @copyright Copyright © 2005-2007 Stephanie Amanda Stevens |
| 15 | + * @copyright Copyright © 2007 SPQRobin |
13 | 16 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 17 | + * @link http://www.mediawiki.org/wiki/Extension:SpecialInterwiki Documentation |
14 | 18 | * Formatting improvements Stephen Kennedy, 2006. |
15 | 19 | */ |
16 | 20 | |
17 | | -if (!defined('MEDIAWIKI')) die(); |
| 21 | +if( !defined( 'MEDIAWIKI' ) ){ |
| 22 | + die( "This is not a valid entry point.\n" ); |
| 23 | +} |
18 | 24 | |
| 25 | +// Extension credits for Special:Version |
19 | 26 | $wgExtensionCredits['specialpage'][] = array( |
20 | | - 'path' => __FILE__, |
21 | | - 'name' => 'SpecialInterwiki', |
22 | | - 'url' => 'http://mediawiki.org/wiki/Extension:SpecialInterwiki', |
23 | | - 'description' => 'Adds a [[Special:Interwiki|special page]] to view and edit the interwiki table', |
24 | | - 'author' => array( 'Stephanie Amanda Stevens', 'SPQRobin', 'others' ), |
| 27 | + 'path' => __FILE__, |
| 28 | + 'name' => 'SpecialInterwiki', |
| 29 | + 'author' => array( 'Stephanie Amanda Stevens', 'SPQRobin', 'others' ), |
| 30 | + 'version' => '1.3', |
| 31 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:SpecialInterwiki', |
| 32 | + 'description' => 'Adds a [[Special:Interwiki|special page]] to view and edit the interwiki table', |
25 | 33 | 'descriptionmsg' => 'interwiki-desc', |
26 | 34 | ); |
27 | 35 | |
28 | | -$dir = dirname(__FILE__) . '/'; |
| 36 | +// Set up the new special page |
| 37 | +$dir = dirname( __FILE__ ) . '/'; |
29 | 38 | $wgExtensionMessagesFiles['Interwiki'] = $dir . 'SpecialInterwiki.i18n.php'; |
30 | 39 | $wgExtensionAliasesFiles['Interwiki'] = $dir . 'SpecialInterwiki.alias.php'; |
31 | | - |
| 40 | +$wgAutoloadClasses['SpecialInterwiki'] = $dir . 'SpecialInterwiki_body.php'; |
32 | 41 | $wgSpecialPages['Interwiki'] = 'SpecialInterwiki'; |
33 | 42 | $wgSpecialPageGroups['Interwiki'] = 'wiki'; |
34 | | -$wgAutoloadClasses['SpecialInterwiki'] = $dir . 'SpecialInterwiki_body.php'; |
35 | 43 | |
| 44 | +// New user right, required to modify the interwiki table through Special:Interwiki |
36 | 45 | $wgAvailableRights[] = 'interwiki'; |
37 | 46 | |
| 47 | +// Set up the new log type - interwiki actions are logged to this new log |
38 | 48 | $wgLogTypes[] = 'interwiki'; |
39 | 49 | $wgLogNames['interwiki'] = 'interwiki_logpagename'; |
40 | 50 | $wgLogHeaders['interwiki'] = 'interwiki_logpagetext'; |
41 | 51 | $wgLogActions['interwiki/interwiki'] = 'interwiki_logentry'; |
42 | 52 | $wgLogActions['interwiki/iw_add'] = 'interwiki_log_added'; |
43 | 53 | $wgLogActions['interwiki/iw_delete'] = 'interwiki_log_deleted'; |
44 | | -$wgLogActions['interwiki/iw_edit'] = 'interwiki_log_edited'; |
| 54 | +$wgLogActions['interwiki/iw_edit'] = 'interwiki_log_edited'; |
\ No newline at end of file |
Index: trunk/extensions/Interwiki/SpecialInterwiki.css |
— | — | @@ -1,24 +1,21 @@ |
2 | | - |
3 | 2 | /** |
4 | 3 | * CSS for Special:Interwiki |
5 | 4 | */ |
6 | | - |
7 | | -table.mw-interwikitable.intro th { |
8 | | - padding-right: 1.4ex; |
9 | | - vertical-align: top; |
| 5 | +table.mw-interwikitable.intro th { |
| 6 | + padding-right: 1.4ex; |
| 7 | + vertical-align: top; |
10 | 8 | } |
11 | 9 | |
12 | | -table.mw-interwikitable.intro th.mw-align-left { |
13 | | - text-align: left; |
| 10 | +table.mw-interwikitable.intro th.mw-align-left { |
| 11 | + text-align: left; |
14 | 12 | } |
15 | 13 | |
16 | | -table.mw-interwikitable.intro th.mw-align-right { |
17 | | - text-align: right; |
| 14 | +table.mw-interwikitable.intro th.mw-align-right { |
| 15 | + text-align: right; |
18 | 16 | } |
19 | 17 | |
20 | 18 | table.mw-interwikitable.body td.mw-interwikitable-local, |
21 | 19 | table.mw-interwikitable.body td.mw-interwikitable-trans, |
22 | 20 | table.mw-interwikitable.body td.mw-interwikitable-modify { |
23 | | - text-align: center; |
24 | | -} |
25 | | - |
| 21 | + text-align: center; |
| 22 | +} |
\ No newline at end of file |