本文整理汇总了PHP中CComboBox::addItems方法的典型用法代码示例。如果您正苦于以下问题:PHP CComboBox::addItems方法的具体用法?PHP CComboBox::addItems怎么用?PHP CComboBox::addItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComboBox
的用法示例。
在下文中一共展示了CComboBox::addItems方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insert_map_form
function insert_map_form()
{
$frm_title = 'New system map';
if (isset($_REQUEST['sysmapid'])) {
$options = array('sysmapids' => $_REQUEST['sysmapid'], 'output' => API_OUTPUT_EXTEND);
$sysmaps = CMap::get($options);
$row = reset($sysmaps);
$frm_title = 'System map: "' . $row['name'] . '"';
}
if (isset($_REQUEST['sysmapid']) && !isset($_REQUEST['form_refresh'])) {
$name = $row['name'];
$width = $row['width'];
$height = $row['height'];
$backgroundid = $row['backgroundid'];
$label_type = $row['label_type'];
$label_location = $row['label_location'];
$highlight = $row['highlight'];
$markelements = $row['markelements'];
$expandproblem = $row['expandproblem'];
$show_unack = $row['show_unack'];
} else {
$name = get_request('name', '');
$width = get_request('width', 800);
$height = get_request('height', 600);
$backgroundid = get_request('backgroundid', 0);
$label_type = get_request('label_type', 0);
$label_location = get_request('label_location', 0);
$highlight = get_request('highlight', 0);
$markelements = get_request('markelements', 0);
$expandproblem = get_request('expandproblem', 0);
$show_unack = get_request('show_unack', 0);
}
$frmMap = new CFormTable($frm_title, 'sysmaps.php');
$frmMap->setHelp('web.sysmaps.map.php');
if (isset($_REQUEST['sysmapid'])) {
$frmMap->addVar('sysmapid', $_REQUEST['sysmapid']);
}
$frmMap->addRow(S_NAME, new CTextBox('name', $name, 32));
$frmMap->addRow(S_WIDTH, new CNumericBox('width', $width, 5));
$frmMap->addRow(S_HEIGHT, new CNumericBox('height', $height, 5));
$cmbImg = new CComboBox('backgroundid', $backgroundid);
$cmbImg->addItem(0, S_NO_IMAGE . '...');
$result = DBselect('SELECT * FROM images WHERE imagetype=2 AND ' . DBin_node('imageid') . ' order by name');
while ($row = DBfetch($result)) {
$cmbImg->addItem($row['imageid'], get_node_name_by_elid($row['imageid'], null, ': ') . $row['name']);
}
$frmMap->addRow(S_BACKGROUND_IMAGE, $cmbImg);
$frmMap->addRow(S_ICON_HIGHLIGHTING, new CCheckBox('highlight', $highlight, null, 1));
$frmMap->addRow(S_MARK_ELEMENTS_ON_TRIGGER_STATUS_CHANGE, new CCheckBox('markelements', $markelements, null, 1));
$frmMap->addRow(S_EXPAND_SINGLE_PROBLEM, new CCheckBox('expandproblem', $expandproblem, null, 1));
$cmbLabel = new CComboBox('label_type', $label_type);
$cmbLabel->addItem(0, S_LABEL);
$cmbLabel->addItem(1, S_IP_ADDRESS);
$cmbLabel->addItem(2, S_ELEMENT_NAME);
$cmbLabel->addItem(3, S_STATUS_ONLY);
$cmbLabel->addItem(4, S_NOTHING);
$frmMap->addRow(S_ICON_LABEL_TYPE, $cmbLabel);
$cmbLocation = new CComboBox('label_location', $label_location);
$cmbLocation->addItem(0, S_BOTTOM);
$cmbLocation->addItem(1, S_LEFT);
$cmbLocation->addItem(2, S_RIGHT);
$cmbLocation->addItem(3, S_TOP);
$frmMap->addRow(S_ICON_LABEL_LOCATION, $cmbLocation);
$config = select_config();
$cb = new CComboBox('show_unack', $show_unack);
$cb->addItems(array(EXTACK_OPTION_ALL => S_O_ALL, EXTACK_OPTION_BOTH => S_O_SEPARATED, EXTACK_OPTION_UNACK => S_O_UNACKNOWLEDGED_ONLY));
$cb->setEnabled($config['event_ack_enable']);
if (!$config['event_ack_enable']) {
$cb->setAttribute('title', S_EVENT_ACKNOWLEDGING_DISABLED);
}
$frmMap->addRow(S_PROBLEM_DISPLAY, $cb);
$frmMap->addItemToBottomRow(new CButton('save', S_SAVE));
if (isset($_REQUEST['sysmapid'])) {
$frmMap->addItemToBottomRow(SPACE);
$frmMap->addItemToBottomRow(new CButtonDelete(S_DELETE_SYSTEM_MAP_Q, url_param('form') . url_param('sysmapid')));
}
$frmMap->addItemToBottomRow(SPACE);
$frmMap->addItemToBottomRow(new CButtonCancel());
return $frmMap;
}
示例2: CTextBox
break;
case CONDITION_TYPE_TRIGGER_NAME:
$condition = new CTextBox('new_condition[value]', '', ZBX_TEXTBOX_STANDARD_SIZE);
break;
case CONDITION_TYPE_TRIGGER_VALUE:
$condition = new CComboBox('new_condition[value]');
foreach (array(TRIGGER_VALUE_FALSE, TRIGGER_VALUE_TRUE) as $trigerValue) {
$condition->addItem($trigerValue, trigger_value2str($trigerValue));
}
break;
case CONDITION_TYPE_TIME_PERIOD:
$condition = new CTextBox('new_condition[value]', ZBX_DEFAULT_INTERVAL, ZBX_TEXTBOX_STANDARD_SIZE);
break;
case CONDITION_TYPE_TRIGGER_SEVERITY:
$condition = new CComboBox('new_condition[value]');
$condition->addItems(getSeverityCaption());
break;
case CONDITION_TYPE_MAINTENANCE:
$condition = new CCol(_('maintenance'));
break;
case CONDITION_TYPE_NODE:
$conditionFormList->addItem(new CVar('new_condition[value]', '0'));
$condition = array(new CTextBox('node', '', ZBX_TEXTBOX_STANDARD_SIZE, 'yes'), SPACE, new CButton('btn1', _('Select'), 'return PopUp("popup.php?srctbl=nodes&srcfld1=nodeid&srcfld2=name' . '&dstfrm=' . $actionForm->getName() . '&dstfld1=new_condition_value&dstfld2=node' . '&writeonly=1", 450, 450);', 'link_menu'));
break;
case CONDITION_TYPE_DRULE:
$conditionFormList->addItem(new CVar('new_condition[value]', '0'));
$condition = array(new CTextBox('drule', '', ZBX_TEXTBOX_STANDARD_SIZE, 'yes'), SPACE, new CButton('btn1', _('Select'), 'return PopUp("popup.php?srctbl=drules&srcfld1=druleid&srcfld2=name' . '&dstfrm=' . $actionForm->getName() . '&dstfld1=new_condition_value&dstfld2=drule", 450, 450);', 'link_menu'));
break;
case CONDITION_TYPE_DCHECK:
$conditionFormList->addItem(new CVar('new_condition[value]', '0'));
$condition = array(new CTextBox('dcheck', '', ZBX_TEXTBOX_STANDARD_SIZE, 'yes'), SPACE, new CButton('btn1', _('Select'), 'return PopUp("popup.php?srctbl=dchecks&srcfld1=dcheckid&srcfld2=name' . '&dstfrm=' . $actionForm->getName() . '&dstfld1=new_condition_value&dstfld2=dcheck&writeonly=1", 450, 450);', 'link_menu'));
示例3: dirname
require_once dirname(__FILE__) . '/include/config.inc.php';
$page['title'] = _('Configuration of trigger displaying options');
$page['file'] = 'adm.triggerdisplayoptions.php';
$page['hist_arg'] = array();
require_once dirname(__FILE__) . '/include/page_header.php';
$fields = array('problem_unack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'problem_ack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'ok_unack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'ok_ack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'problem_unack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'problem_ack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_unack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_ack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_period' => array(T_ZBX_INT, O_OPT, null, null, 'isset({save})'), 'blink_period' => array(T_ZBX_INT, O_OPT, null, null, 'isset({save})'), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null));
check_fields($fields);
if (isset($_REQUEST['save'])) {
$configs = array('ok_period' => get_request('ok_period'), 'blink_period' => get_request('blink_period'), 'problem_unack_color' => get_request('problem_unack_color'), 'problem_ack_color' => get_request('problem_ack_color'), 'ok_unack_color' => get_request('ok_unack_color'), 'ok_ack_color' => get_request('ok_ack_color'), 'problem_unack_style' => get_request('problem_unack_style', 0), 'problem_ack_style' => get_request('problem_ack_style', 0), 'ok_unack_style' => get_request('ok_unack_style', 0), 'ok_ack_style' => get_request('ok_ack_style', 0));
$result = update_config($configs);
show_messages($result, _('Configuration updated'), _('Cannot update configuration'));
}
$form = new CForm();
$form->cleanItems();
$cmbConf = new CComboBox('configDropDown', 'adm.triggerdisplayoptions.php', 'redirect(this.options[this.selectedIndex].value);');
$cmbConf->addItems(array('adm.gui.php' => _('GUI'), 'adm.housekeeper.php' => _('Housekeeping'), 'adm.images.php' => _('Images'), 'adm.iconmapping.php' => _('Icon mapping'), 'adm.regexps.php' => _('Regular expressions'), 'adm.macros.php' => _('Macros'), 'adm.valuemapping.php' => _('Value mapping'), 'adm.workingtime.php' => _('Working time'), 'adm.triggerseverities.php' => _('Trigger severities'), 'adm.triggerdisplayoptions.php' => _('Trigger displaying options'), 'adm.other.php' => _('Other')));
$form->addItem($cmbConf);
$cnf_wdgt = new CWidget();
$cnf_wdgt->addPageHeader(_('CONFIGURATION OF ZABBIX'), $form);
$data = array();
$data['form_refresh'] = get_request('form_refresh', 0);
// form has been submitted
if ($data['form_refresh']) {
$data['ok_period'] = get_request('ok_period');
$data['blink_period'] = get_request('blink_period');
$data['problem_unack_color'] = get_request('problem_unack_color');
$data['problem_ack_color'] = get_request('problem_ack_color');
$data['ok_unack_color'] = get_request('ok_unack_color');
$data['ok_ack_color'] = get_request('ok_ack_color');
$data['problem_unack_style'] = get_request('problem_unack_style');
$data['problem_ack_style'] = get_request('problem_ack_style');
示例4: CFormList
}
$divTabs->addTab('templateTab', _('Templates'), $tmplList);
/*
* IPMI
*/
$ipmiList = new CFormList('ipmilist');
// normal hosts
if (!$isDiscovered) {
$cmbIPMIAuthtype = new CComboBox('ipmi_authtype', $ipmi_authtype);
$cmbIPMIAuthtype->addItems(ipmiAuthTypes());
$cmbIPMIAuthtype->addClass('openView');
$cmbIPMIAuthtype->setAttribute('size', 7);
$cmbIPMIAuthtype->addStyle('width: 170px;');
$ipmiList->addRow(_('Authentication algorithm'), $cmbIPMIAuthtype);
$cmbIPMIPrivilege = new CComboBox('ipmi_privilege', $ipmi_privilege);
$cmbIPMIPrivilege->addItems(ipmiPrivileges());
$cmbIPMIPrivilege->addClass('openView');
$cmbIPMIPrivilege->setAttribute('size', 5);
$cmbIPMIPrivilege->addStyle('width: 170px;');
$ipmiList->addRow(_('Privilege level'), $cmbIPMIPrivilege);
} else {
$cmbIPMIAuthtype = new CTextBox('ipmi_authtype_name', ipmiAuthTypes($dbHost['ipmi_authtype']), ZBX_TEXTBOX_SMALL_SIZE, true);
$ipmiList->addRow(_('Authentication algorithm'), $cmbIPMIAuthtype);
$cmbIPMIPrivilege = new CTextBox('ipmi_privilege_name', ipmiPrivileges($dbHost['ipmi_privilege']), ZBX_TEXTBOX_SMALL_SIZE, true);
$ipmiList->addRow(_('Privilege level'), $cmbIPMIPrivilege);
}
$ipmiList->addRow(_('Username'), new CTextBox('ipmi_username', $ipmi_username, ZBX_TEXTBOX_SMALL_SIZE, $isDiscovered));
$ipmiList->addRow(_('Password'), new CTextBox('ipmi_password', $ipmi_password, ZBX_TEXTBOX_SMALL_SIZE, $isDiscovered));
$divTabs->addTab('ipmiTab', _('IPMI'), $ipmiList);
/*
* Macros
示例5: getItemFilterForm
function getItemFilterForm(&$items)
{
$filter_groupId = $_REQUEST['filter_groupid'];
$filter_hostId = $_REQUEST['filter_hostid'];
$filter_application = $_REQUEST['filter_application'];
$filter_name = $_REQUEST['filter_name'];
$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_port = $_REQUEST['filter_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_state = $_REQUEST['filter_state'];
$filter_templated_items = $_REQUEST['filter_templated_items'];
$filter_with_triggers = $_REQUEST['filter_with_triggers'];
$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_state = $_REQUEST['subfilter_state'];
$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('get');
$form->setAttribute('name', 'zbx_filter');
$form->setAttribute('id', 'zbx_filter');
$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_state', $subfilter_state);
$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);
// type select
$fTypeVisibility = array();
$cmbType = new CComboBox('filter_type', $filter_type);
$cmbType->setAttribute('id', 'filter_type');
$cmbType->addItem(-1, _('all'));
foreach (array('filter_delay_label', 'filter_delay') as $vItem) {
zbx_subarray_push($fTypeVisibility, -1, $vItem);
}
$itemTypes = item_type2str();
unset($itemTypes[ITEM_TYPE_HTTPTEST]);
// httptest items are only for internal zabbix logic
$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_port_label', 'filter_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_port_label', 'filter_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) . ');');
// type of information select
$fVTypeVisibility = array();
$cmbValType = new CComboBox('filter_value_type', $filter_value_type);
$cmbValType->addItem(-1, _('all'));
$cmbValType->addItem(ITEM_VALUE_TYPE_UINT64, _('Numeric (unsigned)'));
$cmbValType->addItem(ITEM_VALUE_TYPE_FLOAT, _('Numeric (float)'));
$cmbValType->addItem(ITEM_VALUE_TYPE_STR, _('Character'));
$cmbValType->addItem(ITEM_VALUE_TYPE_LOG, _('Log'));
$cmbValType->addItem(ITEM_VALUE_TYPE_TEXT, _('Text'));
foreach (array('filter_data_type_label', 'filter_data_type') as $vItem) {
zbx_subarray_push($fVTypeVisibility, ITEM_VALUE_TYPE_UINT64, $vItem);
}
zbx_add_post_js("var filterValueTypeSwitcher = new CViewSwitcher('filter_value_type', 'change', " . zbx_jsvalue($fVTypeVisibility, true) . ');');
// status select
$cmbStatus = new CComboBox('filter_status', $filter_status);
$cmbStatus->addItem(-1, _('all'));
foreach (array(ITEM_STATUS_ACTIVE, ITEM_STATUS_DISABLED) as $status) {
$cmbStatus->addItem($status, item_status2str($status));
}
// state select
$cmbState = new CComboBox('filter_state', $filter_state);
//.........这里部分代码省略.........
示例6: CRow
$filterForm->setAttribute('id', 'zbx_filter');
$row = new CRow(array(new CCol(S_USER, 'form_row_l'), new CCol(array(new CTextBox('alias', $_REQUEST['alias'], 32), new CButton('btn1', S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->GetName() . "&dstfld1=alias&srctbl=users&srcfld1=alias&real_hosts=1');", 'T')), 'form_row_r')));
$filterForm->addRow($row);
$cmbAction = new CComboBox('action', $_REQUEST['action']);
$cmbAction->addItem(-1, S_ALL_S);
$cmbAction->addItem(AUDIT_ACTION_LOGIN, S_LOGIN);
$cmbAction->addItem(AUDIT_ACTION_LOGOUT, S_LOGOUT);
$cmbAction->addItem(AUDIT_ACTION_ADD, S_ADD);
$cmbAction->addItem(AUDIT_ACTION_UPDATE, S_UPDATE);
$cmbAction->addItem(AUDIT_ACTION_DELETE, S_DELETE);
$cmbAction->addItem(AUDIT_ACTION_ENABLE, S_ENABLE);
$cmbAction->addItem(AUDIT_ACTION_DISABLE, S_DISABLE);
$filterForm->addRow(S_ACTION, $cmbAction);
$cmbResource = new CComboBox('resourcetype', $_REQUEST['resourcetype']);
$resources = array(-1 => S_ALL_S) + audit_resource2str();
$cmbResource->addItems($resources);
$filterForm->addRow(S_RESOURCE, $cmbResource);
$reset = new CButton('filter_rst', S_RESET);
$reset->setType('button');
$reset->setAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();');
$filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER));
$filterForm->addItemToBottomRow($reset);
$audit_wdgt->addFlicker($filterForm, CProfile::get('web.auditlogs.filter.state', 1));
$scroll_div = new CDiv();
$scroll_div->setAttribute('id', 'scrollbar_cntr');
$audit_wdgt->addFlicker($scroll_div, CProfile::get('web.auditlogs.filter.state', 1));
//-------
$effectiveperiod = navigation_bar_calc('web.auditlogs.timeline', 0, true);
$bstime = $_REQUEST['stime'];
$from = zbxDateToTime($_REQUEST['stime']);
$till = $from + $effectiveperiod;
示例7: foreach
$dchecks[$id]['name'] = discovery_check2str($data['type'], $data['snmp_community'], $data['key'], $data['ports']);
}
order_result($dchecks, 'name');
foreach ($dchecks as $id => $data) {
$label = new CLabel($data['name'], 'selected_checks[' . $id . ']');
$dchecks[$id] = array(new CCheckBox('selected_checks[' . $id . ']', null, null, $id), $label, BR());
if (in_array($data['type'], array(SVC_AGENT, SVC_SNMPv1, SVC_SNMPv2, SVC_SNMPv3))) {
$cmbUniquenessCriteria->addItem($id, $data['name']);
}
}
if (count($dchecks)) {
$dchecks[] = new CButton('delete_ckecks', S_DELETE_SELECTED);
$form->addRow(S_CHECKS, $dchecks);
}
$cmbChkType = new CComboBox('new_check_type', $new_check_type, "if(add_variable(this, 'type_changed', 1)) submit()");
$cmbChkType->addItems(discovery_check_type2str());
if (isset($_REQUEST['type_changed'])) {
$new_check_ports = svc_default_port($new_check_type);
}
$external_param = new CTable();
if ($new_check_type != SVC_ICMPPING) {
$external_param->addRow(array(S_PORTS_SMALL, new CTextBox('new_check_ports', $new_check_ports, 20)));
}
switch ($new_check_type) {
case SVC_SNMPv1:
case SVC_SNMPv2:
$external_param->addRow(array(S_SNMP_COMMUNITY, new CTextBox('new_check_snmp_community', $new_check_snmp_community)));
$external_param->addRow(array(S_SNMP_OID, new CTextBox('new_check_key', $new_check_key)));
$form->addVar('new_check_snmpv3_securitylevel', ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV);
$form->addVar('new_check_snmpv3_securityname', '');
$form->addVar('new_check_snmpv3_authpassphrase', '');
示例8: CTextBox
case CONDITION_TYPE_TRIGGER_NAME:
$rowCondition[] = new CTextBox('new_condition[value]', '', ZBX_TEXTBOX_STANDARD_SIZE);
break;
case CONDITION_TYPE_TRIGGER_VALUE:
$conditionValueComboBox = new CComboBox('new_condition[value]');
foreach (array(TRIGGER_VALUE_FALSE, TRIGGER_VALUE_TRUE) as $trigerValue) {
$conditionValueComboBox->addItem($trigerValue, trigger_value2str($trigerValue));
}
$rowCondition[] = $conditionValueComboBox;
break;
case CONDITION_TYPE_TIME_PERIOD:
$rowCondition[] = new CTextBox('new_condition[value]', ZBX_DEFAULT_INTERVAL, ZBX_TEXTBOX_STANDARD_SIZE);
break;
case CONDITION_TYPE_TRIGGER_SEVERITY:
$conditionValueComboBox = new CComboBox('new_condition[value]');
$conditionValueComboBox->addItems(getSeverityCaption());
$rowCondition[] = $conditionValueComboBox;
break;
case CONDITION_TYPE_MAINTENANCE:
$rowCondition[] = new CCol(_('maintenance'));
break;
case CONDITION_TYPE_NODE:
$conditionFormList->addItem(new CVar('new_condition[value]', '0'));
$rowCondition[] = array(new CTextBox('node', '', ZBX_TEXTBOX_STANDARD_SIZE, 'yes'), SPACE, new CButton('btn1', _('Select'), 'return PopUp("popup.php?srctbl=nodes&srcfld1=nodeid&srcfld2=name' . '&dstfrm=' . $actionForm->getName() . '&dstfld1=new_condition_value&dstfld2=node' . '&writeonly=1", 450, 450);', 'link_menu'));
break;
case CONDITION_TYPE_DRULE:
$conditionFormList->addItem(new CVar('new_condition[value]', '0'));
$rowCondition[] = array(new CTextBox('drule', '', ZBX_TEXTBOX_STANDARD_SIZE, 'yes'), SPACE, new CButton('btn1', _('Select'), 'return PopUp("popup.php?srctbl=drules&srcfld1=druleid&srcfld2=name' . '&dstfrm=' . $actionForm->getName() . '&dstfld1=new_condition_value&dstfld2=drule", 450, 450);', 'link_menu'));
break;
case CONDITION_TYPE_DCHECK:
$conditionFormList->addItem(new CVar('new_condition[value]', '0'));
示例9: CComboBox
if ($config['event_ack_enable']) {
$ackStatusComboBox = new CComboBox('ack_status', $ackStatus);
$ackStatusComboBox->addItem(ZBX_ACK_STS_ANY, _('Any'));
$ackStatusComboBox->additem(ZBX_ACK_STS_WITH_UNACK, _('With unacknowledged events'));
$ackStatusComboBox->additem(ZBX_ACK_STS_WITH_LAST_UNACK, _('With last event unacknowledged'));
$filterForm->addRow(_('Acknowledge status'), $ackStatusComboBox);
}
$eventsComboBox = new CComboBox('show_events', $_REQUEST['show_events']);
$eventsComboBox->addItem(EVENTS_OPTION_NOEVENT, _('Hide all'));
$eventsComboBox->addItem(EVENTS_OPTION_ALL, _('Show all') . ' (' . $config['event_expire'] . ' ' . ($config['event_expire'] > 1 ? _('Days') : _('Day')) . ')');
if ($config['event_ack_enable']) {
$eventsComboBox->addItem(EVENTS_OPTION_NOT_ACK, _('Show unacknowledged') . ' (' . $config['event_expire'] . ' ' . ($config['event_expire'] > 1 ? _('Days') : _('Day')) . ')');
}
$filterForm->addRow(_('Events'), $eventsComboBox);
$severityComboBox = new CComboBox('show_severity', $showSeverity);
$severityComboBox->addItems(array(TRIGGER_SEVERITY_NOT_CLASSIFIED => getSeverityCaption(TRIGGER_SEVERITY_NOT_CLASSIFIED), TRIGGER_SEVERITY_INFORMATION => getSeverityCaption(TRIGGER_SEVERITY_INFORMATION), TRIGGER_SEVERITY_WARNING => getSeverityCaption(TRIGGER_SEVERITY_WARNING), TRIGGER_SEVERITY_AVERAGE => getSeverityCaption(TRIGGER_SEVERITY_AVERAGE), TRIGGER_SEVERITY_HIGH => getSeverityCaption(TRIGGER_SEVERITY_HIGH), TRIGGER_SEVERITY_DISASTER => getSeverityCaption(TRIGGER_SEVERITY_DISASTER)));
$filterForm->addRow(_('Minimum trigger severity'), $severityComboBox);
$statusChangeDays = new CNumericBox('status_change_days', $_REQUEST['status_change_days'], 3, false, false, false);
if (!$_REQUEST['status_change']) {
$statusChangeDays->setAttribute('disabled', 'disabled');
}
$statusChangeDays->addStyle('vertical-align: middle;');
$statusChangeCheckBox = new CCheckBox('status_change', $_REQUEST['status_change'], 'javascript: this.checked ? $("status_change_days").enable() : $("status_change_days").disable()', 1);
$statusChangeCheckBox->addStyle('vertical-align: middle;');
$daysSpan = new CSpan(_('days'));
$daysSpan->addStyle('vertical-align: middle;');
$filterForm->addRow(_('Age less than'), array($statusChangeCheckBox, $statusChangeDays, SPACE, $daysSpan));
$filterForm->addRow(_('Show details'), new CCheckBox('show_details', $_REQUEST['show_details'], null, 1));
$filterForm->addRow(_('Filter by name'), new CTextBox('txt_select', $_REQUEST['txt_select'], 40));
$filterForm->addRow(_('Show hosts in maintenance'), new CCheckBox('show_maintenance', $_REQUEST['show_maintenance'], null, 1));
$filterForm->addItemToBottomRow(new CSubmit('filter_set', _('Filter'), 'chkbxRange.clearSelectedOnFilterChange();'));
示例10: CImg
$iconsComboBox->addItems($this->data['iconList']);
$iconsComboBox->setAttribute('disabled', 'disabled');
$iconPreviewImage = new CImg('imgstore.php?iconid=' . $firstIconId . '&width=' . ZBX_ICON_PREVIEW_WIDTH . '&height=' . ZBX_ICON_PREVIEW_HEIGHT, _('Preview'), null, null, 'pointer preview');
$iconPreviewImage->setAttribute('data-image-full', 'imgstore.php?iconid=' . $firstIconId);
// row template
$hiddenRowTemplate = new CRow(array(new CSpan(null, 'ui-icon ui-icon-arrowthick-2-n-s move'), $numSpan, $profileLinksComboBox, $expressionTextBox, $iconsComboBox, $iconPreviewImage, new CButton('remove', _('Remove'), '', 'link_menu removeMapping')), 'hidden');
$hiddenRowTemplate->setAttribute('id', 'rowTpl');
$iconMapTable->addRow($hiddenRowTemplate);
// add row button
$iconMapTable->addRow(new CCol(new CButton('addMapping', _('Add'), '', 'link_menu'), null, 7));
// <default icon row>
$numSpan = new CSpan($i++ . ':');
$numSpan->addClass('rowNum');
$iconsComboBox = new CComboBox('iconmap[default_iconid]', $this->data['iconmap']['default_iconid']);
$iconsComboBox->addClass('mappingIcon');
$iconsComboBox->addItems($this->data['iconList']);
$iconPreviewImage = new CImg('imgstore.php?iconid=' . $this->data['iconmap']['default_iconid'] . '&width=' . ZBX_ICON_PREVIEW_WIDTH . '&height=' . ZBX_ICON_PREVIEW_HEIGHT, _('Preview'), null, null, 'pointer preview');
$iconPreviewImage->setAttribute('data-image-full', 'imgstore.php?iconid=' . $this->data['iconmap']['default_iconid']);
$iconMapTable->addRow(array(new CCol(_('Default'), null, 4), $iconsComboBox, $iconPreviewImage));
// </default icon row>
$iconMapTab->addRow(_('Mappings'), new CDiv($iconMapTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
$iconMapView = new CTabView();
$iconMapView->addTab('iconmap', _('Icon map'), $iconMapTab);
$iconMapForm->addItem($iconMapView);
// footer
$secondaryActions = array(new CButtonCancel());
if (isset($this->data['iconmapid'])) {
array_unshift($secondaryActions, new CSubmit('clone', _('Clone')), new CButtonDelete(_('Delete icon map?'), url_param('form') . url_param('iconmapid')));
}
$iconMapForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), $secondaryActions));
return $iconMapForm;
示例11: foreach
$frmTRLog->addVar('expressions[' . $id . '][view]', $expr['view']);
$maxid = $maxid < $id ? $id : $maxid;
}
zbx_add_post_js('logexpr_count=' . ($maxid + 1));
$maxid = 0;
foreach ($keys as $id => $val) {
$del_url = new CLink(_('Delete'), '#', 'action', 'javascript: if(confirm("' . _('Delete keyword?') . '")) remove_keyword("keytr' . $id . '"); return false;');
$row = new CRow(array(htmlspecialchars($val['value']), $val['type'], $del_url));
$row->setAttribute('id', 'keytr' . $id);
$keyTable->addRow($row);
$frmTRLog->addVar('keys[' . $id . '][value]', $val['value']);
$frmTRLog->addVar('keys[' . $id . '][type]', $val['type']);
$maxid = $maxid < $id ? $id : $maxid;
}
zbx_add_post_js('key_count=' . ($maxid + 1));
$frmTRLog->addRow(SPACE, $keyTable);
$frmTRLog->addRow(SPACE, $table);
$sev_select = new CComboBox('priority', $priority);
$sev_select->addItems(getSeverityCaption());
$frmTRLog->addRow(_('Severity'), $sev_select);
$frmTRLog->addRow(_('Comments'), new CTextArea('comments', $comments));
$frmTRLog->addRow(_('URL'), new CTextBox('url', $url, 80));
$frmTRLog->addRow(_('Disabled'), new CCheckBox('status', $status == TRIGGER_STATUS_DISABLED ? 'yes' : 'no', null, 1));
$frmTRLog->addItemToBottomRow(new CSubmit('save_trigger', _('Save'), 'javascript: document.forms[0].action += \'?saction=1\';'));
$frmTRLog->addItemToBottomRow(SPACE);
$frmTRLog->addItemToBottomRow(new CButton('cancel', _('Cancel'), 'javascript: self.close();'));
if ($bExprResult) {
$frmTRLog->show();
}
}
require_once dirname(__FILE__) . '/include/page_footer.php';
示例12: CVisibilityBox
$itemFormList->addRow(array(_('Privacy protocol'), SPACE, new CVisibilityBox('visible[privprotocol]', isset($this->data['visible']['privprotocol']), 'privprotocol_div', _('Original'))), $privProtocol);
// append snmpv3 privpassphrase to form list
$itemFormList->addRow(array(_('Privacy passphrase'), SPACE, new CVisibilityBox('visible[privpassphras]', isset($this->data['visible']['privpassphras']), 'snmpv3_privpassphrase', _('Original'))), new CTextBox('snmpv3_privpassphrase', $this->data['snmpv3_privpassphrase'], ZBX_TEXTBOX_STANDARD_SIZE));
// append port to form list
$itemFormList->addRow(array(_('Port'), SPACE, new CVisibilityBox('visible[port]', isset($this->data['visible']['port']), 'port', _('Original'))), new CTextBox('port', $this->data['port'], ZBX_TEXTBOX_SMALL_SIZE));
// append value type to form list
$valueTypeComboBox = new CComboBox('value_type', $this->data['value_type']);
$valueTypeComboBox->addItem(ITEM_VALUE_TYPE_UINT64, _('Numeric (unsigned)'));
$valueTypeComboBox->addItem(ITEM_VALUE_TYPE_FLOAT, _('Numeric (float)'));
$valueTypeComboBox->addItem(ITEM_VALUE_TYPE_STR, _('Character'));
$valueTypeComboBox->addItem(ITEM_VALUE_TYPE_LOG, _('Log'));
$valueTypeComboBox->addItem(ITEM_VALUE_TYPE_TEXT, _('Text'));
$itemFormList->addRow(array(_('Type of information'), SPACE, new CVisibilityBox('visible[value_type]', isset($this->data['visible']['value_type']), 'value_type', _('Original'))), $valueTypeComboBox);
// append data type to form list
$dataTypeComboBox = new CComboBox('data_type', $this->data['data_type']);
$dataTypeComboBox->addItems(item_data_type2str());
$itemFormList->addRow(array(_('Data type'), SPACE, new CVisibilityBox('visible[data_type]', isset($this->data['visible']['data_type']), 'data_type', _('Original'))), $dataTypeComboBox);
// append units to form list
$itemFormList->addRow(array(_('Units'), SPACE, new CVisibilityBox('visible[units]', isset($this->data['visible']['units']), 'units', _('Original'))), new CTextBox('units', $this->data['units'], ZBX_TEXTBOX_STANDARD_SIZE));
// append authtype to form list
$authTypeComboBox = new CComboBox('authtype', $this->data['authtype']);
$authTypeComboBox->addItem(ITEM_AUTHTYPE_PASSWORD, _('Password'));
$authTypeComboBox->addItem(ITEM_AUTHTYPE_PUBLICKEY, _('Public key'));
$itemFormList->addRow(array(_('Authentication method'), SPACE, new CVisibilityBox('visible[authtype]', isset($this->data['visible']['authtype']), 'authtype', _('Original'))), $authTypeComboBox);
// append username to form list
$itemFormList->addRow(array(_('User name'), SPACE, new CVisibilityBox('visible[username]', isset($this->data['visible']['username']), 'username', _('Original'))), new CTextBox('username', $this->data['username'], ZBX_TEXTBOX_STANDARD_SIZE));
// append publickey to form list
$itemFormList->addRow(array(_('Public key file'), SPACE, new CVisibilityBox('visible[publickey]', isset($this->data['visible']['publickey']), 'publickey', _('Original'))), new CTextBox('publickey', $this->data['publickey'], ZBX_TEXTBOX_STANDARD_SIZE));
// append privatekey to form list
$itemFormList->addRow(array(_('Private key file'), SPACE, new CVisibilityBox('visible[privatekey]', isset($this->data['visible']['privatekey']), 'privatekey', _('Original'))), new CTextBox('privatekey', $this->data['privatekey'], ZBX_TEXTBOX_STANDARD_SIZE));
// append password
示例13: CFormList
}
// create form list
$itemFormList = new CFormList('itemFormList');
if (!empty($this->data['templates'])) {
$itemFormList->addRow(_('Parent discovery rules'), $this->data['templates']);
}
$nameTextBox = new CTextBox('name', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE, $this->data['limited']);
$nameTextBox->attr('autofocus', 'autofocus');
$itemFormList->addRow(_('Name'), $nameTextBox);
// append type to form list
if ($this->data['limited']) {
$itemForm->addVar('type', $this->data['type']);
$itemFormList->addRow(_('Type'), new CTextBox('typename', item_type2str($this->data['type']), ZBX_TEXTBOX_STANDARD_SIZE, true));
} else {
$typeComboBox = new CComboBox('type', $this->data['type']);
$typeComboBox->addItems($this->data['types']);
$itemFormList->addRow(_('Type'), $typeComboBox);
}
// append key to form list
$itemFormList->addRow(_('Key'), array(new CTextBox('key', $this->data['key'], ZBX_TEXTBOX_STANDARD_SIZE, $this->data['limited'])));
// append interfaces to form list
if (!empty($this->data['interfaces'])) {
$interfacesComboBox = new CComboBox('interfaceid', $this->data['interfaceid']);
// set up interface groups
$interfaceGroups = array();
foreach (zbx_objectValues($this->data['interfaces'], 'type') as $interfaceType) {
$interfaceGroups[$interfaceType] = new COptGroup(interfaceType2str($interfaceType));
}
// add interfaces to groups
foreach ($this->data['interfaces'] as $interface) {
$option = new CComboItem($interface['interfaceid'], $interface['useip'] ? $interface['ip'] . ' : ' . $interface['port'] : $interface['dns'] . ' : ' . $interface['port'], $interface['interfaceid'] == $this->data['interfaceid'] ? 'yes' : 'no');
示例14: getItemFilterForm
function getItemFilterForm(&$items)
{
$filter_groupId = $_REQUEST['filter_groupid'];
$filter_hostId = $_REQUEST['filter_hostid'];
$filter_application = $_REQUEST['filter_application'];
$filter_name = $_REQUEST['filter_name'];
$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_port = $_REQUEST['filter_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_state = $_REQUEST['filter_state'];
$filter_templated_items = $_REQUEST['filter_templated_items'];
$filter_with_triggers = $_REQUEST['filter_with_triggers'];
$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_state = $_REQUEST['subfilter_state'];
$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 CFilter('web.items.filter.state'))->addVar('subfilter_hosts', $subfilter_hosts)->addVar('subfilter_apps', $subfilter_apps)->addVar('subfilter_types', $subfilter_types)->addVar('subfilter_value_types', $subfilter_value_types)->addVar('subfilter_status', $subfilter_status)->addVar('subfilter_state', $subfilter_state)->addVar('subfilter_templated_items', $subfilter_templated_items)->addVar('subfilter_with_triggers', $subfilter_with_triggers)->addVar('subfilter_history', $subfilter_history)->addVar('subfilter_trends', $subfilter_trends)->addVar('subfilter_interval', $subfilter_interval);
$filterColumn1 = new CFormList();
$filterColumn2 = new CFormList();
$filterColumn3 = new CFormList();
$filterColumn4 = new CFormList();
// type select
$fTypeVisibility = [];
$cmbType = new CComboBox('filter_type', $filter_type, null, [-1 => _('all')]);
zbx_subarray_push($fTypeVisibility, -1, 'filter_delay_row');
$item_types = item_type2str();
unset($item_types[ITEM_TYPE_HTTPTEST]);
// httptest items are only for internal zabbix logic
$cmbType->addItems($item_types);
foreach ($item_types as $type => $name) {
if ($type != ITEM_TYPE_TRAPPER && $type != ITEM_TYPE_SNMPTRAP) {
zbx_subarray_push($fTypeVisibility, $type, 'filter_delay_row');
}
switch ($type) {
case ITEM_TYPE_SNMPV1:
case ITEM_TYPE_SNMPV2C:
zbx_subarray_push($fTypeVisibility, $type, 'filter_snmp_community_row');
zbx_subarray_push($fTypeVisibility, $type, 'filter_snmp_oid_row');
zbx_subarray_push($fTypeVisibility, $type, 'filter_port_row');
break;
case ITEM_TYPE_SNMPV3:
zbx_subarray_push($fTypeVisibility, $type, 'filter_snmpv3_securityname_row');
zbx_subarray_push($fTypeVisibility, $type, 'filter_snmp_oid_row');
zbx_subarray_push($fTypeVisibility, $type, 'filter_port_row');
break;
}
}
zbx_add_post_js("var filterTypeSwitcher = new CViewSwitcher('filter_type', 'change', " . zbx_jsvalue($fTypeVisibility, true) . ');');
// type of information select
$fVTypeVisibility = [];
zbx_subarray_push($fVTypeVisibility, ITEM_VALUE_TYPE_UINT64, 'filter_data_type_row');
zbx_add_post_js("var filterValueTypeSwitcher = new CViewSwitcher('filter_value_type', 'change', " . zbx_jsvalue($fVTypeVisibility, true) . ');');
// row 1
$groupFilter = null;
if (!empty($filter_groupId)) {
$getHostInfo = API::HostGroup()->get(['groupids' => $filter_groupId, 'output' => ['name']]);
$getHostInfo = reset($getHostInfo);
if (!empty($getHostInfo)) {
$groupFilter[] = ['id' => $getHostInfo['groupid'], 'name' => $getHostInfo['name']];
}
}
$filterColumn1->addRow(_('Host group'), (new CMultiSelect(['name' => 'filter_groupid', 'selectedLimit' => 1, 'objectName' => 'hostGroup', 'objectOptions' => ['editable' => true], 'data' => $groupFilter, 'popup' => ['parameters' => 'srctbl=host_groups&dstfrm=' . $form->getName() . '&dstfld1=filter_groupid' . '&srcfld1=groupid&writeonly=1']]))->setWidth(ZBX_TEXTAREA_FILTER_SMALL_WIDTH));
$filterColumn2->addRow(_('Type'), $cmbType);
$filterColumn3->addRow(_('Type of information'), new CComboBox('filter_value_type', $filter_value_type, null, [-1 => _('all'), ITEM_VALUE_TYPE_UINT64 => _('Numeric (unsigned)'), ITEM_VALUE_TYPE_FLOAT => _('Numeric (float)'), ITEM_VALUE_TYPE_STR => _('Character'), ITEM_VALUE_TYPE_LOG => _('Log'), ITEM_VALUE_TYPE_TEXT => _('Text')]));
$filterColumn4->addRow(_('State'), new CComboBox('filter_state', $filter_state, null, [-1 => _('all'), ITEM_STATE_NORMAL => itemState(ITEM_STATE_NORMAL), ITEM_STATE_NOTSUPPORTED => itemState(ITEM_STATE_NOTSUPPORTED)]));
// row 2
$hostFilterData = null;
if (!empty($filter_hostId)) {
$getHostInfo = API::Host()->get(['hostids' => $filter_hostId, 'templated_hosts' => true, 'output' => ['name']]);
$getHostInfo = reset($getHostInfo);
if (!empty($getHostInfo)) {
$hostFilterData[] = ['id' => $getHostInfo['hostid'], 'name' => $getHostInfo['name']];
}
}
$filterColumn1->addRow(_('Host'), (new CMultiSelect(['name' => 'filter_hostid', 'selectedLimit' => 1, 'objectName' => 'hosts', 'objectOptions' => ['editable' => true, 'templated_hosts' => true], 'data' => $hostFilterData, 'popup' => ['parameters' => 'srctbl=host_templates&dstfrm=' . $form->getName() . '&dstfld1=filter_hostid' . '&srcfld1=hostid&writeonly=1']]))->setWidth(ZBX_TEXTAREA_FILTER_SMALL_WIDTH));
$filterColumn2->addRow(_('Update interval (in sec)'), (new CNumericBox('filter_delay', $filter_delay, 5, false, true))->setWidth(ZBX_TEXTAREA_NUMERIC_STANDARD_WIDTH), 'filter_delay_row');
$filterColumn3->addRow(_('Data type'), (new CComboBox('filter_data_type', $filter_data_type))->addItem(-1, _('all'))->addItems(item_data_type2str()), 'filter_data_type_row');
$filterColumn4->addRow(_('Status'), new CComboBox('filter_status', $filter_status, null, [-1 => _('all'), ITEM_STATUS_ACTIVE => item_status2str(ITEM_STATUS_ACTIVE), ITEM_STATUS_DISABLED => item_status2str(ITEM_STATUS_DISABLED)]));
// row 3
$filterColumn1->addRow(_('Application'), [(new CTextBox('filter_application', $filter_application))->setWidth(ZBX_TEXTAREA_FILTER_SMALL_WIDTH), (new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN), (new CButton(null, _('Select')))->addClass(ZBX_STYLE_BTN_GREY)->onClick('return PopUp("popup.php?srctbl=applications&srcfld1=name' . '&dstfrm=' . $form->getName() . '&dstfld1=filter_application' . '&with_applications=1' . '" + (jQuery("input[name=\'filter_hostid\']").length > 0 ? "&hostid="+jQuery("input[name=\'filter_hostid\']").val() : "")' . ', 0, 0, "application");')]);
$filterColumn2->addRow(_('SNMP community'), (new CTextBox('filter_snmp_community', $filter_snmp_community))->setWidth(ZBX_TEXTAREA_FILTER_SMALL_WIDTH), 'filter_snmp_community_row');
$filterColumn2->addRow(_('Security name'), (new CTextBox('filter_snmpv3_securityname', $filter_snmpv3_securityname))->setWidth(ZBX_TEXTAREA_FILTER_SMALL_WIDTH), 'filter_snmpv3_securityname_row');
$filterColumn3->addRow(_('History (in days)'), (new CNumericBox('filter_history', $filter_history, 8, false, true))->setWidth(ZBX_TEXTAREA_NUMERIC_STANDARD_WIDTH));
$filterColumn4->addRow(_('Triggers'), new CComboBox('filter_with_triggers', $filter_with_triggers, null, [-1 => _('all'), 1 => _('With triggers'), 0 => _('Without triggers')]));
//.........这里部分代码省略.........
示例15: CComboBox
if (!$this->data['templated']) {
$nameTextBox->attr('autofocus', 'autofocus');
}
$httpFormList->addRow(_('Name'), $nameTextBox);
// Application
if ($this->data['application_list']) {
$applications = zbx_array_merge(array(''), $this->data['application_list']);
$httpFormList->addRow(_('Application'), new CComboBox('applicationid', $this->data['applicationid'], null, $applications));
} else {
$httpFormList->addRow(_('Application'), new CSpan(_('No applications found.')));
}
// New application
$httpFormList->addRow(_('New application'), new CTextBox('new_application', $this->data['new_application'], ZBX_TEXTBOX_STANDARD_SIZE), false, null, 'new');
// Authentication
$authenticationComboBox = new CComboBox('authentication', $this->data['authentication'], 'submit();');
$authenticationComboBox->addItems(httptest_authentications());
$httpFormList->addRow(_('Authentication'), $authenticationComboBox);
if (in_array($this->data['authentication'], array(HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM))) {
$httpFormList->addRow(_('User'), new CTextBox('http_user', $this->data['http_user'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64));
$httpFormList->addRow(_('Password'), new CTextBox('http_password', $this->data['http_password'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64));
}
// update interval
$httpFormList->addRow(_('Update interval (in sec)'), new CNumericBox('delay', $this->data['delay'], 5));
// number of retries
$httpFormList->addRow(_('Retries'), new CNumericBox('retries', $this->data['retries'], 2));
// append http agents to form list - http://www.useragentstring.com
$agentComboBox = new CEditableComboBox('agent', $this->data['agent'], ZBX_TEXTBOX_STANDARD_SIZE);
$agentComboBox->addItemsInGroup(_('Internet Explorer'), array('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)' => 'Internet Explorer 10.0', 'Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)' => 'Internet Explorer 9.0', 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322)' => 'Internet Explorer 8.0', 'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)' => 'Internet Explorer 7.0', 'Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1)' => 'Internet Explorer 6.0'));
$agentComboBox->addItemsInGroup(_('Mozilla Firefox'), array('Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0' => 'Mozilla Firefox 8.0', 'Mozilla/5.0 (X11; Linux i686; rv:7.0) Gecko/20100101 Firefox/7.0' => 'Mozilla Firefox 7.0', 'Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101 Firefox/6.0' => 'Mozilla Firefox 6.0', 'Mozilla/5.0 (X11; U; Linux i586; de; rv:5.0) Gecko/20100101 Firefox/5.0' => 'Mozilla Firefox 5.0', 'Mozilla/5.0 (X11; U; Linux x86_64; pl-PL; rv:2.0) Gecko/20110307 Firefox/4.0' => 'Mozilla Firefox 4.0', 'Mozilla/6.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:2.0.0.0) Gecko/20061028 Firefox/3.0' => 'Mozilla Firefox 3.0', 'Mozilla/5.0 (X11;U;Linux i686;en-US;rv:1.8.1) Gecko/2006101022 Firefox/2.0' => 'Mozilla Firefox 2.0'));
$agentComboBox->addItemsInGroup(_('Opera'), array('Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00' => 'Opera 12.00', 'Opera/9.80 (X11; Linux x86_64; U; pl) Presto/2.7.62 Version/11.00' => 'Opera 11.00', 'Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.2.15 Version/10.00' => 'Opera 10.00', 'Opera/9.00 (X11; Linux i686; U; pl)' => 'Opera 9.00'));
$agentComboBox->addItemsInGroup(_('Safari'), array('Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+' => 'Safari 5.0', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; ru-RU) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16' => 'Safari 4.0', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE) AppleWebKit/523.13 (KHTML, like Gecko) Version/3.0 Safari/523.13' => 'Safari 3.0', 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_1 like Mac OS X; fr-fr) AppleWebKit/525.18.1 (KHTML, like Gecko) Mobile/5F136' => 'Safari on iPhone'));