From: Brion Vibber Date: Wed, 27 Jun 2007 13:55:59 +0000 (+0000) Subject: Revert r23471, r23474: restore Special:Version to working, non-ugly state X-Git-Tag: 1.31.0-rc.0~52372 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=91d263ecdf97b51855208dfb4dc3d34e7d814d22;p=lhc%2Fweb%2Fwiklou.git Revert r23471, r23474: restore Special:Version to working, non-ugly state Was spitting out PHP warnings and something was badly broken in the style --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b056200e4e..ef4f213ff8 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -109,7 +109,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN classes: mw-code, mw-css, mw-js) * (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over usergroup assignment. -* (bug 10365) Localization of Special:Version == Bugfixes since 1.10 == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index fa44eb8158..62f08685cd 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1197,7 +1197,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '78'; +$wgStyleVersion = '77'; # Server-side caching: diff --git a/includes/SpecialVersion.php b/includes/SpecialVersion.php index 8c2fe9817c..0b63393e90 100644 --- a/includes/SpecialVersion.php +++ b/includes/SpecialVersion.php @@ -26,13 +26,14 @@ class SpecialVersion { function execute() { global $wgOut; + $wgOut->addHTML( '
' ); $wgOut->addWikiText( $this->MediaWikiCredits() . - $this->systemInformation() . $this->extensionCredits() . $this->wgHooks() ); $wgOut->addHTML( $this->IPInfo() ); + $wgOut->addHTML( '
' ); } /**#@+ @@ -45,11 +46,11 @@ class SpecialVersion { * @static */ function MediaWikiCredits() { - $ret = "

" . wfMsgExt( 'version-licence', array( 'parseinline' ) ) . "

\n"; + $version = self::getVersion(); + $dbr = wfGetDB( DB_SLAVE ); - $ret .= + $ret = "__NOTOC__ -
This wiki is powered by '''[http://www.mediawiki.org/ MediaWiki]''', copyright (C) 2001-2007 Magnus Manske, Brion Vibber, Lee Daniel Crocker, Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason, @@ -69,13 +70,11 @@ class SpecialVersion { along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. or [http://www.gnu.org/copyleft/gpl.html read it online] -
"; - $translation = wfMsgExt( 'version-licence-text', array( 'parseline' ) ); - if( !( wfEmptyMsg( 'version-licence-text', $translation ) || $translation == '-' || $translation == '' ) ) { - $ret .= "

" . wfMsgExt( 'version-licence-header', array( 'parseinline' ) ) . "

\n"; - $ret .= $translation; - } + * [http://www.mediawiki.org/ MediaWiki]: $version + * [http://www.php.net/ PHP]: " . phpversion() . " (" . php_sapi_name() . ") + * " . $dbr->getSoftwareLink() . ": " . $dbr->getServerVersion(); + return str_replace( "\t\t", '', $ret ) . "\n"; } @@ -94,15 +93,15 @@ class SpecialVersion { return ''; $extensionTypes = array( - 'specialpage' => wfMsgExt( 'version-specialpages', array( 'parseinline' ) ), - 'parserhook' => wfMsgExt( 'version-parserhooks', array( 'parseinline' ) ), - 'variable' => wfMsgExt( 'version-variables', array( 'parseinline' ) ), - 'other' => wfMsgExt( 'version-other', array( 'parseinline' ) ), + 'specialpage' => 'Special pages', + 'parserhook' => 'Parser hooks', + 'variable' => 'Variables', + 'other' => 'Other', ); wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) ); - $out = "

" . wfMsgExt( 'version-extensions', array( 'parseinline' ) ) . "

\n"; - $out .= Xml::openElement( 'table', array('id' => 'sv-ext', 'dir' => 'ltr' ) ); + $out = "

Extensions

\n"; + $out .= wfOpenElement('table', array('id' => 'sv-ext') ); foreach ( $extensionTypes as $type => $text ) { if ( isset ( $wgExtensionCredits[$type] ) && count ( $wgExtensionCredits[$type] ) ) { @@ -123,27 +122,27 @@ class SpecialVersion { } if ( count( $wgExtensionFunctions ) ) { - $out .= $this->openExtType( wfMsgExt( 'version-extension-functions', array( 'parseinline' ) ) ); + $out .= $this->openExtType('Extension functions'); $out .= '' . $this->listToText( $wgExtensionFunctions ) . "\n"; } if ( $cnt = count( $tags = $wgParser->getTags() ) ) { for ( $i = 0; $i < $cnt; ++$i ) $tags[$i] = "<{$tags[$i]}>"; - $out .= $this->openExtType( wfMsgExt( 'version-parser-extensiontags', array( 'parseinline' ) ) ); + $out .= $this->openExtType('Parser extension tags'); $out .= '' . $this->listToText( $tags ). "\n"; } if( $cnt = count( $fhooks = $wgParser->getFunctionHooks() ) ) { - $out .= $this->openExtType( wfMsgExt( 'version-parser-function-hooks', array( 'parseinline' ) ) ); + $out .= $this->openExtType('Parser function hooks'); $out .= '' . $this->listToText( $fhooks ) . "\n"; } if ( count( $wgSkinExtensionFunction ) ) { - $out .= $this->openExtType( wfMsgExt( 'version-skin-extension-functions', array( 'parseinline' ) ) ); + $out .= $this->openExtType('Skin extension functions'); $out .= '' . $this->listToText( $wgSkinExtensionFunction ) . "\n"; } - $out .= Xml::closeElement( 'table' ); + $out .= wfCloseElement( 'table' ); return $out; } @@ -182,65 +181,32 @@ class SpecialVersion { $myWgHooks = $wgHooks; ksort( $myWgHooks ); - $ret = "

" . wfMsgExt( 'version-hooks', array( 'parseinline' ) ) . "

\n"; - $ret .= Xml::openElement( 'table', array( 'id' => 'sv-hooks', 'dir' => 'ltr' ) ); - $ret .= " - " . wfMsgExt( 'version-hook-name', array( 'parseinline' ) ) . " - " . wfMsgExt( 'version-hook-subscribedby', array( 'parseinline' ) ) . " - \n"; + $ret = "

Hooks

\n" + . wfOpenElement('table', array('id' => 'sv-hooks') ) + . "Hook nameSubscribed by\n"; foreach ($myWgHooks as $hook => $hooks) - $ret .= " - $hook - " . $this->listToText( $hooks ) . " - \n"; + $ret .= "$hook" . $this->listToText( $hooks ) . "\n"; - $ret .= Xml::closeElement( 'table' ); + $ret .= ''; return $ret; } else return ''; } - function systemInformation() { - $version = self::getVersion(); - $dbr = wfGetDB( DB_SLAVE ); - - $ret = "

" . wfMsgExt( 'version-system', array( 'parseinline' ) ) . "

\n"; - $ret .= Xml::openElement( 'table', array( 'id' => 'sv-software', 'dir' => 'ltr' ) ); - $ret .= " - " . wfMsgExt( 'version-software', array( 'parseinline' ) ) . " - " . wfMsgExt( 'version-version', array( 'parseinline' ) ) . " - - - [http://www.mediawiki.org/ MediaWiki]: - $version - - - [http://www.php.net/ PHP]: - " . phpversion() . " (" . php_sapi_name() . ") - - - " . $dbr->getSoftwareLink() . ": - " . $dbr->getServerVersion() . " - \n"; - $ret .= Xml::closeElement( 'table' ); - - return $ret; - } - private function openExtType($text, $name = null) { $opt = array( 'colspan' => 3 ); $out = ''; if(!$this->firstExtOpened) { // Insert a spacing line - $out .= '' . Xml::tags( 'td', $opt, '' ) . "\n"; + $out .= '' . wfElement( 'td', $opt ) . "\n"; } $this->firstExtOpened = false; if($name) { $opt['id'] = "sv-$name"; } - $out .= "" . Xml::tags( 'th', $opt, $text) . "\n"; + $out .= "" . wfElement( 'th', $opt, $text) . "\n"; return $out; } @@ -260,15 +226,41 @@ class SpecialVersion { * @return string */ function listToText( $list ) { + $cnt = count( $list ); - if ( count( $list ) ) { - sort( $list ); - return implode( ', ', $list ); - } else { + if ( $cnt == 1 ) { + // Enforce always returning a string + return (string)$this->arrayToString( $list[0] ); + } elseif ( $cnt == 0 ) { return ''; + } else { + $t = array_slice( $list, 0, $cnt - 1 ); + $one = array_map( array( &$this, 'arrayToString' ), $t ); + $two = $this->arrayToString( $list[$cnt - 1] ); + + return implode( ', ', $one ) . " and $two"; } } + /** + * @static + * + * @param mixed $list Will convert an array to string if given and return + * the paramater unaltered otherwise + * @return mixed + */ + function arrayToString( $list ) { + if( is_object( $list ) ) { + $class = get_class( $list ); + return "($class)"; + } elseif ( ! is_array( $list ) ) { + return $list; + } else { + $class = get_class( $list[0] ); + return "($class, {$list[1]})"; + } + } + /** * Retrieve the revision number of a Subversion working directory. * diff --git a/languages/messages/MessagesDe.php b/languages/messages/MessagesDe.php index 5993b0280d..f145907220 100644 --- a/languages/messages/MessagesDe.php +++ b/languages/messages/MessagesDe.php @@ -2292,46 +2292,6 @@ Bitte bestätigen Sie, dass Sie diese Seite wirklich neu erstellen möchten.", 'lag-warn-normal' => 'Bearbeitungen der letzten $1 Sekunden werden in dieser Liste noch nicht angezeigt.', 'lag-warn-high' => 'Auf Grund hoher Datenbankauslastung werden die Bearbeitungen der letzten $1 Sekunden in dieser Liste noch nicht angezeigt.', -# Special:Version -'version-extensions' => 'Installierte Erweiterungen', -'version-specialpages' => 'Spezialseiten', -'version-parserhooks' => 'Parser-Hooks', -'version-variables' => 'Variablen', -'version-other' => 'Anderes', -'version-hooks' => "Schnittstellen ''(Hooks)''", -'version-licence' => 'Lizenz-Informationen', -'version-licence-header' => 'Unverbindliche Übersetzung:', -'version-licence-text' => " - Dieses Wiki basiert auf '''[http://www.mediawiki.org/ MediaWiki]''', - die Urheberrechte (C) 2001-2007 liegen bei Magnus Manske, Brion Vibber, Lee Daniel Crocker, - Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason, - Niklas Laxström, Domas Mituzas, Rob Church und anderen. - - MediaWiki ist eine freie Software; Sie dürfen sie weiterverteilen und/oder verändern, - sofern die Bedingungen der ''GNU General Public License'', veröffentlicht - durch die ''Free Software Foundation'' in Lizenzversion 2 oder - (nach Ihrer Wahl) jeder späteren Version, eingehalten werden. - - MediaWiki wird verteilt in der Hoffnung, dass sie nutzbar ist, - aber OHNE JEDE GARANTIE, es wird auch keine implizite GEBRAUCHSTAUGLICHKEIT - oder TAUGLICHKEIT FÜR BESONDERE ZWECKE zugesagt. - Siehe die ''GNU General Public License'' für weitere Details. - - Sie sollten eine [{{SERVER}}{{SCRIPTPATH}}/COPYING Kopie der ''GNU General Public License''] - zusammen mit dieser Software erhalten haben; falls diese fehlt, schreiben Sie an - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - oder [http://www.gnu.org/copyleft/gpl.html lesen Sie sie online]. -", # See [[Special:Version]] for the original licence text in English. -'version-system' => 'System-Informationen', -'version-extension-functions' => 'Funktionsaufrufe', -'version-parser-extensiontags' => "Parser-Erweiterungen ''(tags)''", -'version-parser-function-hooks' => 'Parser-Funktionen', -'version-skin-extension-functions' => 'Skin extension functions', -'version-hook-name' => 'Schnittstellenname', -'version-hook-subscribedby' => 'aufgerufen durch', -'version-software' => 'Software', -'version-Version' => 'Version', - ); ?> diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 3f86b915dd..57864be510 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2908,26 +2908,6 @@ Try normal preview.', 'lag-warn-high' => 'Due to high database server lag, changes newer than $1 seconds may not be shown in this list.', -# Special:Version -'version-extensions' => 'Installed extensions', -'version-specialpages' => 'Special pages', -'version-parserhooks' => 'Parser hooks', -'version-variables' => 'Variables', -'version-other' => 'Other', -'version-hooks' => 'Hooks', -'version-licence' => 'Licence information', -'version-licence-header' => 'Translation without obligation:', -'version-licence-text' => '-', # See [[Special:Version]] for the original licence text in English. -'version-system' => 'System information', -'version-extension-functions' => 'Extension functions', -'version-parser-extensiontags' => 'Parser extension tags', -'version-parser-function-hooks' => 'Parser function hooks', -'version-skin-extension-functions' => 'Skin extension functions', -'version-hook-name' => 'Hook name', -'version-hook-subscribedby' => 'Subscribed by', -'version-software' => 'Software', -'version-version' => 'Version', - ); ?> diff --git a/languages/messages/MessagesId.php b/languages/messages/MessagesId.php index e685c7564d..2127271d21 100644 --- a/languages/messages/MessagesId.php +++ b/languages/messages/MessagesId.php @@ -2269,25 +2269,6 @@ Coba dengan pratayang normal.', 'lag-warn-normal' => 'Perubahan yang lebih baru dari $1 detik mungkin tidak muncul di daftar ini.', 'lag-warn-high' => 'Karenanya besarnya lag basis data server, perubahan yang lebih baru dari $1 detik mungkin tidak muncul di daftar ini.', -# Special:Version -'version-extensions' => 'Ekstensi terpasang', -'version-specialpages' => 'Halaman istimewa', -'version-parserhooks' => 'Kait pengurai', -'version-variables' => 'Variabel', -'version-other' => 'Lainnya', -'version-hooks' => 'Kait', -'version-licence' => 'Informasi lisensi', -'version-licence-header' => 'Terjemahan tanpa kewajiban:', -'version-system' => 'Informasi sistem', -'version-extension-functions' => 'Fungsi ekstensi', -'version-parser-extensiontags' => 'Tag ekstensi pengurai', -'version-parser-function-hooks' => 'Kait fungsi pengurai', -'version-skin-extension-functions' => 'Fungsi ekstensi kulit', -'version-hook-name' => 'Nama kait', -'version-hook-subscribedby' => 'Didaftarkan oleh', -'version-software' => 'Perangkat lunak', -'version-version' => 'Versi', - ); ?> diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 728bba2a66..b9eb636343 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2130,26 +2130,6 @@ $wgMessageStructure = array( 'lag-warn-normal', 'lag-warn-high', ), - 'version' => array( - 'version-extensions', - 'version-specialpages', - 'version-parserhooks', - 'version-variables', - 'version-other', - 'version-hooks', - 'version-licence', - 'version-licence-header', - 'version-licence-text', - 'version-system', - 'version-extension-functions', - 'version-parser-extensiontags', - 'version-parser-function-hooks', - 'version-skin-extension-functions', - 'version-hook-name', - 'version-hook-subscribedby', - 'version-software', - 'version-version', - ), ); /** Comments for each block */ $wgBlockComments = array( @@ -2316,7 +2296,6 @@ Variants for Chinese language", 'sizeunits' => 'Size units', 'livepreview' => 'Live preview', 'lagwarning' => 'Friendlier slave lag warnings', - 'version' => 'Special:Version', ); /** Short comments for standalone messages */ @@ -2335,7 +2314,6 @@ $wgMessageComments = array( 'exif-orientation-7' => '0th row: right; 0th column: bottom', 'exif-orientation-8' => '0th row: left; 0th column: bottom', 'autoredircomment' => 'This should be changed to the new naming convention, but existed beforehand', - 'version-version' => 'See [[Special:Version]] for the original licence text in English.', ); /** Messages which contain dollar signs (which are not followed by numbers), and therefore should use a single apostrophe */ diff --git a/skins/monobook/handheld.css b/skins/monobook/handheld.css index a4cc92b46f..8f77c96995 100644 --- a/skins/monobook/handheld.css +++ b/skins/monobook/handheld.css @@ -1245,18 +1245,17 @@ table.multipageimage td { /** Special:Version */ -table#sv-ext, table#sv-hooks, table#sv-software { +table#sv-ext, table#sv-hooks { margin: 1em; padding:0em; - border-collapse: collapse; } -#sv-ext td, #sv-hooks td, #sv-software td -#sv-ext th, #sv-hooks th, #sv-software th { +#sv-ext td, #sv-hooks td, +#sv-ext th, #sv-hooks th { border: 1px solid #A0A0A0; padding: 0 0.15em 0 0.15em; } -#sv-ext th, #sv-hooks th, #sv-software th { +#sv-ext th, #sv-hooks th { background-color: #F0F0F0; color: black; padding: 0 0.15em 0 0.15em; @@ -1300,4 +1299,4 @@ tr.sv-space td { display: none; } /* Kill big bulky stuff that will clog up the screen */ display: none; } -} +} \ No newline at end of file diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 44b7fde3f8..7b8a08616c 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -1539,18 +1539,17 @@ table.multipageimage td { /** Special:Version */ -table#sv-ext, table#sv-hooks, table#sv-software { +table#sv-ext, table#sv-hooks { margin: 1em; padding:0em; - border-collapse: collapse; } -#sv-ext td, #sv-hooks td, #sv-software td, -#sv-ext th, #sv-hooks th, #sv-software th { +#sv-ext td, #sv-hooks td, +#sv-ext th, #sv-hooks th { border: 1px solid #A0A0A0; padding: 0 0.15em 0 0.15em; } -#sv-ext th, #sv-hooks th, #sv-software th { +#sv-ext th, #sv-hooks th { background-color: #F0F0F0; color: black; padding: 0 0.15em 0 0.15em;