From: Marcel Werk Date: Wed, 20 Feb 2013 23:37:42 +0000 (+0100) Subject: Added method to get multilingualism status X-Git-Tag: 2.0.0_Beta_1~462 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=64f462e6d5cd50c3439fa29fb89209b78d0b656b;p=GitHub%2FWoltLab%2FWCF.git Added method to get multilingualism status --- diff --git a/wcfsetup/install/files/lib/system/cache/builder/LanguageCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/LanguageCacheBuilder.class.php index 4b5df08660..52efc776b0 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/LanguageCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/LanguageCacheBuilder.class.php @@ -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; diff --git a/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php b/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php index ffdc78175c..2905e15779 100644 --- a/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php +++ b/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php @@ -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']; + } }