本文整理汇总了PHP中JCckPluginField::g_getOptionText方法的典型用法代码示例。如果您正苦于以下问题:PHP JCckPluginField::g_getOptionText方法的具体用法?PHP JCckPluginField::g_getOptionText怎么用?PHP JCckPluginField::g_getOptionText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JCckPluginField
的用法示例。
在下文中一共展示了JCckPluginField::g_getOptionText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onCCK_FieldPrepareStore
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);
}
示例2: onCCK_FieldPrepareStore
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);
}
示例3: onCCK_FieldPrepareStore
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);
}