Example #1
0
/**
 * Constructor.
 */
function wfSpecialAllmessages()
{
    global $wgOut, $wgRequest, $wgMessageCache, $wgTitle;
    global $wgUseDatabaseMessages;
    # The page isn't much use if the MediaWiki namespace is not being used
    if (!$wgUseDatabaseMessages) {
        $wgOut->addWikiMsg('allmessagesnotsupportedDB');
        return;
    }
    wfProfileIn(__METHOD__);
    wfProfileIn(__METHOD__ . '-setup');
    $ot = $wgRequest->getText('ot');
    $navText = wfMsg('allmessagestext');
    # Make sure all extension messages are available
    $wgMessageCache->loadAllMessages();
    $wgOut->addScript("<script src='/skins/common/allmessages.js'></script>");
    $sortedArray = array_merge(Language::getMessagesFor('en'), $wgMessageCache->getExtensionMessagesFor('en'));
    ksort($sortedArray);
    $messages = array();
    $wgMessageCache->disableTransform();
    foreach ($sortedArray as $key => $value) {
        $messages[$key]['enmsg'] = $value;
        $messages[$key]['statmsg'] = wfMsgNoDb($key);
        $messages[$key]['msg'] = wfMsg($key);
    }
    $wgMessageCache->enableTransform();
    wfProfileOut(__METHOD__ . '-setup');
    wfProfileIn(__METHOD__ . '-output');
    if ($ot == 'php') {
        $navText .= wfAllMessagesMakePhp($messages);
        $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();
            header('Content-type: text/xml');
            echo wfAllMessagesMakeXml($messages);
        } else {
            $wgOut->addHTML('<a href="' . $wgTitle->escapeLocalUrl('ot=php') . '">PHP</a> | ' . 'HTML |  <a href="' . $wgTitle->escapeLocalUrl('ot=xml') . '">XML</a>');
            $wgOut->addWikiText($navText);
            $wgOut->addHTML(wfAllMessagesMakeHTMLText($messages));
        }
    }
    wfProfileOut(__METHOD__ . '-output');
    wfProfileOut(__METHOD__);
}
Example #2
0
/**
 *
 */
function wfSpecialAllmessages()
{
    global $wgOut, $wgAllMessagesEn, $wgRequest, $wgMessageCache, $wgTitle;
    global $wgUseDatabaseMessages;
    # The page isn't much use if the MediaWiki namespace is not being used
    if (!$wgUseDatabaseMessages) {
        $wgOut->addWikiText(wfMsg('allmessagesnotsupportedDB'));
        return;
    }
    $fname = "wfSpecialAllMessages";
    wfProfileIn($fname);
    wfProfileIn("{$fname}-setup");
    $ot = $wgRequest->getText('ot');
    $navText = wfMsg('allmessagestext');
    # Make sure all extension messages are available
    wfLoadAllExtensions();
    $first = true;
    $sortedArray = array_merge($wgAllMessagesEn, $wgMessageCache->mExtensionMessages);
    ksort($sortedArray);
    $messages = array();
    $wgMessageCache->disableTransform();
    foreach ($sortedArray as $key => $value) {
        $messages[$key]['enmsg'] = is_array($value) ? $value['en'] : $value;
        $messages[$key]['statmsg'] = wfMsgNoDb($key);
        $messages[$key]['msg'] = wfMsg($key);
    }
    $wgMessageCache->enableTransform();
    wfProfileOut("{$fname}-setup");
    wfProfileIn("{$fname}-output");
    if ($ot == 'php') {
        $navText .= makePhp($messages);
        $wgOut->addHTML('PHP | <a href="' . $wgTitle->escapeLocalUrl('ot=html') . '">HTML</a><pre>' . htmlspecialchars($navText) . '</pre>');
    } else {
        $wgOut->addHTML('<a href="' . $wgTitle->escapeLocalUrl('ot=php') . '">PHP</a> | HTML');
        $wgOut->addWikiText($navText);
        $wgOut->addHTML(makeHTMLText($messages));
    }
    wfProfileOut("{$fname}-output");
    wfProfileOut($fname);
}
/**
 *
 */
function wfSpecialAllmessages()
{
    global $wgOut, $wgAllMessagesEn, $wgRequest, $wgMessageCache, $wgTitle;
    global $wgLanguageCode, $wgContLanguageCode, $wgContLang;
    global $wgUseDatabaseMessages;
    if (!$wgUseDatabaseMessages) {
        $wgOut->addHTML(wfMsg('allmessagesnotsupportedDB'));
        return;
    }
    $fname = "wfSpecialAllMessages";
    wfProfileIn($fname);
    wfProfileIn("{$fname}-setup");
    $ot = $wgRequest->getText('ot');
    $navText = wfMsg('allmessagestext');
    $first = true;
    $sortedArray = array_merge($wgAllMessagesEn, $wgMessageCache->mExtensionMessages);
    ksort($sortedArray);
    $messages = array();
    $wgMessageCache->disableTransform();
    foreach ($sortedArray as $key => $enMsg) {
        $messages[$key]['enmsg'] = $enMsg;
        $messages[$key]['statmsg'] = wfMsgNoDb($key);
        $messages[$key]['msg'] = wfMsg($key);
    }
    $wgMessageCache->enableTransform();
    wfProfileOut("{$fname}-setup");
    wfProfileIn("{$fname}-output");
    if ($ot == 'php') {
        $navText .= makePhp($messages);
        $wgOut->addHTML('PHP | <a href="' . $wgTitle->escapeLocalUrl('ot=html') . '">HTML</a><pre>' . htmlspecialchars($navText) . '</pre>');
    } else {
        $wgOut->addHTML('<a href="' . $wgTitle->escapeLocalUrl('ot=php') . '">PHP</a> | HTML');
        $wgOut->addWikiText($navText);
        $wgOut->addHTML(makeHTMLText($messages));
    }
    wfProfileOut("{$fname}-output");
    wfProfileOut($fname);
}