Added method to get multilingualism status
authorMarcel Werk <burntime@woltlab.com>
Wed, 20 Feb 2013 23:37:42 +0000 (00:37 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 20 Feb 2013 23:37:42 +0000 (00:37 +0100)
wcfsetup/install/files/lib/system/cache/builder/LanguageCacheBuilder.class.php
wcfsetup/install/files/lib/system/language/LanguageFactory.class.php

index 4b5df086609db1ead199350370873cff07a2f929..52efc776b097caf01ad063c2cc952d4c63fb084b 100644 (file)
@@ -25,7 +25,8 @@ class LanguageCacheBuilder extends AbstractCacheBuilder {
                        'languages' => array(),
                        'default' => 0,
                        'categories' => array(),
-                       'categoryIDs' => array()
+                       'categoryIDs' => array(),
+                       'multilingualismEnabled' => false
                );
                
                // get languages
@@ -38,6 +39,11 @@ class LanguageCacheBuilder extends AbstractCacheBuilder {
                                $data['default'] = $language->languageID;
                        }
                        
+                       // multilingualism
+                       if ($language->hasContent) {
+                               $data['multilingualismEnabled'] = true;
+                       }
+                       
                        // language code to language id
                        $data['codes'][$language->languageCode] = $language->languageID;
                        
index ffdc78175c28ce74f2acdc950b9aa4e81cb8a83f..2905e157796f4e34cc6a0ad9cbe3b286ccb2f280 100644 (file)
@@ -306,4 +306,13 @@ class LanguageFactory extends SingletonFactory {
                        $languageEditor->deleteCompiledTemplates();
                }
        }
+       
+       /**
+        * Returns true if multilingualism is enabled.
+        * 
+        * @return      boolean
+        */
+       public function multilingualismEnabled() {
+               return $this->cache['multilingualismEnabled'];
+       }
 }