public function onCCK_FieldPrepareStore(&$field, $value = '', &$config = array(), $inherit = array(), $return = false) { if (self::$type != $field->type) { return; } // Init if (count($inherit)) { $name = isset($inherit['name']) && $inherit['name'] != '' ? $inherit['name'] : $field->name; } else { $name = $field->name; } $divider = ''; $value2 = ''; // Prepare if ($field->bool3) { // Set Multiple $divider = $field->divider != '' ? $field->divider : ','; if ($divider) { $nb = count($value); if (is_array($value) && $nb > 0) { $value = implode($divider, $value); } } } /* tmp */ $jtext = $config['doTranslation']; $config['doTranslation'] = 0; /* tmp */ $options2 = JCckDev::fromJSON($field->options2); self::_languageDetection($lang_code, $value2, $options2); $options_2 = self::_getOptionsList($options2, $field->bool2, $lang_code); $field->options = $field->options ? $field->options . '||' . $options_2 : $options_2; // Validate $text = parent::g_getOptionText($value, $field->options, $divider, $config); parent::g_onCCK_FieldPrepareStore_Validation($field, $name, $value, $config); /* tmp */ $config['doTranslation'] = $jtext; /* tmp */ // Set or Return if ($return === true) { return $value; } $field->text = $text; $field->value = $value; parent::g_onCCK_FieldPrepareStore($field, $name, $value, $config); }
public function onCCK_FieldPrepareStore(&$field, $value = '', &$config = array(), $inherit = array(), $return = false) { if (self::$type != $field->type) { return; } // Init if (count($inherit)) { $name = isset($inherit['name']) && $inherit['name'] != '' ? $inherit['name'] : $field->name; } else { $name = $field->name; } $doTranslation = $config['doTranslation']; if ($config['doTranslation']) { $config['doTranslation'] = $field->bool8; } // Prepare $divider = $field->divider != '' ? $field->divider : ','; if ($divider) { $nb = count($value); if (is_array($value) && $nb > 0) { $value = implode($divider, $value); } } // Validate $text = parent::g_getOptionText($value, $field->options, $divider, $config); $config['doTranslation'] = $doTranslation; parent::g_onCCK_FieldPrepareStore_Validation($field, $name, $value, $config); // Set or Return if ($return === true) { return $value; } $field->text = $text; $field->value = $value; parent::g_onCCK_FieldPrepareStore($field, $name, $value, $config); }
public function onCCK_FieldPrepareStore(&$field, $value = '', &$config = array(), $inherit = array(), $return = false) { if (self::$type != $field->type) { return; } // Init if (count($inherit)) { $name = isset($inherit['name']) && $inherit['name'] != '' ? $inherit['name'] : $field->name; } else { $name = $field->name; } $doTranslation = $config['doTranslation']; if ($config['doTranslation']) { $config['doTranslation'] = $field->bool8; } // Validate $text = parent::g_getOptionText($value, $field->options, '', $config); $config['doTranslation'] = $doTranslation; parent::g_onCCK_FieldPrepareStore_Validation($field, $name, $value, $config); // Set or Return // $field->text = $text; // $field->value = $value; if ($return === true) { return $value; } $field->text = $text; //todo: move up $field->value = $value; //todo: move up parent::g_onCCK_FieldPrepareStore($field, $name, $value, $config); }