本文整理汇总了PHP中CFormTable::addRow方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormTable::addRow方法的具体用法?PHP CFormTable::addRow怎么用?PHP CFormTable::addRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFormTable
的用法示例。
在下文中一共展示了CFormTable::addRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
// $cmbHosts = new CComboBox('hostid',$_REQUEST['hostid'],"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."',this.form);");
$options = array('groups' => array('monitored_hosts' => 1, 'with_historical_items' => 1), 'hosts' => array('monitored_hosts' => 1, 'with_historical_items' => 1), 'hostid' => get_request('hostid', null), 'groupid' => get_request('groupid', null));
$pageFilter = new CPageFilter($options);
$_REQUEST['groupid'] = $pageFilter->groupid;
$_REQUEST['hostid'] = $pageFilter->hostid;
$available_hosts = $pageFilter->hostsSelected ? array_keys($pageFilter->hosts) : array();
$r_form->addItem(array(S_GROUP . SPACE, $pageFilter->getGroupsCB(true)));
$r_form->addItem(array(SPACE . S_HOST . SPACE, $pageFilter->getHostsCB(true)));
$latest_wdgt->addHeader(S_ITEMS_BIG, $r_form);
//-------------
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable();
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addRow(S_SHOW_ITEMS_WITH_DESCRIPTION_LIKE, new CTextBox('select', $_REQUEST['select'], 20));
$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);
$latest_wdgt->addFlicker($filterForm, CProfile::get('web.latest.filter.state', 1));
//-------
validate_sort_and_sortorder('i.description', ZBX_SORT_UP);
$_REQUEST['groupbyapp'] = get_request('groupbyapp', CProfile::get('web.latest.groupbyapp', 1));
CProfile::update('web.latest.groupbyapp', $_REQUEST['groupbyapp'], PROFILE_TYPE_INT);
$_REQUEST['apps'] = get_request('apps', array());
$apps = zbx_toHash($_REQUEST['apps']);
if (isset($_REQUEST['open'])) {
$showAll = 1;
if (isset($_REQUEST['applicationid'])) {
示例2: CFormTable
$numrows->setAttribute('name', 'numrows');
$trigg_wdgt->addHeader(S_TRIGGERS_BIG, $r_form);
$trigg_wdgt->addHeader($numrows);
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable(null, null, 'get');
//,'tr_status.php?filter_set=1','POST',null,'sform');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addVar('fullscreen', $_REQUEST['fullscreen']);
$filterForm->addVar('groupid', $_REQUEST['groupid']);
$filterForm->addVar('hostid', $_REQUEST['hostid']);
$tr_select = new CComboBox('show_triggers', $show_triggers);
$tr_select->addItem(TRIGGERS_OPTION_ALL, S_ANY);
$tr_select->additem(TRIGGERS_OPTION_ONLYTRUE, S_PROBLEM);
$filterForm->addRow(S_TRIGGERS_STATUS, $tr_select);
if ($config['event_ack_enable']) {
$cb_ack_status = new CComboBox('ack_status', $ack_status);
$cb_ack_status->addItem(ZBX_ACK_STS_ANY, S_ANY);
$cb_ack_status->additem(ZBX_ACK_STS_WITH_UNACK, S_WITH_UNACKNOWLEDGED_EVENTS);
$cb_ack_status->additem(ZBX_ACK_STS_WITH_LAST_UNACK, S_WITH_LAST_EVENT_UNACKNOWLEDGED);
$filterForm->addRow(S_ACKNOWLEDGE_STATUS, $cb_ack_status);
}
$ev_select = new CComboBox('show_events', $_REQUEST['show_events']);
$ev_select->addItem(EVENTS_OPTION_NOEVENT, S_HIDE_ALL);
$ev_select->addItem(EVENTS_OPTION_ALL, S_SHOW_ALL . SPACE . '(' . $config['event_expire'] . SPACE . ($config['event_expire'] > 1 ? S_DAYS : S_DAY) . ')');
if ($config['event_ack_enable']) {
$ev_select->addItem(EVENTS_OPTION_NOT_ACK, S_SHOW_UNACKNOWLEDGED . SPACE . '(' . $config['event_expire'] . SPACE . ($config['event_expire'] > 1 ? S_DAYS : S_DAY) . ')');
}
$filterForm->addRow(S_EVENTS, $ev_select);
$severity_select = new CComboBox('show_severity', $show_severity);
示例3: array
$groupids = zbx_toHash($groupids);
$grpswitch = CProfile::get('web.dashconf.groups.grpswitch', 0);
$maintenance = CProfile::get('web.dashconf.hosts.maintenance', 1);
$extAck = CProfile::get('web.dashconf.events.extAck', 0);
$severity = CProfile::get('web.dashconf.triggers.severity', '0;1;2;3;4;5');
$severity = zbx_empty($severity) ? array() : explode(';', $severity);
}
$dashForm->addVar('filterEnable', $filterEnable);
if ($filterEnable) {
$cbFilter = new CSpan(S_ENABLED, 'green underline pointer');
$cbFilter->setAttribute('onclick', "create_var('" . $dashForm->getName() . "', 'filterEnable', 0, true);");
} else {
$cbFilter = new CSpan(S_DISABLED, 'red underline pointer');
$cbFilter->setAttribute('onclick', "\$('dashform').enable(); create_var('" . $dashForm->getName() . "', 'filterEnable', 1, true);");
}
$dashForm->addRow(S_DASHBOARD_FILTER, $cbFilter);
$dashForm->addVar('groupids', $groupids);
$cmbGroups = new CComboBox('grpswitch', $grpswitch, 'submit();');
$cmbGroups->addItem(0, S_ALL_S);
$cmbGroups->addItem(1, S_SELECTED);
if (!$filterEnable) {
$cmbGroups->setAttribute('disabled', 'disabled');
}
$dashForm->addRow(S_HOST_GROUPS, $cmbGroups);
if ($grpswitch == 1) {
$options = array('nodeids' => get_current_nodeid(true), 'groupids' => $groupids, 'output' => API_OUTPUT_EXTEND);
$groups = CHostGroup::get($options);
order_result($groups, 'name');
$lstGroups = new CListBox('del_groups[]', null, 15);
$lstGroups->setAttribute('style', 'width: 200px;');
foreach ($groups as $gnum => $group) {
示例4: CForm
$r_form = new CForm('get');
$options = array('groups' => array('monitored_hosts' => 1), 'hosts' => array('monitored_hosts' => 1), 'hostid' => get_request('hostid', null), 'groupid' => get_request('groupid', null));
$pageFilter = new CPageFilter($options);
$_REQUEST['groupid'] = $pageFilter->groupid;
$_REQUEST['hostid'] = $pageFilter->hostid;
$available_hosts = $pageFilter->hostsSelected ? array_keys($pageFilter->hosts) : array();
$r_form->addItem(array(_('Group') . SPACE, $pageFilter->getGroupsCB(true)));
$r_form->addItem(array(SPACE . _('Host') . SPACE, $pageFilter->getHostsCB(true)));
$latest_wdgt->addHeader(_('Items'), $r_form);
//-------------
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable(null, null, 'get');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addRow(_('Show items with name like'), new CTextBox('select', $_REQUEST['select'], 20));
$filterForm->addRow(_('Show items without data'), new CCheckBox('show_without_data', $_REQUEST['show_without_data'], null, 1));
$reset = new CButton("filter_rst", _('Reset'), 'javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();');
$filterForm->addItemToBottomRow(new CSubmit("filter_set", _('Filter')));
$filterForm->addItemToBottomRow($reset);
$latest_wdgt->addFlicker($filterForm, CProfile::get('web.latest.filter.state', 1));
//-------
validate_sort_and_sortorder('i.name', ZBX_SORT_UP);
$_REQUEST['apps'] = get_request('apps', array());
$apps = zbx_toHash($_REQUEST['apps']);
if (isset($_REQUEST['open'])) {
$showAll = 1;
if (isset($_REQUEST['applicationid'])) {
$apps[$_REQUEST['applicationid']] = $_REQUEST['applicationid'];
}
} else {
示例5: CFormTable
$filterForm = null;
if (EVENT_SOURCE_TRIGGERS == $source) {
$filterForm = new CFormTable(null, null, 'get');
//,'events.php?filter_set=1','POST',null,'sform');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addVar('triggerid', get_request('triggerid'));
$filterForm->addVar('stime', get_request('stime'));
$filterForm->addVar('period', get_request('period'));
if (isset($_REQUEST['triggerid']) && $_REQUEST['triggerid'] > 0) {
$trigger = expand_trigger_description($_REQUEST['triggerid']);
} else {
$trigger = '';
}
$row = new CRow(array(new CCol(S_TRIGGER, 'form_row_l'), new CCol(array(new CTextBox('trigger', $trigger, 96, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->getName() . "&dstfld1=triggerid&dstfld2=trigger" . "&srctbl=triggers&srcfld1=triggerid&srcfld2=description&real_hosts=1');", 'T')), 'form_row_r')));
$filterForm->addRow($row);
$filterForm->addVar('hide_unknown', $_REQUEST['hide_unknown']);
$unkcbx = new CCheckBox('hide_unk', $_REQUEST['hide_unknown'], null, '1');
$unkcbx->setAction('javascript: create_var("' . $filterForm->GetName() . '", "hide_unknown", (this.checked?1:0), 0); ');
$filterForm->addRow(S_HIDE_UNKNOWN, $unkcbx);
$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);
}
$events_wdgt->addFlicker($filterForm, CProfile::get('web.events.filter.state', 0));
$scroll_div = new CDiv();
$scroll_div->setAttribute('id', 'scrollbar_cntr');
$events_wdgt->addFlicker($scroll_div, CProfile::get('web.events.filter.state', 0));
// }}} FILTER
示例6: CTextBox
$command = get_request('command', '');
$usrgrpid = get_request('usrgrpid', 0);
$groupid = get_request('groupid', 0);
$access = get_request('access', PERM_READ_ONLY);
}
if (isset($_REQUEST['scriptid']) && !isset($_REQUEST['form_refresh'])) {
$frmScr->addVar('form_refresh', get_request('form_refresh', 1));
if ($script = get_script_by_scriptid($_REQUEST['scriptid'])) {
$name = $script['name'];
$command = $script['command'];
$usrgrpid = $script['usrgrpid'];
$groupid = $script['groupid'];
$access = $script['host_access'];
}
}
$frmScr->addRow(S_NAME, new CTextBox('name', $name, 80));
$frmScr->addRow(S_COMMAND, new CTextBox('command', $command, 80));
$usr_groups = new CCombobox('usrgrpid', $usrgrpid);
$usr_groups->addItem(0, S_ALL_S);
$sql = 'SELECT DISTINCT ug.name, ug.usrgrpid ' . ' FROM usrgrp ug ' . ' WHERE ' . DBin_node('ug.usrgrpid') . ' ORDER BY ug.name';
$usrgrp_result = DBselect($sql);
while ($usr_group = DBfetch($usrgrp_result)) {
$usr_groups->addItem($usr_group['usrgrpid'], $usr_group['name']);
}
$frmScr->addRow(S_USER_GROUPS, $usr_groups);
$host_groups = new CCombobox('groupid', $groupid);
$host_groups->addItem(0, S_ALL_S);
$sql = 'SELECT DISTINCT g.name, g.groupid ' . ' FROM groups g ' . ' WHERE ' . DBcondition('g.groupid', $available_groups) . ' ORDER BY g.name';
$grp_result = DBselect($sql);
while ($group = DBfetch($grp_result)) {
$host_groups->addItem($group['groupid'], $group['name']);
示例7: CFormTable
echo SBR;
$frmPd = new CFormTable(S_PERIOD);
$frmPd->setName('period');
$frmPd->addVar('dstfrm', $_REQUEST['dstfrm']);
$config = get_request('config', 1);
$caption = get_request('caption', '');
$color = get_request('color', '009900');
$report_timesince = get_request('report_timesince', time() - 86400);
$report_timetill = get_request('report_timetill', time());
$frmPd->addVar('config', $config);
$frmPd->addVar('report_timesince', $report_timesince);
$frmPd->addVar('report_timetill', $report_timetill);
if (isset($_REQUEST['period_id'])) {
$frmPd->addVar('period_id', $_REQUEST['period_id']);
}
$frmPd->addRow(array(new CVisibilityBox('caption_visible', !zbx_empty($caption), 'caption', S_DEFAULT), S_CAPTION), new CTextBox('caption', $caption, 10));
// $frmPd->addRow(S_CAPTION, new CTextBox('caption',$caption,10));
//*
$clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer');
$clndr_icon->addAction('onclick', 'javascript: ' . 'var pos = getPosition(this); ' . 'pos.top+=10; ' . 'pos.left+=16; ' . "CLNDR['avail_report_since'].clndr.clndrshow(pos.top,pos.left);");
$reporttimetab = new CTable(null, 'calendar');
$reporttimetab->setAttribute('width', '10%');
$reporttimetab->setCellPadding(0);
$reporttimetab->setCellSpacing(0);
$reporttimetab->addRow(array(S_FROM, new CNumericBox('report_since_day', $report_timesince > 0 ? date('d', $report_timesince) : '', 2), '/', new CNumericBox('report_since_month', $report_timesince > 0 ? date('m', $report_timesince) : '', 2), '/', new CNumericBox('report_since_year', $report_timesince > 0 ? date('Y', $report_timesince) : '', 4), SPACE, new CNumericBox('report_since_hour', $report_timesince > 0 ? date('H', $report_timesince) : '', 2), ':', new CNumericBox('report_since_minute', $report_timesince > 0 ? date('i', $report_timesince) : '', 2), $clndr_icon));
zbx_add_post_js('create_calendar(null,' . '["report_since_day","report_since_month","report_since_year","report_since_hour","report_since_minute"],' . '"avail_report_since",' . '"report_timesince");');
$clndr_icon->addAction('onclick', 'javascript: ' . 'var pos = getPosition(this); ' . 'pos.top+=10; ' . 'pos.left+=16; ' . "CLNDR['avail_report_till'].clndr.clndrshow(pos.top,pos.left);");
$reporttimetab->addRow(array(S_TILL, new CNumericBox('report_till_day', $report_timetill > 0 ? date('d', $report_timetill) : '', 2), '/', new CNumericBox('report_till_month', $report_timetill > 0 ? date('m', $report_timetill) : '', 2), '/', new CNumericBox('report_till_year', $report_timetill > 0 ? date('Y', $report_timetill) : '', 4), SPACE, new CNumericBox('report_till_hour', $report_timetill > 0 ? date('H', $report_timetill) : '', 2), ':', new CNumericBox('report_till_minute', $report_timetill > 0 ? date('i', $report_timetill) : '', 2), $clndr_icon));
zbx_add_post_js('create_calendar(null,' . '["report_till_day","report_till_month","report_till_year","report_till_hour","report_till_minute"],' . '"avail_report_till",' . '"report_timetill");');
$frmPd->addRow(S_PERIOD, $reporttimetab);
//*/
示例8: CFormTable
/***********************************************************/
$filterForm = new CFormTable();
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$script = new CScript("javascript: if(CLNDR['audit_since'].clndr.setSDateFromOuterObj()){" . "\$('nav_time').value = parseInt(CLNDR['audit_since'].clndr.sdt.getTime()/1000);}");
$filterForm->addAction('onsubmit', $script);
$filterForm->addVar('nav_time', $_REQUEST['nav_time'] > 0 ? $_REQUEST['nav_time'] : '');
$filterForm->addVar('config', $_REQUEST['config']);
$filterForm->addVar('userid', $_REQUEST['userid']);
if (isset($_REQUEST['userid']) && $_REQUEST['userid'] > 0) {
$user = get_user_by_userid($_REQUEST['userid']);
} else {
$user['alias'] = '';
}
$row = new CRow(array(new CCol($config == 1 ? S_RECIPIENT : S_USER, 'form_row_l'), new CCol(array(new CTextBox("user", $user['alias'], 32, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->GetName() . "&dstfld1=userid&dstfld2=user" . "&srctbl=users&srcfld1=userid&srcfld2=alias&real_hosts=1');", 'T')), 'form_row_r')));
$filterForm->addRow($row);
if ($config == 0) {
$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']);
$cmbResource->addItem(-1, S_ALL_S);
$cmbResource->addItem(AUDIT_RESOURCE_USER, S_USER);
// $cmbResource->addItem(AUDIT_RESOURCE_ZABBIX, S_ZABBIX);
示例9: reset
continue;
}
$host = reset($item['hosts']);
$itemsData[$itemid]['id'] = $itemid;
$itemsData[$itemid]['name'] = $host['name'] . NAME_DELIMITER . $item['name_expanded'];
}
order_result($itemsData, 'name');
foreach ($itemsData as $item) {
$itemListbox->addItem($item['id'], $item['name']);
}
$addItemButton = new CButton('add_log', _('Add'), "return PopUp('popup.php?multiselect=1&real_hosts=1" . '&reference=itemid&srctbl=items&value_types[]=' . $this->data['item']['value_type'] . "&srcfld1=itemid');");
$deleteItemButton = null;
if (count($this->data['items']) > 1) {
$deleteItemButton = new CSubmit('remove_log', _('Remove selected'), "javascript: removeSelectedItems('cmbitemlist_', 'itemid')");
}
$filterForm->addRow(_('Items list'), array($itemListbox, BR(), $addItemButton, $deleteItemButton));
$filterForm->addRow(_('Select rows with value like'), new CTextBox('filter', get_request('filter', ''), ZBX_TEXTBOX_FILTER_SIZE));
$filterTask = get_request('filter_task', 0);
$taskComboBox = new CComboBox('filter_task', $filterTask, 'submit()');
$taskComboBox->addItem(FILTER_TASK_SHOW, _('Show selected'));
$taskComboBox->addItem(FILTER_TASK_HIDE, _('Hide selected'));
$taskComboBox->addItem(FILTER_TASK_MARK, _('Mark selected'));
$taskComboBox->addItem(FILTER_TASK_INVERT_MARK, _('Mark others'));
$tasks = array($taskComboBox);
if (str_in_array($filterTask, array(FILTER_TASK_MARK, FILTER_TASK_INVERT_MARK))) {
$colorComboBox = new CComboBox('mark_color', get_request('mark_color', 0));
$colorComboBox->addItem(MARK_COLOR_RED, _('as Red'));
$colorComboBox->addItem(MARK_COLOR_GREEN, _('as Green'));
$colorComboBox->addItem(MARK_COLOR_BLUE, _('as Blue'));
$tasks[] = SPACE;
$tasks[] = $colorComboBox;
示例10: CFormTable
}
$media = get_request('media', -1);
$sendto = get_request('sendto', '');
$mediatypeid = get_request('mediatypeid', 0);
$active = get_request('active', 0);
$period = get_request('period', ZBX_DEFAULT_INTERVAL);
$frmMedia = new CFormTable(_('New media'));
$frmMedia->addVar('media', $media);
$frmMedia->addVar('dstfrm', $_REQUEST['dstfrm']);
$cmbType = new CComboBox('mediatypeid', $mediatypeid);
$sql = 'SELECT mediatypeid,description ' . ' FROM media_type' . ' WHERE ' . DBin_node('mediatypeid') . ' ORDER BY type';
$types = DBselect($sql);
while ($type = DBfetch($types)) {
$cmbType->addItem($type['mediatypeid'], get_node_name_by_elid($type['mediatypeid'], null, ': ') . $type['description']);
}
$frmMedia->addRow(_('Type'), $cmbType);
$frmMedia->addRow(_('Send to'), new CTextBox('sendto', $sendto, 20));
$frmMedia->addRow(_('When active'), new CTextBox('period', $period, 48));
$frm_row = array();
foreach (getSeverityCaption() as $i => $caption) {
$frm_row[] = array(new CCheckBox('severity[' . $i . ']', str_in_array($i, $severity), null, $i), $caption);
$frm_row[] = BR();
}
$frmMedia->addRow(_('Use if severity'), $frm_row);
$cmbStat = new CComboBox('active', $active);
$cmbStat->addItem(0, _('Enabled'));
$cmbStat->addItem(1, _('Disabled'));
$frmMedia->addRow(_('Status'), $cmbStat);
$frmMedia->addItemToBottomRow(array(new CSubmit('add', $media > -1 ? _('Save') : _('Add')), new CButtonCancel(null, 'close_window();')));
$frmMedia->Show();
require_once dirname(__FILE__) . '/include/page_footer.php';
示例11: CFormTable
}
}
$messageTable = new CFormTable($title . ' "' . getUserFullname(CWebUser::$data) . '"');
$messageTable->addVar('backurl', $_REQUEST['backurl']);
if (in_array($_REQUEST['backurl'], array('tr_events.php', 'events.php'))) {
$messageTable->addVar('eventid', $_REQUEST['eventid']);
$messageTable->addVar('triggerid', $_REQUEST['triggerid']);
} elseif (in_array($_REQUEST['backurl'], array('screenedit.php', 'screens.php'))) {
$messageTable->addVar('screenid', $_REQUEST['screenid']);
}
if (isset($_REQUEST['eventid'])) {
$messageTable->addVar('eventid', $_REQUEST['eventid']);
} elseif (isset($_REQUEST['triggers'])) {
foreach ($_REQUEST['triggers'] as $triggerId) {
$messageTable->addVar('triggers[' . $triggerId . ']', $triggerId);
}
} elseif (isset($_REQUEST['events'])) {
foreach ($_REQUEST['events'] as $eventId) {
$messageTable->addVar('events[' . $eventId . ']', $eventId);
}
}
$message = new CTextArea('message', '', array('rows' => ZBX_TEXTAREA_STANDARD_ROWS, 'width' => ZBX_TEXTAREA_BIG_WIDTH, 'maxlength' => 255));
$message->attr('autofocus', 'autofocus');
$messageTable->addRow(_('Message'), $message);
$messageTable->addItemToBottomRow(new CSubmit('saveandreturn', $saveAndReturnLabel));
if (!$bulk) {
$messageTable->addItemToBottomRow(new CSubmit('save', $saveLabel));
}
$messageTable->addItemToBottomRow(new CButtonCancel(url_params(array('backurl', 'eventid', 'triggerid', 'screenid'))));
$messageTable->show(false);
require_once dirname(__FILE__) . '/include/page_footer.php';
示例12: insert_command_result_form
function insert_command_result_form($scriptid, $hostid)
{
$result = execute_script($scriptid, $hostid);
$script_info = DBfetch(DBselect("SELECT name FROM scripts WHERE scriptid={$scriptid}"));
$frmResult = new CFormTable($script_info["name"] . ': ' . script_make_command($scriptid, $hostid));
$message = $result["message"];
if ($result["flag"] != 0) {
error($message);
$message = "";
}
$frmResult->addRow(S_RESULT, new CTextArea("message", $message, 100, 25, 'yes'));
$frmResult->addItemToBottomRow(new CButton('close', S_CLOSE, 'window.close();'));
$frmResult->Show();
}
示例13: CDiv
$cmbConf->addItem('auditlogs.php', S_LOGS);
$cmbConf->addItem('auditacts.php', S_ACTIONS);
$frmForm->addItem($cmbConf);
$alerts_wdgt->addPageHeader(S_AUDIT_ACTIONS_BIG, $frmForm);
$numrows = new CDiv();
$numrows->setAttribute('name', 'numrows');
$alerts_wdgt->addHeader(S_ACTIONS_BIG);
$alerts_wdgt->addHeader($numrows);
//--------
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable();
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$row = new CRow(array(new CCol(S_RECIPIENT, '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);
$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);
$alerts_wdgt->addFlicker($filterForm, CProfile::get('web.auditacts.filter.state', 1));
$scroll_div = new CDiv();
$scroll_div->setAttribute('id', 'scrollbar_cntr');
$alerts_wdgt->addFlicker($scroll_div, CProfile::get('web.auditacts.filter.state', 1));
//-------
$table = new CTableInfo(S_NO_ACTIONS_FOUND);
$table->setHeader(array(is_show_all_nodes() ? S_NODES : null, S_TIME, S_TYPE, S_STATUS, S_RETRIES_LEFT, S_RECIPIENTS, S_MESSAGE, S_ERROR));
$effectiveperiod = navigation_bar_calc('web.auditacts.timeline', 0, true);
$bstime = $_REQUEST['stime'];
$from = zbxDateToTime($_REQUEST['stime']);
示例14: valueComparisonFormForMultiplePeriods
/**
* Create report bar for for "Compare values for multiple periods"
*
* @return object $reportForm
*/
function valueComparisonFormForMultiplePeriods()
{
$config = get_request('config', 1);
$title = get_request('title', _('Report 3'));
$xlabel = get_request('xlabel', '');
$ylabel = get_request('ylabel', '');
$scaletype = get_request('scaletype', TIMEPERIOD_TYPE_WEEKLY);
$avgperiod = get_request('avgperiod', TIMEPERIOD_TYPE_DAILY);
$report_timesince = get_request('report_timesince', date(TIMESTAMP_FORMAT_ZERO_TIME, time() - SEC_PER_DAY));
$report_timetill = get_request('report_timetill', date(TIMESTAMP_FORMAT_ZERO_TIME));
$itemId = get_request('itemid', 0);
$hostids = get_request('hostids', array());
$hostids = zbx_toHash($hostids);
$showlegend = get_request('showlegend', 0);
$palette = get_request('palette', 0);
$palettetype = get_request('palettetype', 0);
$reportForm = new CFormTable(null, null, 'get');
$reportForm->setAttribute('name', 'zbx_report');
$reportForm->setAttribute('id', 'zbx_report');
if (isset($_REQUEST['report_show']) && $itemId) {
$reportForm->addVar('report_show', 'show');
}
$reportForm->addVar('config', $config);
$reportForm->addVar('report_timesince', date(TIMESTAMP_FORMAT, $report_timesince));
$reportForm->addVar('report_timetill', date(TIMESTAMP_FORMAT, $report_timetill));
$reportForm->addRow(_('Title'), new CTextBox('title', $title, 40));
$reportForm->addRow(_('X label'), new CTextBox('xlabel', $xlabel, 40));
$reportForm->addRow(_('Y label'), new CTextBox('ylabel', $ylabel, 40));
$reportForm->addRow(_('Legend'), new CCheckBox('showlegend', $showlegend, null, 1));
$reportForm->addVar('sortorder', 0);
$groupids = get_request('groupids', array());
$group_tb = new CTweenBox($reportForm, 'groupids', $groupids, 10);
$options = array('real_hosts' => true, 'output' => 'extend');
$db_groups = API::HostGroup()->get($options);
order_result($db_groups, 'name');
foreach ($db_groups as $gnum => $group) {
$groupids[$group['groupid']] = $group['groupid'];
$group_tb->addItem($group['groupid'], $group['name']);
}
$reportForm->addRow(_('Groups'), $group_tb->Get(_('Selected groups'), _('Other groups')));
$groupid = get_request('groupid', 0);
$cmbGroups = new CComboBox('groupid', $groupid, 'submit()');
$cmbGroups->addItem(0, _('All'));
foreach ($db_groups as $gnum => $group) {
$cmbGroups->addItem($group['groupid'], $group['name']);
}
$td_groups = new CCol(array(_('Group'), SPACE, $cmbGroups));
$td_groups->setAttribute('style', 'text-align: right;');
$host_tb = new CTweenBox($reportForm, 'hostids', $hostids, 10);
$options = array('real_hosts' => true, 'output' => array('hostid', 'name'));
if ($groupid > 0) {
$options['groupids'] = $groupid;
}
$db_hosts = API::Host()->get($options);
$db_hosts = zbx_toHash($db_hosts, 'hostid');
order_result($db_hosts, 'name');
foreach ($db_hosts as $hnum => $host) {
$host_tb->addItem($host['hostid'], $host['name']);
}
$options = array('real_hosts' => true, 'output' => array('hostid', 'name'), 'hostids' => $hostids);
$db_hosts2 = API::Host()->get($options);
order_result($db_hosts2, 'name');
foreach ($db_hosts2 as $hnum => $host) {
if (!isset($db_hosts[$host['hostid']])) {
$host_tb->addItem($host['hostid'], $host['name']);
}
}
$reportForm->addRow(_('Hosts'), $host_tb->Get(_('Selected hosts'), array(_('Other hosts | Group') . SPACE, $cmbGroups)));
$reporttimetab = new CTable(null, 'calendar');
$timeSinceRow = createDateSelector('report_timesince', $report_timesince, 'report_timetill');
array_unshift($timeSinceRow, _('From'));
$reporttimetab->addRow($timeSinceRow);
$timeTillRow = createDateSelector('report_timetill', $report_timetill, 'report_timesince');
array_unshift($timeTillRow, _('Till'));
$reporttimetab->addRow($timeTillRow);
$reportForm->addRow(_('Period'), $reporttimetab);
$scale = new CComboBox('scaletype', $scaletype);
$scale->addItem(TIMEPERIOD_TYPE_HOURLY, _('Hourly'));
$scale->addItem(TIMEPERIOD_TYPE_DAILY, _('Daily'));
$scale->addItem(TIMEPERIOD_TYPE_WEEKLY, _('Weekly'));
$scale->addItem(TIMEPERIOD_TYPE_MONTHLY, _('Monthly'));
$scale->addItem(TIMEPERIOD_TYPE_YEARLY, _('Yearly'));
$reportForm->addRow(_('Scale'), $scale);
$avgcmb = new CComboBox('avgperiod', $avgperiod);
$avgcmb->addItem(TIMEPERIOD_TYPE_HOURLY, _('Hourly'));
$avgcmb->addItem(TIMEPERIOD_TYPE_DAILY, _('Daily'));
$avgcmb->addItem(TIMEPERIOD_TYPE_WEEKLY, _('Weekly'));
$avgcmb->addItem(TIMEPERIOD_TYPE_MONTHLY, _('Monthly'));
$avgcmb->addItem(TIMEPERIOD_TYPE_YEARLY, _('Yearly'));
$reportForm->addRow(_('Average by'), $avgcmb);
$itemName = '';
if ($itemId) {
$itemName = get_item_by_itemid($itemId);
$itemName = itemName($itemName);
}
//.........这里部分代码省略.........
示例15: array
$name = get_request('name', '');
$iprange = get_request('iprange', '192.168.0.1-255');
$delay = get_request('delay', 3600);
$status = get_request('status', DRULE_STATUS_ACTIVE);
$dchecks = get_request('dchecks', array());
$dchecks_deleted = get_request('dchecks_deleted', array());
}
$new_check_type = get_request('new_check_type', SVC_HTTP);
$new_check_ports = get_request('new_check_ports', '80');
$new_check_key = get_request('new_check_key', '');
$new_check_snmp_community = get_request('new_check_snmp_community', '');
$new_check_snmpv3_securitylevel = get_request('new_check_snmpv3_securitylevel', ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV);
$new_check_snmpv3_securityname = get_request('new_check_snmpv3_securityname', '');
$new_check_snmpv3_authpassphrase = get_request('new_check_snmpv3_authpassphrase', '');
$new_check_snmpv3_privpassphrase = get_request('new_check_snmpv3_privpassphrase', '');
$form->addRow(S_NAME, new CTextBox('name', $name, 40));
$cmbProxy = new CComboBox('proxy_hostid', $proxy_hostid);
$cmbProxy->addItem(0, S_NO_PROXY);
$sql = 'SELECT hostid, host ' . ' FROM hosts' . ' WHERE status IN (' . HOST_STATUS_PROXY_ACTIVE . ',' . HOST_STATUS_PROXY_PASSIVE . ') ' . ' AND ' . DBin_node('hostid') . ' ORDER BY host';
$db_proxies = DBselect($sql);
while ($db_proxy = DBfetch($db_proxies)) {
$cmbProxy->addItem($db_proxy['hostid'], $db_proxy['host']);
}
$form->addRow(S_DISCOVERY_BY_PROXY, $cmbProxy);
$form->addRow(S_IP_RANGE, new CTextBox('iprange', $iprange, 27));
$form->addRow(S_DELAY . SPACE . S_SECOND_IN_PARENTHESES, new CNumericBox('delay', $delay, 8));
$form->addVar('dchecks', $dchecks);
$form->addVar('dchecks_deleted', $dchecks_deleted);
$cmbUniquenessCriteria = new CComboBox('uniqueness_criteria', $uniqueness_criteria);
$cmbUniquenessCriteria->addItem(-1, S_IP_ADDRESS);
foreach ($dchecks as $id => $data) {