Capitalization fix in memcached setting
[lhc/web/wiklou.git] / includes / SpecialAllmessages.php
index 6e0e7a9..2001c41 100644 (file)
 function wfSpecialAllmessages() {
        global $wgOut, $wgAllMessagesEn, $wgRequest, $wgMessageCache, $wgTitle;
        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;
+       }
+
        $fname = "wfSpecialAllMessages";
        wfProfileIn( $fname );
        
@@ -20,12 +33,6 @@ function wfSpecialAllmessages() {
        
        $navText = wfMsg( 'allmessagestext', $mwMsg->getSynonym( 0 ) );
 
-       if($wgLanguageCode != $wgContLanguageCode &&
-       !in_array($wgLanguageCode, $wgContLang->getVariants())) {
-               $err = wfMsg('allmessagesnotsupported');
-               $wgOut->addHTML( $err );
-               return;
-       }
 
        $first = true;
        $sortedArray = $wgAllMessagesEn;
@@ -87,7 +94,7 @@ function makePhp($messages) {
  *
  */
 function makeHTMLText( $messages ) {
-       global $wgLang, $wgUser, $wgLanguageCode;
+       global $wgLang, $wgUser, $wgLanguageCode, $wgContLanguageCode;
        $fname = "makeHTMLText";
        wfProfileIn( $fname );
        
@@ -123,7 +130,9 @@ function makeHTMLText( $messages ) {
        wfProfileIn( "$fname-output" );
        foreach( $messages as $key => $m ) {
 
-               $title = $wgLang->ucfirst( $key )."/$wgLanguageCode";
+               $title = $wgLang->ucfirst( $key );
+               if($wgLanguageCode != $wgContLanguageCode)
+                       $title.="/$wgLanguageCode";
                $titleObj =& Title::makeTitle( NS_MEDIAWIKI, $title );
                $talkPage =& Title::makeTitle( NS_MEDIAWIKI_TALK, $title );