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 ) );
}
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;
'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
'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',
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 ) );