/** * */ 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); }