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


PHP Util_Ui::table_tr方法代码示例

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


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

示例1: cloudflare_textbox

 private static function cloudflare_textbox($settings, $data)
 {
     if (!isset($settings[$data['key']])) {
         return;
     }
     $value = $settings[$data['key']]['value'];
     $disabled = !$settings[$data['key']]['editable'];
     Util_Ui::table_tr(array('id' => $data['key'], 'label' => $data['label'], 'textbox' => array('name' => 'cloudflare_api_' . $data['key'], 'value' => $value, 'disabled' => $disabled), 'description' => $data['description']));
 }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:9,代码来源:Extension_CloudFlare_Page.php

示例2: config_item

 /**
  * Prints configuration item UI based on description
  *   key => configuration key
  *   label => configuration key's as its introduced to the user
  *   value => it's value
  *   disabled => if disabled
  *
  *   control => checkbox | radiogroup | selectbox | textbox
  *   checkbox_label => text shown after the textbox
  *   radiogroup_values => array of possible values for radiogroup
  *   selectbox_values => array of possible values for dropdown
  *   selectbox_optgroups =>
  *   textbox_size =>
  *
  *   description => description shown to the user below
  */
 public static function config_item($a)
 {
     $c = Dispatcher::config();
     if (!isset($a['value']) || is_null($a['value'])) {
         $a['value'] = $c->get($a['key']);
         if (is_array($a['value'])) {
             $a['value'] = implode('\\n', $a['value']);
         }
     }
     if (isset($a['disabled']) && !is_null($a['disabled'])) {
         $disabled = $a['disabled'];
     } else {
         $disabled = $c->is_sealed($a['key']);
     }
     if (empty($a['label'])) {
         $a['label'] = Util_Ui::config_label($a['key']);
     }
     $action_key = $a['key'];
     if (is_array($action_key)) {
         $action_key = 'extension.' . $action_key[0] . '.' . $action_key[1];
     }
     $a = apply_filters('w3tc_ui_config_item_' . $action_key, $a);
     // convert to table_tr data
     $table_tr = array('id' => Util_Ui::config_key_to_http_name($a['key']), 'label' => $a['label']);
     if (isset($a['style'])) {
         $table_tr['style'] = $a['style'];
     }
     if ($a['control'] == 'checkbox') {
         $table_tr['label_class'] = 'w3tc_config_checkbox';
         $table_tr['checkbox'] = array('name' => Util_Ui::config_key_to_http_name($a['key']), 'value' => $a['value'], 'disabled' => $disabled, 'label' => $a['checkbox_label']);
     } else {
         if ($a['control'] == 'radiogroup') {
             $table_tr['radiogroup'] = array('name' => Util_Ui::config_key_to_http_name($a['key']), 'value' => $a['value'], 'disabled' => $disabled, 'values' => $a['radiogroup_values']);
         } else {
             if ($a['control'] == 'selectbox') {
                 $table_tr['selectbox'] = array('name' => Util_Ui::config_key_to_http_name($a['key']), 'value' => $a['value'], 'disabled' => $disabled, 'values' => $a['selectbox_values'], 'optgroups' => isset($a['selectbox_optgroups']) ? $a['selectbox_optgroups'] : null);
             } else {
                 if ($a['control'] == 'textbox') {
                     $table_tr['textbox'] = array('name' => Util_Ui::config_key_to_http_name($a['key']), 'value' => $a['value'], 'disabled' => $disabled, 'size' => isset($a['textbox_size']) ? $a['textbox_size'] : null);
                 } else {
                     if ($a['control'] == 'textarea') {
                         $table_tr['textarea'] = array('name' => Util_Ui::config_key_to_http_name($a['key']), 'value' => $a['value'], 'disabled' => $disabled);
                     }
                 }
             }
         }
     }
     if (isset($a['description'])) {
         $table_tr['description'] = $a['description'];
     }
     Util_Ui::table_tr($table_tr);
 }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:68,代码来源:Util_Ui.php


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