/** * @param $varInput * @return mixed */ protected function validator($varInput) { // Get language id $intId = $this->activeRecord ? $this->activeRecord->{$this->strName} : $GLOBALS['TL_CONFIG'][$this->strName]; // Check if translation fields should not be empty saved if (!$GLOBALS['TL_CONFIG']['dontfillEmptyTranslationFields']) { // Fill all empty fields with the content of the fallback field $varInput = WidgetUtil::addFallbackValueToEmptyField($varInput); parent::validator($varInput); } else { // Check only the first field parent::validator($varInput[key($varInput)]); } // Check if array if (is_array($varInput)) { if (!parent::hasErrors()) { // Save values and return fid return TranslationFieldsModel::saveValuesAndReturnFid($varInput, $intId); } } return $intId; }