*/
protected $assignValueVariablesDisabled = false;
+ /**
+ * list of available languages
+ * @var array<wcf\data\language\Language>
+ */
+ protected $availableLanguages = array();
+
/**
* list of element ids
* @var array<string>
*/
protected $elementOptions = array();
+ /**
+ * @see wcf\system\SingletonFactory::init()
+ */
+ protected function init() {
+ $this->availableLanguages = LanguageFactory::getInstance()->getLanguages();
+ }
+
/**
* Registers a new element id, returns false if element id is already set.
*
return false;
}
else {
- foreach ($this->i18nValues[$elementID] as $value) {
- if (empty($value)) {
+ foreach ($this->availableLanguages as $language) {
+ if (!isset($this->i18nValues[$elementID][$language->languageID])) {
+ return false;
+ }
+
+ if (empty($this->i18nValues[$elementID][$language->languageID])) {
return false;
}
}
}
WCF::getTPL()->assign(array(
- 'availableLanguages' => LanguageFactory::getInstance()->getLanguages(),
+ 'availableLanguages' => $this->availableLanguages,
'i18nPlainValues' => $elementValues,
'i18nValues' => $elementValuesI18n
));