r55617 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55616‎ | r55617 | r55618 >
Date:13:02, 27 August 2009
Author:ashley
Status:deferred
Tags:
Comment:
Interwiki:
*cleanup
*add version number
*code comments
*if DB is locked, don't allow editing/adding/deleting prefixes
Modified paths:
  • /trunk/extensions/Interwiki/SpecialInterwiki.alias.php (modified) (history)
  • /trunk/extensions/Interwiki/SpecialInterwiki.css (modified) (history)
  • /trunk/extensions/Interwiki/SpecialInterwiki.i18n.php (modified) (history)
  • /trunk/extensions/Interwiki/SpecialInterwiki.php (modified) (history)
  • /trunk/extensions/Interwiki/SpecialInterwiki_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Interwiki/SpecialInterwiki.alias.php
@@ -2,7 +2,8 @@
33 /**
44 * Aliases for Special:Interwiki
55 *
6 - * @addtogroup Extensions
 6+ * @file
 7+ * @ingroup Extensions
78 */
89
910 $aliases = array();
@@ -11,7 +12,7 @@
1213 * @author Jon Harald Søby
1314 */
1415 $aliases['en'] = array(
15 - 'Interwiki' => array('Interwiki'),
 16+ 'Interwiki' => array( 'Interwiki' ),
1617 );
1718
1819 /** Arabic (العربية)
Index: trunk/extensions/Interwiki/SpecialInterwiki_body.php
@@ -1,14 +1,23 @@
22 <?php
33 /**
4 - * implements Special:Interwiki
 4+ * Implements Special:Interwiki
55 * @ingroup SpecialPage
66 */
77 class SpecialInterwiki extends SpecialPage {
8 - function __construct() {
 8+
 9+ /**
 10+ * Constructor - sets up the new special page
 11+ */
 12+ public function __construct() {
913 parent::__construct( 'Interwiki' );
1014 }
1115
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 ) {
1322 global $wgRequest, $wgOut, $wgUser;
1423
1524 wfLoadExtensionMessages( 'Interwiki' );
@@ -20,27 +29,40 @@
2130
2231 $admin = $wgUser->isAllowed( 'interwiki' );
2332 if ( $admin ) {
24 - $wgOut->setPagetitle( wfMsg( 'interwiki' ) );
 33+ $wgOut->setPageTitle( wfMsg( 'interwiki' ) );
2534 } else {
26 - $wgOut->setPagetitle( wfMsg( 'interwiki-title-norights' ) );
 35+ $wgOut->setPageTitle( wfMsg( 'interwiki-title-norights' ) );
2736 }
2837 $action = $wgRequest->getVal( 'action', $par );
2938
3039 switch( $action ){
31 - case "delete":
32 - case "edit" :
33 - case "add" :
 40+ case 'delete':
 41+ case 'edit':
 42+ case 'add':
 43+ // Check permissions
3444 if( !$admin ){
35 - $wgOut->permissionRequired('interwiki');
 45+ $wgOut->permissionRequired( 'interwiki' );
3646 return;
3747 }
 48+ // Is the database in read-only mode?
 49+ if( wfReadOnly() ) {
 50+ $wgOut->readOnlyPage();
 51+ return;
 52+ }
3853 $this->showForm( $action );
3954 break;
40 - case "submit":
 55+ case 'submit':
 56+ // Check permissions
4157 if( !$admin ){
4258 $wgOut->permissionRequired( 'interwiki' );
4359 return;
4460 }
 61+ // Is the database in read-only mode?
 62+ if( wfReadOnly() ) {
 63+ $wgOut->readOnlyPage();
 64+ return;
 65+ }
 66+ // Prevent cross-site request forgeries
4567 if( !$wgRequest->wasPosted() || !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
4668 $wgOut->addWikiMsg( 'sessionfailure' );
4769 return;
@@ -55,13 +77,13 @@
5678
5779 function showForm( $action ) {
5880 global $wgRequest, $wgUser, $wgOut;
59 -
 81+
6082 $actionUrl = $this->getTitle()->getLocalURL( 'action=submit' );
6183 $token = $wgUser->editToken();
6284 $defaultreason = $wgRequest->getVal( 'wpInterwikiReason', wfMsgForContent( 'interwiki_defaultreason' ) );
63 -
 85+
6486 switch( $action ){
65 - case "delete":
 87+ case 'delete':
6688
6789 $prefix = $wgRequest->getVal( 'prefix' );
6890 $button = wfMsg( 'delete' );
@@ -72,13 +94,13 @@
7395 $wgOut->addHTML(
7496 Xml::openElement( 'fieldset' ) .
7597 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 ) ) .
7799 Xml::openElement( 'table' ) .
78100 "<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>' .
80102 '<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>' .
83105 '<tr><td class="mw-submit">' . Xml::submitButton( $button, array( 'id' => 'mw-interwiki-submit' ) ) .
84106 Xml::hidden( 'wpInterwikiPrefix', $prefix ) .
85107 Xml::hidden( 'wpInterwikiAction', $action ) .
@@ -89,12 +111,12 @@
90112 Xml::closeElement( 'fieldset' )
91113 );
92114 break;
93 - case "edit" :
94 - case "add" :
95 - if( $action == "edit" ){
 115+ case 'edit':
 116+ case 'add':
 117+ if( $action == 'edit' ){
96118 $prefix = $wgRequest->getVal( 'prefix' );
97119 $dbr = wfGetDB( DB_SLAVE );
98 - $row = $dbr->selectRow( 'interwiki', '*', array( 'iw_prefix' => $prefix ) );
 120+ $row = $dbr->selectRow( 'interwiki', '*', array( 'iw_prefix' => $prefix ), __METHOD__ );
99121 if( !$row ){
100122 $this->error( 'interwiki_editerror', $prefix );
101123 return;
@@ -109,7 +131,7 @@
110132 $button = wfMsg( 'edit' );
111133 } else {
112134 $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' ) );
114136 $local = $wgRequest->getCheck( 'wpInterwikiLocal' );
115137 $trans = $wgRequest->getCheck( 'wpInterwikiTrans' );
116138 $old = '';
@@ -129,22 +151,22 @@
130152 Xml::openElement( 'fieldset' ) .
131153 Xml::element( 'legend', null, $topmessage ) .
132154 $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" ) ) .
135157 "<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>' .
138160 '<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>' .
140162 '<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>' .
142164 '<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' ) ) .
144166 Xml::hidden( 'wpInterwikiAction', $action ) .
145167 $old .
146168 Xml::hidden( 'wpEditToken', $token ) .
147169 '</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>' .
149171 Xml::closeElement( 'table' ) .
150172 Xml::closeElement( 'form' ) .
151173 Xml::closeElement( 'fieldset' )
@@ -166,21 +188,21 @@
167189 $selfTitle = $this->getTitle();
168190 $dbw = wfGetDB( DB_MASTER );
169191 switch( $do ){
170 - case "delete":
 192+ case 'delete':
171193 $dbw->delete( 'interwiki', array( 'iw_prefix' => $prefix ), __METHOD__ );
172194
173195 if ( $dbw->affectedRows() == 0 ) {
174196 $this->error( 'interwiki_delfailed', $prefix );
175197 $this->showForm( $do );
176198 } else {
177 - $wgOut->addWikiText( wfMsg( 'interwiki_deleted', $prefix ));
 199+ $wgOut->addWikiMsg( 'interwiki_deleted', $prefix );
178200 $wgOut->returnToMain( false, $selfTitle );
179201 $log = new LogPage( 'interwiki' );
180202 $log->addEntry( 'iw_delete', $selfTitle, $reason, array( $prefix ) );
181203 }
182204 break;
183 - case "edit":
184 - case "add":
 205+ case 'edit':
 206+ case 'add':
185207 $theurl = $wgRequest->getVal( 'wpInterwikiURL' );
186208 $local = $wgRequest->getCheck( 'wpInterwikiLocal' ) ? 1 : 0;
187209 $trans = $wgRequest->getCheck( 'wpInterwikiTrans' ) ? 1 : 0;
@@ -200,16 +222,16 @@
201223 $wgOut->addWikiMsg( "interwiki_{$do}ed", $prefix );
202224 $wgOut->returnToMain( false, $selfTitle );
203225 $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 ) );
205227 }
206228 break;
207229 }
208230 }
209231
210232 function trans_local( $tl, $msg0, $msg1 ) {
211 - if( $tl==='0' )
 233+ if( $tl === '0' )
212234 return $msg0;
213 - if( $tl==='1' )
 235+ if( $tl === '1' )
214236 return $msg1;
215237 return htmlspecialchars( $tl );
216238 }
@@ -243,6 +265,7 @@
244266 $wgOut->addWikiMsg( 'interwiki_intro_footer' );
245267 $selfTitle = $this->getTitle();
246268
 269+ // Privileged users can add new prefixes
247270 if ( $admin ) {
248271 $skin = $wgUser->getSkin();
249272 $addtext = wfMsgHtml( 'interwiki_addtext' );
@@ -251,23 +274,25 @@
252275 }
253276
254277 $dbr = wfGetDB( DB_SLAVE );
255 - $res = $dbr->select( 'interwiki', '*' );
 278+ $res = $dbr->select( 'interwiki', '*', false, __METHOD__ );
256279 $numrows = $res->numRows();
257280 if ( $numrows == 0 ) {
 281+ // If the interwiki table is empty, display an error message
258282 $this->error( 'interwiki_error' );
259283 return;
260284 }
261 -
 285+
262286 $out = "
263287 <table width='100%' class='mw-interwikitable wikitable body'>
264288 <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
265290 if( $admin ) {
266291 $deletemessage = wfMsgHtml( 'delete' );
267292 $editmessage = wfMsgHtml( 'edit' );
268 - $out .= '<th>'.wfMsgHtml( 'interwiki_edit' ).'</th>';
 293+ $out .= '<th>' . wfMsgHtml( 'interwiki_edit' ) . '</th>';
269294 }
270295 $out .= "</tr>\n";
271 -
 296+
272297 while( $s = $res->fetchObject() ) {
273298 $prefix = htmlspecialchars( $s->iw_prefix );
274299 $url = htmlspecialchars( $s->iw_url );
@@ -291,13 +316,14 @@
292317 $out .= "\n</tr>\n";
293318 }
294319 $res->free();
295 - $out .= "</table><br />";
 320+ $out .= '</table><br />';
296321 $wgOut->addHTML( $out );
297322 }
298 -
 323+
299324 function error() {
300325 global $wgOut;
301326 $args = func_get_args();
302327 $wgOut->wrapWikiMsg( "<p class='error'>$1</p>", $args );
303328 }
304 -}
 329+
 330+}
\ No newline at end of file
Index: trunk/extensions/Interwiki/SpecialInterwiki.i18n.php
@@ -1,8 +1,9 @@
22 <?php
33 /**
4 - * Internationalisation file for extension Interwiki.
 4+ * Internationalisation file for Interwiki extension.
55 *
6 - * @addtogroup Extensions
 6+ * @file
 7+ * @ingroup Extensions
78 *
89 * This program is free software; you can redistribute it and/or modify
910 * it under the terms of the GNU General Public License as published by
@@ -25,68 +26,68 @@
2627 */
2728 $messages['en'] = array(
2829 # general messages
29 - 'interwiki' => 'View and edit interwiki data',
 30+ 'interwiki' => 'View and edit interwiki data',
3031 '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.
4647 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.',
5051
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',
5556
5657 # 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.',
6162
6263 # 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.
6566 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.
6970 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
7172
7273 # 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.
7576 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.
7879 Possibly it does not exist.',
7980 'interwiki-badprefix' => 'Specified interwiki prefix "$1" contains invalid characters',
8081
8182 # 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
8889
8990 # rights
90 - 'right-interwiki' => 'Edit interwiki data',
 91+ 'right-interwiki' => 'Edit interwiki data',
9192 'action-interwiki' => 'change this interwiki entry',
9293 );
9394
Index: trunk/extensions/Interwiki/SpecialInterwiki.php
@@ -1,43 +1,53 @@
22 <?php
3 -/*
 3+/**
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
66 * the Free Software Foundation; either version 2 of the License, or
77 * (at your option) any later version.
88 *
 9+ * @file
 10+ * @ingroup Extensions
 11+ * @version 1.3
912 * @author Stephanie Amanda Stevens <phroziac@gmail.com>
1013 * @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
1316 * @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
1418 * Formatting improvements Stephen Kennedy, 2006.
1519 */
1620
17 -if (!defined('MEDIAWIKI')) die();
 21+if( !defined( 'MEDIAWIKI' ) ){
 22+ die( "This is not a valid entry point.\n" );
 23+}
1824
 25+// Extension credits for Special:Version
1926 $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',
2533 'descriptionmsg' => 'interwiki-desc',
2634 );
2735
28 -$dir = dirname(__FILE__) . '/';
 36+// Set up the new special page
 37+$dir = dirname( __FILE__ ) . '/';
2938 $wgExtensionMessagesFiles['Interwiki'] = $dir . 'SpecialInterwiki.i18n.php';
3039 $wgExtensionAliasesFiles['Interwiki'] = $dir . 'SpecialInterwiki.alias.php';
31 -
 40+$wgAutoloadClasses['SpecialInterwiki'] = $dir . 'SpecialInterwiki_body.php';
3241 $wgSpecialPages['Interwiki'] = 'SpecialInterwiki';
3342 $wgSpecialPageGroups['Interwiki'] = 'wiki';
34 -$wgAutoloadClasses['SpecialInterwiki'] = $dir . 'SpecialInterwiki_body.php';
3543
 44+// New user right, required to modify the interwiki table through Special:Interwiki
3645 $wgAvailableRights[] = 'interwiki';
3746
 47+// Set up the new log type - interwiki actions are logged to this new log
3848 $wgLogTypes[] = 'interwiki';
3949 $wgLogNames['interwiki'] = 'interwiki_logpagename';
4050 $wgLogHeaders['interwiki'] = 'interwiki_logpagetext';
4151 $wgLogActions['interwiki/interwiki'] = 'interwiki_logentry';
4252 $wgLogActions['interwiki/iw_add'] = 'interwiki_log_added';
4353 $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 -
32 /**
43 * CSS for Special:Interwiki
54 */
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;
108 }
119
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;
1412 }
1513
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;
1816 }
1917
2018 table.mw-interwikitable.body td.mw-interwikitable-local,
2119 table.mw-interwikitable.body td.mw-interwikitable-trans,
2220 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

Status & tagging log