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 MessageCache::loadAllMessages(); $first = true; $sortedArray = array_merge( Language::getMessagesFor( 'en' ), $wgMessageCache->getExtensionMessagesFor( 'en' ) ); ksort( $sortedArray ); $contentCode = $wgContLang->getCode(); $fallback = Language::getFallbackFor( $wgLang->getCode() ); $messages = array(); $wgMessageCache->disableTransform(); foreach ( array_keys( $sortedArray ) as $key ) { if ( $contentCode == $fallback ) { $messages[$key]['fallbackmsg'] = wfMsgNoDbForContent( $key ); } else { $messages[$key]['fallbackmsg'] = wfMsgNoDb( "$key/$fallback" ); } $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 | HTML
'.htmlspecialchars($navText).''); } else { $wgOut->addHTML( 'PHP | HTML' ); $wgOut->addWikiText( $navText ); $wgOut->addHTML( makeHTMLText( $messages ) ); } wfProfileOut( "$fname-output" ); wfProfileOut( $fname ); } /** * */ function makePhp($messages) { global $wgLang; $txt = "\n\n\$messages = array(\n"; foreach( $messages as $key => $m ) { if($wgLang->getCode() != 'en' and $m['msg'] == $m['fallbackmsg'] ) { //if (strstr($m['msg'],"\n")) { // $txt.='/* '; // $comment=' */'; //} else { // $txt .= '#'; // $comment = ''; //} continue; } elseif ($m['msg'] == '<'.$key.'>'){ $m['msg'] = ''; $comment = ' #empty'; } else { $comment = ''; } $txt .= "'$key' => '" . preg_replace( "/(?getSkin(); $talk = $wgLang->getNsText( NS_TALK ); $mwnspace = $wgLang->getNsText( NS_MEDIAWIKI ); $mwtalk = $wgLang->getNsText( NS_MEDIAWIKI_TALK ); $input = wfElement( 'input', array( 'type' => 'text', 'id' => 'allmessagesinput', 'onkeyup' => 'allmessagesfilter()',), ''); $checkbox = wfElement( 'input', array( 'type' => 'button', 'value' => wfMsgHtml( 'allmessagesmodified' ), 'id' => 'allmessagescheckbox', 'onclick' => 'allmessagesmodified()',), ''); $txt = ' '; $txt .= "