X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialAllmessages.php;h=e20d1749c2d98b1a81d5dcf7ee370bdafa77e0ff;hb=7ba3286102844e6b7eb1dcb3b90343f83c7e2bc4;hp=2001c414c01877cdd399a0e91524bd5bb09dd73c;hpb=9aae1d5065cee553d93882c20a755e58efabe2d8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialAllmessages.php b/includes/SpecialAllmessages.php index 2001c414c0..e20d1749c2 100644 --- a/includes/SpecialAllmessages.php +++ b/includes/SpecialAllmessages.php @@ -13,12 +13,6 @@ function wfSpecialAllmessages() { global $wgLanguageCode, $wgContLanguageCode, $wgContLang; global $wgUseDatabaseMessages; - if($wgLanguageCode != $wgContLanguageCode && - !in_array($wgLanguageCode, $wgContLang->getVariants())) { - $err = wfMsg('allmessagesnotsupportedUI'); - $wgOut->addHTML( $err ); - return; - } if(!$wgUseDatabaseMessages) { $wgOut->addHTML(wfMsg('allmessagesnotsupportedDB')); return; @@ -29,9 +23,8 @@ function wfSpecialAllmessages() { wfProfileIn( "$fname-setup"); $ot = $wgRequest->getText( 'ot' ); - $mwMsg =& MagicWord::get( MAG_MSG ); - $navText = wfMsg( 'allmessagestext', $mwMsg->getSynonym( 0 ) ); + $navText = wfMsg( 'allmessagestext' ); $first = true; @@ -84,7 +77,7 @@ function makePhp($messages) { } else { $comment = ''; } - $txt .= "'".$key."' => \"".str_replace('"','\"',$m['msg'])."\",$comment\n"; + $txt .= "'$key' => '" . preg_replace( "/(? - Name - Default text - Current text + " . wfMsg('allmessagesname') . " + " . wfMsg('allmessagesdefault') . " + " . wfMsg('allmessagescurrent') . " "; wfProfileIn( "$fname-check" ); @@ -118,21 +111,24 @@ function makeHTMLText( $messages ) { NS_MEDIAWIKI => array(), NS_MEDIAWIKI_TALK => array() ); - $sql = "SELECT cur_namespace,cur_title FROM cur WHERE cur_namespace IN (" . NS_MEDIAWIKI . ", " . NS_MEDIAWIKI_TALK . ")"; $dbr =& wfGetDB( DB_SLAVE ); + $page = $dbr->tableName( 'page' ); + $sql = "SELECT page_namespace,page_title FROM $page WHERE page_namespace IN (" . NS_MEDIAWIKI . ", " . NS_MEDIAWIKI_TALK . ")"; $res = $dbr->query( $sql ); while( $s = $dbr->fetchObject( $res ) ) { - $pageExists[$s->cur_namespace][$s->cur_title] = true; + $pageExists[$s->page_namespace][$s->page_title] = true; } $dbr->freeResult( $res ); wfProfileOut( "$fname-check" ); wfProfileIn( "$fname-output" ); + foreach( $messages as $key => $m ) { $title = $wgLang->ucfirst( $key ); if($wgLanguageCode != $wgContLanguageCode) $title.="/$wgLanguageCode"; + $titleObj =& Title::makeTitle( NS_MEDIAWIKI, $title ); $talkPage =& Title::makeTitle( NS_MEDIAWIKI_TALK, $title );