本文整理汇总了PHP中CDiv::setClass方法的典型用法代码示例。如果您正苦于以下问题:PHP CDiv::setClass方法的具体用法?PHP CDiv::setClass怎么用?PHP CDiv::setClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDiv
的用法示例。
在下文中一共展示了CDiv::setClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_item_filter_form
function get_item_filter_form(&$items)
{
$filter_group = $_REQUEST['filter_group'];
$filter_host = $_REQUEST['filter_host'];
$filter_application = $_REQUEST['filter_application'];
$filter_description = $_REQUEST['filter_description'];
$filter_type = $_REQUEST['filter_type'];
$filter_key = $_REQUEST['filter_key'];
$filter_snmp_community = $_REQUEST['filter_snmp_community'];
$filter_snmpv3_securityname = $_REQUEST['filter_snmpv3_securityname'];
$filter_snmp_oid = $_REQUEST['filter_snmp_oid'];
$filter_snmp_port = $_REQUEST['filter_snmp_port'];
$filter_value_type = $_REQUEST['filter_value_type'];
$filter_data_type = $_REQUEST['filter_data_type'];
$filter_delay = $_REQUEST['filter_delay'];
$filter_history = $_REQUEST['filter_history'];
$filter_trends = $_REQUEST['filter_trends'];
$filter_status = $_REQUEST['filter_status'];
$filter_templated_items = $_REQUEST['filter_templated_items'];
$filter_with_triggers = $_REQUEST['filter_with_triggers'];
// subfilter
$subfilter_hosts = $_REQUEST['subfilter_hosts'];
$subfilter_apps = $_REQUEST['subfilter_apps'];
$subfilter_types = $_REQUEST['subfilter_types'];
$subfilter_value_types = $_REQUEST['subfilter_value_types'];
$subfilter_status = $_REQUEST['subfilter_status'];
$subfilter_templated_items = $_REQUEST['subfilter_templated_items'];
$subfilter_with_triggers = $_REQUEST['subfilter_with_triggers'];
$subfilter_history = $_REQUEST['subfilter_history'];
$subfilter_trends = $_REQUEST['subfilter_trends'];
$subfilter_interval = $_REQUEST['subfilter_interval'];
$form = new CForm();
$form->setAttribute('name', 'zbx_filter');
$form->setAttribute('id', 'zbx_filter');
$form->setMethod('get');
$form->addVar('filter_hostid', get_request('filter_hostid', get_request('hostid')));
$form->addVar('subfilter_hosts', $subfilter_hosts);
$form->addVar('subfilter_apps', $subfilter_apps);
$form->addVar('subfilter_types', $subfilter_types);
$form->addVar('subfilter_value_types', $subfilter_value_types);
$form->addVar('subfilter_status', $subfilter_status);
$form->addVar('subfilter_templated_items', $subfilter_templated_items);
$form->addVar('subfilter_with_triggers', $subfilter_with_triggers);
$form->addVar('subfilter_history', $subfilter_history);
$form->addVar('subfilter_trends', $subfilter_trends);
$form->addVar('subfilter_interval', $subfilter_interval);
// FORM FOR FILTER DISPLAY {
$table = new CTable('', 'itemfilter');
$table->setCellPadding(0);
$table->setCellSpacing(0);
// 1st col
$col_table1 = new CTable();
$col_table1->setClass('filter');
$col_table1->addRow(array(bold(S_HOST_GROUP . ': '), array(new CTextBox('filter_group', $filter_group, 20), new CButton('btn_group', S_SELECT, 'return PopUp("popup.php?dstfrm=' . $form->getName() . '&dstfld1=filter_group&srctbl=host_group&srcfld1=name",450,450);', 'G'))));
$col_table1->addRow(array(bold(S_HOST . ': '), array(new CTextBox('filter_host', $filter_host, 20), new CButton('btn_host', S_SELECT, 'return PopUp("popup.php?dstfrm=' . $form->getName() . '&dstfld1=filter_host&srctbl=hosts_and_templates&srcfld1=host",450,450);', 'H'))));
$col_table1->addRow(array(bold(S_APPLICATION . ': '), array(new CTextBox('filter_application', $filter_application, 20), new CButton('btn_app', S_SELECT, 'return PopUp("popup.php?dstfrm=' . $form->getName() . '&dstfld1=filter_application&srctbl=applications&srcfld1=name",400,300,"application");', 'A'))));
$col_table1->addRow(array(array(bold(S_DESCRIPTION), SPACE . S_LIKE_SMALL . ': '), new CTextBox("filter_description", $filter_description, 30)));
$col_table1->addRow(array(array(bold(S_KEY), SPACE . S_LIKE_SMALL . ': '), new CTextBox("filter_key", $filter_key, 30)));
// 2nd col
$col_table2 = new CTable();
$col_table2->setClass('filter');
$fTypeVisibility = array();
//first row
$cmbType = new CComboBox("filter_type", $filter_type);
//"javascript: create_var('zbx_filter', 'filter_set', '1', true); ");
$cmbType->setAttribute('id', 'filter_type');
$cmbType->addItem(-1, S_ALL_SMALL);
foreach (array('filter_delay_label', 'filter_delay') as $vItem) {
zbx_subarray_push($fTypeVisibility, -1, $vItem);
}
$itemTypes = item_type2str();
// httptest items are only for internal zabbix logic
unset($itemTypes[ITEM_TYPE_HTTPTEST]);
$cmbType->addItems($itemTypes);
foreach ($itemTypes as $typeNum => $typeLabel) {
if ($typeNum != ITEM_TYPE_TRAPPER) {
zbx_subarray_push($fTypeVisibility, $typeNum, 'filter_delay_label');
zbx_subarray_push($fTypeVisibility, $typeNum, 'filter_delay');
}
switch ($typeNum) {
case ITEM_TYPE_SNMPV1:
case ITEM_TYPE_SNMPV2C:
$snmp_types = array('filter_snmp_community_label', 'filter_snmp_community', 'filter_snmp_oid_label', 'filter_snmp_oid', 'filter_snmp_port_label', 'filter_snmp_port');
foreach ($snmp_types as $vItem) {
zbx_subarray_push($fTypeVisibility, $typeNum, $vItem);
}
break;
case ITEM_TYPE_SNMPV3:
foreach (array('filter_snmpv3_securityname_label', 'filter_snmpv3_securityname', 'filter_snmp_oid_label', 'filter_snmp_oid', 'filter_snmp_port_label', 'filter_snmp_port') as $vItem) {
zbx_subarray_push($fTypeVisibility, $typeNum, $vItem);
}
break;
}
}
zbx_add_post_js("var filterTypeSwitcher = new CViewSwitcher('filter_type', 'change', " . zbx_jsvalue($fTypeVisibility, true) . ");");
$col21 = new CCol(bold(S_TYPE . ': '));
$col21->setAttribute('style', 'width: 170px');
$col_table2->addRow(array($col21, $cmbType));
//second row
$label221 = new CSpan(bold(S_UPDATE_INTERVAL_IN_SEC . ': '));
//.........这里部分代码省略.........