Some minor fixes:
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 11 Nov 2007 15:55:17 +0000 (15:55 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 11 Nov 2007 15:55:17 +0000 (15:55 +0000)
* Renamed ot=raw to ot=xml
* Added tooltip to randomincategory link on sidebar

includes/SpecialAllmessages.php
languages/messages/MessagesEn.php
skins/MonoBook.php

index d8b6acc..d44036f 100644 (file)
@@ -45,12 +45,13 @@ function wfSpecialAllmessages() {
        wfProfileIn( __METHOD__ . '-output' );
        if ( $ot == 'php' ) {
                $navText .= makePhp( $messages );
-               $wgOut->addHTML( 'PHP | <a href="' . $wgTitle->escapeLocalUrl( 'ot=html' ) . '">HTML</a> | <a href="' . $wgTitle->escapeLocalUrl( 'ot=raw' ) . '">Raw</a><pre>' . htmlspecialchars( $navText ) . '</pre>' );
-       } else if ( $ot == 'raw' ) {
+               $wgOut->addHTML( 'PHP | <a href="' . $wgTitle->escapeLocalUrl( 'ot=html' ) . '">HTML</a> | <a href="' . $wgTitle->escapeLocalUrl( 'ot=xml' ) . '">XML</a><pre>' . htmlspecialchars( $navText ) . '</pre>' );
+       } else if ( $ot == 'xml' ) {
                $wgOut->disable();
-               echo makeRaw( $messages );
+               header( 'Content-type: text/xml' );
+               echo makeXml( $messages );
        } else {
-               $wgOut->addHTML( '<a href="' . $wgTitle->escapeLocalUrl( 'ot=php' ) . '">PHP</a> | HTML |  <a href="' . $wgTitle->escapeLocalUrl( 'ot=raw' ) . '">Raw</a>' );
+               $wgOut->addHTML( '<a href="' . $wgTitle->escapeLocalUrl( 'ot=php' ) . '">PHP</a> | HTML |  <a href="' . $wgTitle->escapeLocalUrl( 'ot=xml' ) . '">XML</a>' );
                $wgOut->addWikiText( $navText );
                $wgOut->addHTML( makeHTMLText( $messages ) );
        }
@@ -59,13 +60,13 @@ function wfSpecialAllmessages() {
        wfProfileOut( __METHOD__ );
 }
 
-function makeRaw( $messages ) {
+function makeXml( $messages ) {
        global $wgLang;
        $lang = $wgLang->getCode();
        $txt = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
        $txt .= "<messages lang=\"$lang\">\n";
        foreach( $messages as $key => $m ) {
-               $txt .= "\t<message name=\"$key\">" . htmlspecialchars( "{$m['msg']}" ) . "</message>\n";
+               $txt .= "\t" . Xml::element( 'message', array( 'name' => $key ), $m['msg'] ) . "\n";
        }
        $txt .= "</messages>";
        return $txt;
index ca9cdc7..052cf73 100644 (file)
@@ -2294,6 +2294,7 @@ All transwiki import actions are logged at the [[Special:Log/import|import log]]
 'accesskey-n-sitesupport'           => '', # don't translate or duplicate this message to other languages
 'accesskey-t-whatlinkshere'         => 'j', # don't translate or duplicate this message to other languages
 'accesskey-t-recentchangeslinked'   => 'k', # don't translate or duplicate this message to other languages
+'accesskey-t-random'                => '', # don't translate or duplicate this message to other languages
 'accesskey-feed-rss'                => '', # don't translate or duplicate this message to other languages
 'accesskey-feed-atom'               => '', # don't translate or duplicate this message to other languages
 'accesskey-t-contributions'         => '', # don't translate or duplicate this message to other languages
@@ -2355,6 +2356,7 @@ All transwiki import actions are logged at the [[Special:Log/import|import log]]
 'tooltip-n-sitesupport'           => 'Support us',
 'tooltip-t-whatlinkshere'         => 'List of all wiki pages that link here',
 'tooltip-t-recentchangeslinked'   => 'Recent changes in pages linked from this page',
+'tooltip-t-random'                => 'Random page in this category',
 'tooltip-feed-rss'                => 'RSS feed for this page',
 'tooltip-feed-atom'               => 'Atom feed for this page',
 'tooltip-t-contributions'         => 'View the list of contributions of this user',
index fcf7d4b..1ebe71d 100644 (file)
@@ -224,7 +224,7 @@ class MonoBookTemplate extends QuickTemplate {
                
                if(!empty($this->data['nav_urls']['randomincategory']['href'])) { ?>
                                <li id="t-random"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['randomincategory']['href'])
-                               ?>"<?php echo $skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('randomincategory-toolbox') ?></a></li><?php
+                               ?>"<?php echo $skin->tooltipAndAccesskey('t-random') ?>><?php $this->msg('randomincategory-toolbox') ?></a></li><?php
                }
 
                wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );