當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JCckPluginField::g_getOptionText方法代碼示例

本文整理匯總了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);
 }
開發者ID:hamby,項目名稱:SEBLOD,代碼行數:46,代碼來源:select_dynamic.php

示例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);
 }
開發者ID:pctechnikch,項目名稱:SEBLOD,代碼行數:35,代碼來源:checkbox.php

示例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);
 }
開發者ID:densem-2013,項目名稱:exikom,代碼行數:31,代碼來源:select_simple.php


注:本文中的JCckPluginField::g_getOptionText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。