r23475 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23474‎ | r23475 | r23476 >
Date:13:55, 27 June 2007
Author:brion
Status:old
Tags:
Comment:
Revert r23471, r23474: restore Special:Version to working, non-ugly state
Was spitting out PHP warnings and something was badly broken in the style
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/SpecialVersion.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesId.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)
  • /trunk/phase3/skins/monobook/handheld.css (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -2130,26 +2130,6 @@
21312131 'lag-warn-normal',
21322132 'lag-warn-high',
21332133 ),
2134 - 'version' => array(
2135 - 'version-extensions',
2136 - 'version-specialpages',
2137 - 'version-parserhooks',
2138 - 'version-variables',
2139 - 'version-other',
2140 - 'version-hooks',
2141 - 'version-licence',
2142 - 'version-licence-header',
2143 - 'version-licence-text',
2144 - 'version-system',
2145 - 'version-extension-functions',
2146 - 'version-parser-extensiontags',
2147 - 'version-parser-function-hooks',
2148 - 'version-skin-extension-functions',
2149 - 'version-hook-name',
2150 - 'version-hook-subscribedby',
2151 - 'version-software',
2152 - 'version-version',
2153 - ),
21542134 );
21552135 /** Comments for each block */
21562136 $wgBlockComments = array(
@@ -2316,7 +2296,6 @@
23172297 'sizeunits' => 'Size units',
23182298 'livepreview' => 'Live preview',
23192299 'lagwarning' => 'Friendlier slave lag warnings',
2320 - 'version' => 'Special:Version',
23212300 );
23222301
23232302 /** Short comments for standalone messages */
@@ -2335,7 +2314,6 @@
23362315 'exif-orientation-7' => '0th row: right; 0th column: bottom',
23372316 'exif-orientation-8' => '0th row: left; 0th column: bottom',
23382317 'autoredircomment' => 'This should be changed to the new naming convention, but existed beforehand',
2339 - 'version-version' => 'See [[Special:Version]] for the original licence text in English.',
23402318 );
23412319
23422320 /** Messages which contain dollar signs (which are not followed by numbers), and therefore should use a single apostrophe */
Index: trunk/phase3/skins/monobook/handheld.css
@@ -1245,18 +1245,17 @@
12461246
12471247 /** Special:Version */
12481248
1249 -table#sv-ext, table#sv-hooks, table#sv-software {
 1249+table#sv-ext, table#sv-hooks {
12501250 margin: 1em;
12511251 padding:0em;
1252 - border-collapse: collapse;
12531252 }
12541253
1255 -#sv-ext td, #sv-hooks td, #sv-software td
1256 -#sv-ext th, #sv-hooks th, #sv-software th {
 1254+#sv-ext td, #sv-hooks td,
 1255+#sv-ext th, #sv-hooks th {
12571256 border: 1px solid #A0A0A0;
12581257 padding: 0 0.15em 0 0.15em;
12591258 }
1260 -#sv-ext th, #sv-hooks th, #sv-software th {
 1259+#sv-ext th, #sv-hooks th {
12611260 background-color: #F0F0F0;
12621261 color: black;
12631262 padding: 0 0.15em 0 0.15em;
@@ -1300,4 +1299,4 @@
13011300 /* Kill big bulky stuff that will clog up the screen */
13021301 display: none;
13031302 }
1304 -}
 1303+}
\ No newline at end of file
Index: trunk/phase3/skins/monobook/main.css
@@ -1539,18 +1539,17 @@
15401540
15411541 /** Special:Version */
15421542
1543 -table#sv-ext, table#sv-hooks, table#sv-software {
 1543+table#sv-ext, table#sv-hooks {
15441544 margin: 1em;
15451545 padding:0em;
1546 - border-collapse: collapse;
15471546 }
15481547
1549 -#sv-ext td, #sv-hooks td, #sv-software td,
1550 -#sv-ext th, #sv-hooks th, #sv-software th {
 1548+#sv-ext td, #sv-hooks td,
 1549+#sv-ext th, #sv-hooks th {
15511550 border: 1px solid #A0A0A0;
15521551 padding: 0 0.15em 0 0.15em;
15531552 }
1554 -#sv-ext th, #sv-hooks th, #sv-software th {
 1553+#sv-ext th, #sv-hooks th {
15551554 background-color: #F0F0F0;
15561555 color: black;
15571556 padding: 0 0.15em 0 0.15em;
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1197,7 +1197,7 @@
11981198 * to ensure that client-side caches don't keep obsolete copies of global
11991199 * styles.
12001200 */
1201 -$wgStyleVersion = '78';
 1201+$wgStyleVersion = '77';
12021202
12031203
12041204 # Server-side caching:
Index: trunk/phase3/includes/SpecialVersion.php
@@ -26,13 +26,14 @@
2727 function execute() {
2828 global $wgOut;
2929
 30+ $wgOut->addHTML( '<div dir="ltr">' );
3031 $wgOut->addWikiText(
3132 $this->MediaWikiCredits() .
32 - $this->systemInformation() .
3333 $this->extensionCredits() .
3434 $this->wgHooks()
3535 );
3636 $wgOut->addHTML( $this->IPInfo() );
 37+ $wgOut->addHTML( '</div>' );
3738 }
3839
3940 /**#@+
@@ -45,11 +46,11 @@
4647 * @static
4748 */
4849 function MediaWikiCredits() {
49 - $ret = "<h2>" . wfMsgExt( 'version-licence', array( 'parseinline' ) ) . "</h2>\n";
 50+ $version = self::getVersion();
 51+ $dbr = wfGetDB( DB_SLAVE );
5052
51 - $ret .=
 53+ $ret =
5254 "__NOTOC__
53 - <div dir='ltr'>
5455 This wiki is powered by '''[http://www.mediawiki.org/ MediaWiki]''',
5556 copyright (C) 2001-2007 Magnus Manske, Brion Vibber, Lee Daniel Crocker,
5657 Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason,
@@ -69,13 +70,11 @@
7071 along with this program; if not, write to the Free Software
7172 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
7273 or [http://www.gnu.org/copyleft/gpl.html read it online]
73 - </div>";
7474
75 - $translation = wfMsgExt( 'version-licence-text', array( 'parseline' ) );
76 - if( !( wfEmptyMsg( 'version-licence-text', $translation ) || $translation == '-' || $translation == '' ) ) {
77 - $ret .= "<h3>" . wfMsgExt( 'version-licence-header', array( 'parseinline' ) ) . "</h3>\n";
78 - $ret .= $translation;
79 - }
 75+ * [http://www.mediawiki.org/ MediaWiki]: $version
 76+ * [http://www.php.net/ PHP]: " . phpversion() . " (" . php_sapi_name() . ")
 77+ * " . $dbr->getSoftwareLink() . ": " . $dbr->getServerVersion();
 78+
8079 return str_replace( "\t\t", '', $ret ) . "\n";
8180 }
8281
@@ -94,15 +93,15 @@
9594 return '';
9695
9796 $extensionTypes = array(
98 - 'specialpage' => wfMsgExt( 'version-specialpages', array( 'parseinline' ) ),
99 - 'parserhook' => wfMsgExt( 'version-parserhooks', array( 'parseinline' ) ),
100 - 'variable' => wfMsgExt( 'version-variables', array( 'parseinline' ) ),
101 - 'other' => wfMsgExt( 'version-other', array( 'parseinline' ) ),
 97+ 'specialpage' => 'Special pages',
 98+ 'parserhook' => 'Parser hooks',
 99+ 'variable' => 'Variables',
 100+ 'other' => 'Other',
102101 );
103102 wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) );
104103
105 - $out = "<h2>" . wfMsgExt( 'version-extensions', array( 'parseinline' ) ) . "</h2>\n";
106 - $out .= Xml::openElement( 'table', array('id' => 'sv-ext', 'dir' => 'ltr' ) );
 104+ $out = "<h2>Extensions</h2>\n";
 105+ $out .= wfOpenElement('table', array('id' => 'sv-ext') );
107106
108107 foreach ( $extensionTypes as $type => $text ) {
109108 if ( isset ( $wgExtensionCredits[$type] ) && count ( $wgExtensionCredits[$type] ) ) {
@@ -123,27 +122,27 @@
124123 }
125124
126125 if ( count( $wgExtensionFunctions ) ) {
127 - $out .= $this->openExtType( wfMsgExt( 'version-extension-functions', array( 'parseinline' ) ) );
 126+ $out .= $this->openExtType('Extension functions');
128127 $out .= '<tr><td colspan="3">' . $this->listToText( $wgExtensionFunctions ) . "</td></tr>\n";
129128 }
130129
131130 if ( $cnt = count( $tags = $wgParser->getTags() ) ) {
132131 for ( $i = 0; $i < $cnt; ++$i )
133132 $tags[$i] = "&lt;{$tags[$i]}&gt;";
134 - $out .= $this->openExtType( wfMsgExt( 'version-parser-extensiontags', array( 'parseinline' ) ) );
 133+ $out .= $this->openExtType('Parser extension tags');
135134 $out .= '<tr><td colspan="3">' . $this->listToText( $tags ). "</td></tr>\n";
136135 }
137136
138137 if( $cnt = count( $fhooks = $wgParser->getFunctionHooks() ) ) {
139 - $out .= $this->openExtType( wfMsgExt( 'version-parser-function-hooks', array( 'parseinline' ) ) );
 138+ $out .= $this->openExtType('Parser function hooks');
140139 $out .= '<tr><td colspan="3">' . $this->listToText( $fhooks ) . "</td></tr>\n";
141140 }
142141
143142 if ( count( $wgSkinExtensionFunction ) ) {
144 - $out .= $this->openExtType( wfMsgExt( 'version-skin-extension-functions', array( 'parseinline' ) ) );
 143+ $out .= $this->openExtType('Skin extension functions');
145144 $out .= '<tr><td colspan="3">' . $this->listToText( $wgSkinExtensionFunction ) . "</td></tr>\n";
146145 }
147 - $out .= Xml::closeElement( 'table' );
 146+ $out .= wfCloseElement( 'table' );
148147 return $out;
149148 }
150149
@@ -182,65 +181,32 @@
183182 $myWgHooks = $wgHooks;
184183 ksort( $myWgHooks );
185184
186 - $ret = "<h2>" . wfMsgExt( 'version-hooks', array( 'parseinline' ) ) . "</h2>\n";
187 - $ret .= Xml::openElement( 'table', array( 'id' => 'sv-hooks', 'dir' => 'ltr' ) );
188 - $ret .= "<tr>
189 - <th>" . wfMsgExt( 'version-hook-name', array( 'parseinline' ) ) . "</th>
190 - <th>" . wfMsgExt( 'version-hook-subscribedby', array( 'parseinline' ) ) . "</th>
191 - </tr>\n";
 185+ $ret = "<h2>Hooks</h2>\n"
 186+ . wfOpenElement('table', array('id' => 'sv-hooks') )
 187+ . "<tr><th>Hook name</th><th>Subscribed by</th></tr>\n";
192188
193189 foreach ($myWgHooks as $hook => $hooks)
194 - $ret .= "<tr>
195 - <td>$hook</td>
196 - <td>" . $this->listToText( $hooks ) . "</td>
197 - </tr>\n";
 190+ $ret .= "<tr><td>$hook</td><td>" . $this->listToText( $hooks ) . "</td></tr>\n";
198191
199 - $ret .= Xml::closeElement( 'table' );
 192+ $ret .= '</table>';
200193 return $ret;
201194 } else
202195 return '';
203196 }
204197
205 - function systemInformation() {
206 - $version = self::getVersion();
207 - $dbr = wfGetDB( DB_SLAVE );
208 -
209 - $ret = "<h2>" . wfMsgExt( 'version-system', array( 'parseinline' ) ) . "</h2>\n";
210 - $ret .= Xml::openElement( 'table', array( 'id' => 'sv-software', 'dir' => 'ltr' ) );
211 - $ret .= "<tr>
212 - <th>" . wfMsgExt( 'version-software', array( 'parseinline' ) ) . "</th>
213 - <th>" . wfMsgExt( 'version-version', array( 'parseinline' ) ) . "</th>
214 - </tr>
215 - <tr>
216 - <td>[http://www.mediawiki.org/ MediaWiki]:</td>
217 - <td>$version</td>
218 - </tr>
219 - <tr>
220 - <td>[http://www.php.net/ PHP]:</td>
221 - <td>" . phpversion() . " (" . php_sapi_name() . ")</td>
222 - </tr>
223 - <tr>
224 - <td>" . $dbr->getSoftwareLink() . ":</td>
225 - <td>" . $dbr->getServerVersion() . "</td>
226 - </tr>\n";
227 - $ret .= Xml::closeElement( 'table' );
228 -
229 - return $ret;
230 - }
231 -
232198 private function openExtType($text, $name = null) {
233199 $opt = array( 'colspan' => 3 );
234200 $out = '';
235201
236202 if(!$this->firstExtOpened) {
237203 // Insert a spacing line
238 - $out .= '<tr class="sv-space">' . Xml::tags( 'td', $opt, '' ) . "</tr>\n";
 204+ $out .= '<tr class="sv-space">' . wfElement( 'td', $opt ) . "</tr>\n";
239205 }
240206 $this->firstExtOpened = false;
241207
242208 if($name) { $opt['id'] = "sv-$name"; }
243209
244 - $out .= "<tr>" . Xml::tags( 'th', $opt, $text) . "</tr>\n";
 210+ $out .= "<tr>" . wfElement( 'th', $opt, $text) . "</tr>\n";
245211 return $out;
246212 }
247213
@@ -260,16 +226,42 @@
261227 * @return string
262228 */
263229 function listToText( $list ) {
 230+ $cnt = count( $list );
264231
265 - if ( count( $list ) ) {
266 - sort( $list );
267 - return implode( ', ', $list );
268 - } else {
 232+ if ( $cnt == 1 ) {
 233+ // Enforce always returning a string
 234+ return (string)$this->arrayToString( $list[0] );
 235+ } elseif ( $cnt == 0 ) {
269236 return '';
 237+ } else {
 238+ $t = array_slice( $list, 0, $cnt - 1 );
 239+ $one = array_map( array( &$this, 'arrayToString' ), $t );
 240+ $two = $this->arrayToString( $list[$cnt - 1] );
 241+
 242+ return implode( ', ', $one ) . " and $two";
270243 }
271244 }
272245
273246 /**
 247+ * @static
 248+ *
 249+ * @param mixed $list Will convert an array to string if given and return
 250+ * the paramater unaltered otherwise
 251+ * @return mixed
 252+ */
 253+ function arrayToString( $list ) {
 254+ if( is_object( $list ) ) {
 255+ $class = get_class( $list );
 256+ return "($class)";
 257+ } elseif ( ! is_array( $list ) ) {
 258+ return $list;
 259+ } else {
 260+ $class = get_class( $list[0] );
 261+ return "($class, {$list[1]})";
 262+ }
 263+ }
 264+
 265+ /**
274266 * Retrieve the revision number of a Subversion working directory.
275267 *
276268 * @param string $dir
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2908,26 +2908,6 @@
29092909 'lag-warn-high' => 'Due to high database server lag, changes newer than $1 seconds
29102910 may not be shown in this list.',
29112911
2912 -# Special:Version
2913 -'version-extensions' => 'Installed extensions',
2914 -'version-specialpages' => 'Special pages',
2915 -'version-parserhooks' => 'Parser hooks',
2916 -'version-variables' => 'Variables',
2917 -'version-other' => 'Other',
2918 -'version-hooks' => 'Hooks',
2919 -'version-licence' => 'Licence information',
2920 -'version-licence-header' => 'Translation without obligation:',
2921 -'version-licence-text' => '-', # See [[Special:Version]] for the original licence text in English.
2922 -'version-system' => 'System information',
2923 -'version-extension-functions' => 'Extension functions',
2924 -'version-parser-extensiontags' => 'Parser extension tags',
2925 -'version-parser-function-hooks' => 'Parser function hooks',
2926 -'version-skin-extension-functions' => 'Skin extension functions',
2927 -'version-hook-name' => 'Hook name',
2928 -'version-hook-subscribedby' => 'Subscribed by',
2929 -'version-software' => 'Software',
2930 -'version-version' => 'Version',
2931 -
29322912 );
29332913
29342914 ?>
Index: trunk/phase3/languages/messages/MessagesId.php
@@ -2269,25 +2269,6 @@
22702270 'lag-warn-normal' => 'Perubahan yang lebih baru dari $1 detik mungkin tidak muncul di daftar ini.',
22712271 'lag-warn-high' => 'Karenanya besarnya lag basis data server, perubahan yang lebih baru dari $1 detik mungkin tidak muncul di daftar ini.',
22722272
2273 -# Special:Version
2274 -'version-extensions' => 'Ekstensi terpasang',
2275 -'version-specialpages' => 'Halaman istimewa',
2276 -'version-parserhooks' => 'Kait pengurai',
2277 -'version-variables' => 'Variabel',
2278 -'version-other' => 'Lainnya',
2279 -'version-hooks' => 'Kait',
2280 -'version-licence' => 'Informasi lisensi',
2281 -'version-licence-header' => 'Terjemahan tanpa kewajiban:',
2282 -'version-system' => 'Informasi sistem',
2283 -'version-extension-functions' => 'Fungsi ekstensi',
2284 -'version-parser-extensiontags' => 'Tag ekstensi pengurai',
2285 -'version-parser-function-hooks' => 'Kait fungsi pengurai',
2286 -'version-skin-extension-functions' => 'Fungsi ekstensi kulit',
2287 -'version-hook-name' => 'Nama kait',
2288 -'version-hook-subscribedby' => 'Didaftarkan oleh',
2289 -'version-software' => 'Perangkat lunak',
2290 -'version-version' => 'Versi',
2291 -
22922273 );
22932274
22942275 ?>
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -2292,46 +2292,6 @@
22932293 'lag-warn-normal' => 'Bearbeitungen der letzten $1 Sekunden werden in dieser Liste noch nicht angezeigt.',
22942294 'lag-warn-high' => 'Auf Grund hoher Datenbankauslastung werden die Bearbeitungen der letzten $1 Sekunden in dieser Liste noch nicht angezeigt.',
22952295
2296 -# Special:Version
2297 -'version-extensions' => 'Installierte Erweiterungen',
2298 -'version-specialpages' => 'Spezialseiten',
2299 -'version-parserhooks' => 'Parser-Hooks',
2300 -'version-variables' => 'Variablen',
2301 -'version-other' => 'Anderes',
2302 -'version-hooks' => "Schnittstellen ''(Hooks)''",
2303 -'version-licence' => 'Lizenz-Informationen',
2304 -'version-licence-header' => 'Unverbindliche Übersetzung:',
2305 -'version-licence-text' => "
2306 - Dieses Wiki basiert auf '''[http://www.mediawiki.org/ MediaWiki]''',
2307 - die Urheberrechte (C) 2001-2007 liegen bei Magnus Manske, Brion Vibber, Lee Daniel Crocker,
2308 - Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason,
2309 - Niklas Laxström, Domas Mituzas, Rob Church und anderen.
2310 -
2311 - MediaWiki ist eine freie Software; Sie dürfen sie weiterverteilen und/oder verändern,
2312 - sofern die Bedingungen der ''GNU General Public License'', veröffentlicht
2313 - durch die ''Free Software Foundation'' in Lizenzversion 2 oder
2314 - (nach Ihrer Wahl) jeder späteren Version, eingehalten werden.
2315 -
2316 - MediaWiki wird verteilt in der Hoffnung, dass sie nutzbar ist,
2317 - aber OHNE JEDE GARANTIE, es wird auch keine implizite GEBRAUCHSTAUGLICHKEIT
2318 - oder TAUGLICHKEIT FÜR BESONDERE ZWECKE zugesagt.
2319 - Siehe die ''GNU General Public License'' für weitere Details.
2320 -
2321 - Sie sollten eine [{{SERVER}}{{SCRIPTPATH}}/COPYING Kopie der ''GNU General Public License'']
2322 - zusammen mit dieser Software erhalten haben; falls diese fehlt, schreiben Sie an
2323 - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2324 - oder [http://www.gnu.org/copyleft/gpl.html lesen Sie sie online].
2325 -", # See [[Special:Version]] for the original licence text in English.
2326 -'version-system' => 'System-Informationen',
2327 -'version-extension-functions' => 'Funktionsaufrufe',
2328 -'version-parser-extensiontags' => "Parser-Erweiterungen ''(tags)''",
2329 -'version-parser-function-hooks' => 'Parser-Funktionen',
2330 -'version-skin-extension-functions' => 'Skin extension functions',
2331 -'version-hook-name' => 'Schnittstellenname',
2332 -'version-hook-subscribedby' => 'aufgerufen durch',
2333 -'version-software' => 'Software',
2334 -'version-Version' => 'Version',
2335 -
23362296 );
23372297
23382298 ?>
Index: trunk/phase3/RELEASE-NOTES
@@ -109,7 +109,6 @@
110110 classes: mw-code, mw-css, mw-js)
111111 * (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over
112112 usergroup assignment.
113 -* (bug 10365) Localization of Special:Version
114113
115114 == Bugfixes since 1.10 ==
116115

Follow-up revisions

RevisionCommit summaryAuthorDate
r23581Merged revisions 23406-23580 via svnmerge from...david04:50, 30 June 2007

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r23471* (bug 10365) Localization of Special:Version...raymond10:19, 27 June 2007
r23474Indonesian (id) localisation updates.ivanlanin13:01, 27 June 2007

Status & tagging log