本文整理匯總了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']));
}
示例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);
}