From 64f462e6d5cd50c3439fa29fb89209b78d0b656b Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 21 Feb 2013 00:37:42 +0100 Subject: [PATCH] Added method to get multilingualism status --- .../system/cache/builder/LanguageCacheBuilder.class.php | 8 +++++++- .../files/lib/system/language/LanguageFactory.class.php | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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']; + } } -- 2.20.1