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


PHP CTable::setId方法代码示例

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


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

示例1: CTextBox

// name
$column1->addRow(_('Filter by name'), (new CTextBox('txt_select', $filter['txtSelect']))->setWidth(ZBX_TEXTAREA_FILTER_STANDARD_WIDTH));
$application_name_url = 'popup.php?srctbl=applications&srcfld1=name&real_hosts=1&dstfld1=application&with_applications=1&dstfrm=zbx_filter';
// application
$column2 = (new CFormList())->addRow(_('Filter by application'), [(new CTextBox('application', $filter['application']))->setWidth(ZBX_TEXTAREA_FILTER_STANDARD_WIDTH), (new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN), (new CButton('application_name', _('Select')))->addClass(ZBX_STYLE_BTN_GREY)->onClick('return PopUp("' . $application_name_url . '");')]);
// inventory filter
$inventoryFilters = $filter['inventory'];
if (!$inventoryFilters) {
    $inventoryFilters = [['field' => '', 'value' => '']];
}
$inventoryFields = [];
foreach (getHostInventories() as $inventory) {
    $inventoryFields[$inventory['db_field']] = $inventory['title'];
}
$inventoryFilterTable = new CTable();
$inventoryFilterTable->setId('inventory-filter');
$i = 0;
foreach ($inventoryFilters as $field) {
    $inventoryFilterTable->addRow([new CComboBox('inventory[' . $i . '][field]', $field['field'], null, $inventoryFields), (new CTextBox('inventory[' . $i . '][value]', $field['value']))->setWidth(ZBX_TEXTAREA_FILTER_SMALL_WIDTH), (new CCol((new CButton('inventory[' . $i . '][remove]', _('Remove')))->addClass(ZBX_STYLE_BTN_LINK)->addClass('element-table-remove')))->addClass(ZBX_STYLE_NOWRAP)], 'form_row');
    $i++;
}
$inventoryFilterTable->addRow((new CCol((new CButton('inventory_add', _('Add')))->addClass(ZBX_STYLE_BTN_LINK)->addClass('element-table-add')))->setColSpan(2));
$column2->addRow(_('Filter by host inventory'), $inventoryFilterTable);
// maintenance filter
$column2->addRow(_('Show hosts in maintenance'), (new CCheckBox('show_maintenance'))->setChecked($filter['showMaintenance'] == 1));
// show details
if (!$overview) {
    $column2->addRow(_('Show details'), (new CCheckBox('show_details'))->setChecked($filter['showDetails'] == 1));
}
$filterForm->addColumn($column1);
$filterForm->addColumn($column2);
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:common.filter.trigger.php


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