当前位置: 首页>>代码示例>>PHP>>正文


PHP JCckDevHelper::secureField方法代码示例

本文整理汇总了PHP中JCckDevHelper::secureField方法的典型用法代码示例。如果您正苦于以下问题:PHP JCckDevHelper::secureField方法的具体用法?PHP JCckDevHelper::secureField怎么用?PHP JCckDevHelper::secureField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JCckDevHelper的用法示例。


在下文中一共展示了JCckDevHelper::secureField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onCCK_FieldPrepareForm


//.........这里部分代码省略.........
         }
         if ($optgroups !== false) {
             $opts[] = JHtml::_('select.option', '</OPTGROUP>');
         }
         if ($field->bool4 == 2 || $field->bool4 == 3) {
             if ($field->bool4 == 3) {
                 if ($static > 1 && isset($current) && isset($half) && isset($static) && isset($results)) {
                     for (; $current < $static; $current++) {
                         $opts[] = $results[$current];
                     }
                 }
             } else {
                 $results = self::_getStaticOption($field, $field->options, $config);
                 foreach ($results as $result) {
                     $opts[] = $result;
                 }
             }
         }
         $class = 'inputbox select' . $validate . ($field->css ? ' ' . $field->css : '');
         if ($value != '') {
             $class .= ' has-value';
         }
         $multi = @$field->bool3 ? ' multiple="multiple"' : '';
         $size = !@$field->bool3 ? '1' : (@$field->rows ? $field->rows : count($opts));
         $size = (int) $size > 1 ? ' size="' . $size . '"' : '';
         $attr = 'class="' . $class . '"' . $size . $multi . ($field->attributes ? ' ' . $field->attributes : '');
         $count = count($opts);
         $form = '';
         if ($field->variation == 'hidden_auto') {
             if ($auto == $count && is_object($opts[$auto - 1])) {
                 $count = 0;
                 $field->variation = 'hidden';
                 $value = $opts[$auto - 1]->value;
                 if (!$field->live) {
                     JCckDevHelper::secureField($field, $value);
                 }
             } else {
                 $field->variation = '';
             }
         }
         if ($count) {
             if ($attrib) {
                 $attr = array('id' => $id, 'list.attr' => $attr, 'list.select' => $value, 'list.translate' => false, 'option.attr' => 'data-cck', 'option.key' => 'value', 'option.text' => 'text');
                 $form = JHtml::_('select.genericlist', $opts, $name, $attr);
             } else {
                 $form = JHtml::_('select.genericlist', $opts, $name, $attr, 'value', 'text', $value, $id);
             }
         }
         /* tmp */
         $jtext = $config['doTranslation'];
         $config['doTranslation'] = 0;
         /* tmp */
         // Set
         if (!$field->variation) {
             $field->form = $form;
             if ($field->script) {
                 parent::g_addScriptDeclaration($field->script);
             }
         } else {
             $options_2 = self::_getOptionsList($options2, $field->bool2, $lang_code);
             if ($field->options) {
                 if ($field->bool4 == 3) {
                     $current = 0;
                     $static_opts = explode('||', $field->options);
                     $static_opts1 = array();
                     $static_opts2 = array();
                     foreach ($static_opts as $static_opt) {
                         if ($current < $half) {
                             $static_opts1[] = $static_opt;
                         } else {
                             $static_opts2[] = $static_opt;
                         }
                         $current++;
                     }
                     $field->optionsList = implode('||', $static_opts1) . '||' . $options_2 . '||' . implode('||', $static_opts2);
                 } elseif ($field->bool4 == 2) {
                     $field->optionsList = $options_2 . '||' . $field->options;
                 } else {
                     $field->optionsList = $field->options . '||' . $options_2;
                 }
             } else {
                 $field->optionsList = $options_2;
             }
             if ($field->bool4) {
                 $field->text = parent::g_getOptionText($value, $field->optionsList, $divider, $config);
             } else {
                 $field->text = parent::g_getOptionText($value, $options_2, $divider, $config);
             }
             parent::g_getDisplayVariation($field, $field->variation, $value, $field->text, $form, $id, $name, '<select', '', '', $config);
         }
         /* tmp */
         $config['doTranslation'] = $jtext;
         /* tmp */
     }
     $field->value = $value;
     // Return
     if ($return === true) {
         return $field;
     }
 }
开发者ID:hamby,项目名称:SEBLOD,代码行数:101,代码来源:select_dynamic.php

示例2: array

        } else {
            if ($field->live) {
                $dispatcher->trigger('onCCK_Field_LivePrepareForm', array(&$field, &$value, &$config));
                if (!($field->variation == 'hidden_auto' || $field->variation == 'hidden_isfilled')) {
                    JCckDevHelper::secureField($field, $value);
                }
            } else {
                $value = isset($lives[$name]) ? $lives[$name] : $field->live_value;
            }
        }
    }
    $field->value = $value;
    if ($field->variation == 'hidden_isfilled') {
        if ($value != '') {
            $field->variation = 'hidden';
            JCckDevHelper::secureField($field, $value);
        } else {
            $field->variation = '';
        }
    }
    $dispatcher->trigger('onCCK_FieldPrepareForm', array(&$field, $value, &$config, array()));
    $position = $field->position;
    $positions[$position][] = $field->name;
    // Was it the last one?
    if ($config['error']) {
        break;
    }
}
// Merge
if (count($config['fields'])) {
    $fields = array_merge($fields, $config['fields']);
开发者ID:hamby,项目名称:SEBLOD,代码行数:31,代码来源:form_inc.php


注:本文中的JCckDevHelper::secureField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。