本文整理汇总了PHP中CFormTable::addItemToBottomRow方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormTable::addItemToBottomRow方法的具体用法?PHP CFormTable::addItemToBottomRow怎么用?PHP CFormTable::addItemToBottomRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFormTable
的用法示例。
在下文中一共展示了CFormTable::addItemToBottomRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CTextBox
$caption = $host['name'] . NAME_DELIMITER . $itemName;
}
$txtCondVal = new CTextBox('name', $caption, 50, true);
$btnSelect = new CSubmit('btn1', _('Select'), 'return PopUp("popup.php?' . 'dstfrm=' . $frmGItem->GetName() . '&dstfld1=itemid' . '&dstfld2=name' . '&srctbl=items' . '&srcfld1=itemid' . '&srcfld2=name' . '&monitored_hosts=1' . '&numeric=1");', 'T');
$frmGItem->addRow(_('Parameter'), array($txtCondVal, $btnSelect));
$cmbFnc = new CComboBox('calc_fnc', $calc_fnc);
$cmbFnc->addItem(CALC_FNC_MIN, _('min'));
$cmbFnc->addItem(CALC_FNC_AVG, _('avg'));
$cmbFnc->addItem(CALC_FNC_MAX, _('max'));
$cmbFnc->addItem(0, _('Count'));
$frmGItem->addRow(_('Function'), $cmbFnc);
if ($config == 1) {
$cmbAxis = new CComboBox('axisside', $axisside);
$cmbAxis->addItem(GRAPH_YAXIS_SIDE_LEFT, _('Left'));
$cmbAxis->addItem(GRAPH_YAXIS_SIDE_RIGHT, _('Right'));
$frmGItem->addRow(_('Axis side'), $cmbAxis);
}
if ($config == 1) {
$frmGItem->addRow(_('Colour'), new CColor('color', $color));
} else {
$frmGItem->addVar('color', $color);
}
if (isset($gid)) {
$frmGItem->addItemToBottomRow(new CSubmit('update', _('Update')));
} else {
$frmGItem->addItemToBottomRow(new CSubmit('add', _('Add')));
}
$frmGItem->addItemToBottomRow(new CButtonCancel(null, 'close_window();'));
$frmGItem->Show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
示例2: CNumericBox
$severity_select->addItems($cb_items);
$filterForm->addRow(S_MIN_SEVERITY, $severity_select);
$action = 'javascrip: this.checked ? $("status_change_days").enable() : $("status_change_days").disable()';
$sts_change_days_cb = new CNumericBox('status_change_days', $_REQUEST['status_change_days'], 4);
if (!$_REQUEST['status_change']) {
$sts_change_days_cb->setAttribute('disabled', 'disabled');
}
$sts_change_days_cb->addStyle('vertical-align: middle;');
$cbd = new CCheckBox('status_change', $_REQUEST['status_change'], $action, 1);
$cbd->addStyle('vertical-align: middle;');
$spand = new CSpan(S_DAYS_SMALL);
$spand->addStyle('vertical-align: middle;');
$filterForm->addRow(S_AGE_LESS_THAN, array($cbd, $sts_change_days_cb, $spand));
$filterForm->addRow(S_SHOW_DETAILS, new CCheckBox('show_details', $_REQUEST['show_details'], null, 1));
$filterForm->addRow(S_FILTER_BY_NAME, new CTextBox('txt_select', $_REQUEST['txt_select'], 40));
$filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER));
$filterForm->addItemToBottomRow(new CButton('filter_rst', S_RESET));
$trigg_wdgt->addFlicker($filterForm, CProfile::get('web.tr_status.filter.state', 0));
/*************** FILTER END ******************/
if ($_REQUEST['fullscreen']) {
$triggerInfo = new CTriggersInfo($_REQUEST['groupid'], $_REQUEST['hostid']);
$triggerInfo->HideHeader();
$triggerInfo->show();
}
$m_form = new CForm('acknow.php');
$m_form->setName('tr_status');
$m_form->addVar('backurl', $page['file']);
$admin_links = $USER_DETAILS['type'] == USER_TYPE_ZABBIX_ADMIN || $USER_DETAILS['type'] == USER_TYPE_SUPER_ADMIN;
$show_event_col = $config['event_ack_enable'] && $_REQUEST['show_events'] != EVENTS_OPTION_NOEVENT;
$table = new CTableInfo();
$switcherName = 'trigger_switchers';
示例3: CCheckBox
// SPACE added to extend CB width in Chrome
$cbMain = new CCheckBox('maintenance', $maintenance, null, '1');
if (!$filterEnable) {
$cbMain->setAttribute('disabled', 'disabled');
}
$dashForm->addRow(S_HOSTS, array($cbMain, S_SHOW_HOSTS_IN_MAINTENANCE));
// Trigger
$severity = zbx_toHash($severity);
$trgSeverities = array();
$severities = array(TRIGGER_SEVERITY_NOT_CLASSIFIED, TRIGGER_SEVERITY_INFORMATION, TRIGGER_SEVERITY_WARNING, TRIGGER_SEVERITY_AVERAGE, TRIGGER_SEVERITY_HIGH, TRIGGER_SEVERITY_DISASTER);
foreach ($severities as $snum => $sever) {
$cb = new CCheckBox('trgSeverity[' . $sever . ']', isset($severity[$sever]), '', 1);
$cb->setEnabled($filterEnable);
$trgSeverities[] = array($cb, getSeverityCaption($sever));
$trgSeverities[] = BR();
}
array_pop($trgSeverities);
$dashForm->addRow(S_TRIGGERS_WITH_SEVERITY, $trgSeverities);
$config = select_config();
$cb = new CComboBox('extAck', $extAck);
$cb->addItems(array(EXTACK_OPTION_ALL => S_O_ALL, EXTACK_OPTION_BOTH => S_O_SEPARATED, EXTACK_OPTION_UNACK => S_O_UNACKNOWLEDGED_ONLY));
$cb->setEnabled($filterEnable && $config['event_ack_enable']);
if (!$config['event_ack_enable']) {
$cb->setAttribute('title', S_EVENT_ACKNOWLEDGING_DISABLED);
}
$dashForm->addRow(S_PROBLEM_DISPLAY, $cb);
//-----
$dashForm->addItemToBottomRow(new CButton('save', S_SAVE));
$dashboard_wdgt->addItem($dashForm);
$dashboard_wdgt->show();
include_once 'include/page_footer.php';
示例4: CFormTable
$sendto = get_request('sendto', '');
$mediatypeid = get_request('mediatypeid', 0);
$active = get_request('active', 0);
$period = get_request('period', '1-7,00:00-23:59');
$frmMedia = new CFormTable(S_NEW_MEDIA);
$frmMedia->SetHelp('web.media.php');
$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(S_TYPE, $cmbType);
$frmMedia->addRow(S_SEND_TO, new CTextBox('sendto', $sendto, 20));
$frmMedia->addRow(S_WHEN_ACTIVE, new CTextBox('period', $period, 48));
$frm_row = array();
for ($i = 0; $i <= 5; $i++) {
array_push($frm_row, array(new CCheckBox('severity[' . $i . ']', str_in_array($i, $severity) ? 'yes' : 'no', null, $i), get_severity_description($i)), BR());
}
$frmMedia->addRow(S_USE_IF_SEVERITY, $frm_row);
$cmbStat = new CComboBox('active', $active);
$cmbStat->addItem(0, S_ENABLED);
$cmbStat->addItem(1, S_DISABLED);
$frmMedia->addRow(S_STATUS, $cmbStat);
$frmMedia->addItemToBottomRow(new CButton('add', $media > -1 ? S_SAVE : S_ADD));
$frmMedia->addItemToBottomRow(SPACE);
$frmMedia->addItemToBottomRow(new CButtonCancel(null, 'close_window();'));
$frmMedia->Show();
include_once 'include/page_footer.php';
示例5: CRow
$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
$table = new CTableInfo(S_NO_EVENTS_FOUND);
// CHECK IF EVENTS EXISTS {{{
$options = array('output' => API_OUTPUT_EXTEND, 'sortfield' => 'eventid', 'sortorder' => ZBX_SORT_UP, 'nopermissions' => 1, 'limit' => 1);
if ($source == EVENT_SOURCE_DISCOVERY) {
$options['source'] = EVENT_SOURCE_DISCOVERY;
} else {
if (isset($_REQUEST['triggerid']) && $_REQUEST['triggerid'] > 0) {
$options['object'] = EVENT_OBJECT_TRIGGER;
示例6: CTextBox
$usr_test->addItem($db_user['alias'], $db_user['alias']);
}
}
} else {
$usr_test = new CTextBox('user', $USER_DETAILS['alias'], null, 'yes');
}
$frmAuth->addRow(S_LOGIN, $usr_test);
$frmAuth->addRow(S_USER . SPACE . S_PASSWORD, new CPassBox('user_password'));
$frmAuth->addItemToBottomRow(new CButton('save', S_SAVE));
$frmAuth->addItemToBottomRow(new CButton('test', S_TEST));
$frmAuth->Show();
} else {
if (ZBX_AUTH_HTTP == $_REQUEST['config']) {
$form_refresh_http = get_request('form_refresh_http', 0);
$form_refresh_http++;
$frmAuth = new CFormTable(S_HTTP_AUTH, 'authentication.php');
$frmAuth->SetHelp('web.authentication.php');
$frmAuth->addVar('form_refresh_http', $form_refresh_http);
$cmbConfig = new CCombobox('config', ZBX_AUTH_HTTP, 'submit()');
$cmbConfig->addItem(ZBX_AUTH_INTERNAL, S_INTERNAL_S);
$cmbConfig->addItem(ZBX_AUTH_LDAP, S_LDAP);
$cmbConfig->addItem(ZBX_AUTH_HTTP, S_HTTP);
$frmAuth->addRow(S_DEFAULT_AUTHENTICATION, $cmbConfig);
$action = "javascript: if(confirm('" . S_SWITCHING_HTTP . "')) return true; else return false;";
$frmAuth->addRow(S_HTTP_AUTH . SPACE . S_ENABLED, new CCheckBox('authentication_type', ZBX_AUTH_HTTP == $config['authentication_type'], $action, ZBX_AUTH_HTTP));
$frmAuth->addItemToBottomRow(new CButton('save', S_SAVE));
$frmAuth->Show();
}
}
}
include_once 'include/page_footer.php';
示例7: CTextBox
$filterForm->addRow(_('Filter by name'), new CTextBox('txt_select', $filter['txtSelect'], 40));
// application
$filterForm->addRow(_('Filter by application'), array(new CTextBox('application', $filter['application'], 40), new CButton('application_name', _('Select'), 'return PopUp("popup.php?srctbl=applications&srcfld1=name&real_hosts=1&dstfld1=application&with_applications=1' . '&dstfrm=' . $filterForm->getName() . '");', 'filter-button')));
// inventory filter
$inventoryFilters = $filter['inventory'];
if (!$inventoryFilters) {
$inventoryFilters = array(array('field' => '', 'value' => ''));
}
$inventoryFields = array();
foreach (getHostInventories() as $inventory) {
$inventoryFields[$inventory['db_field']] = $inventory['title'];
}
$inventoryFilterTable = new CTable();
$inventoryFilterTable->setAttribute('id', 'inventory-filter');
$i = 0;
foreach ($inventoryFilters as $field) {
$inventoryFilterTable->addRow(array(new CComboBox('inventory[' . $i . '][field]', $field['field'], null, $inventoryFields), new CTextBox('inventory[' . $i . '][value]', $field['value'], 20), new CButton('inventory[' . $i . '][remove]', _('Remove'), null, 'link_menu element-table-remove')), 'form_row');
$i++;
}
$inventoryFilterTable->addRow(new CCol(new CButton('inventory_add', _('Add'), null, 'link_menu element-table-add'), null, 3));
$filterForm->addRow(_('Filter by host inventory'), $inventoryFilterTable);
// maintenance filter
$filterForm->addRow(_('Show hosts in maintenance'), new CCheckBox('show_maintenance', $filter['showMaintenance'], null, 1));
// show details
if (!$overview) {
$filterForm->addRow(_('Show details'), new CCheckBox('show_details', $filter['showDetails'], null, 1));
}
// buttons
$filterForm->addItemToBottomRow(new CSubmit('filter_set', _('Filter'), 'chkbxRange.clearSelectedOnFilterChange();'));
$filterForm->addItemToBottomRow(new CSubmit('filter_rst', _('Reset'), 'chkbxRange.clearSelectedOnFilterChange();'));
return $filterForm;
示例8: 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();
}
示例9: 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';
示例10: CNumericBox
$frmHostG->addRow(S_CONNECT_TO, $cmbConnectBy);
$frmHostG->addRow(S_PORT, new CNumericBox('port', $port, 5));
} else {
$frmHostG->addVar('dns', $dns);
$frmHostG->addVar('ip', $ip);
$frmHostG->addVar('useip', $useip);
$frmHostG->addVar('port', $port);
}
$cmbHosts = new CTweenBox($frmHostG, 'hosts', $hosts);
$sql = 'SELECT hostid, proxy_hostid, host ' . ' FROM hosts ' . ' WHERE status IN (' . HOST_STATUS_MONITORED . ',' . HOST_STATUS_NOT_MONITORED . ') ' . ' AND ' . DBin_node('hostid') . ' ORDER BY host';
$db_hosts = DBselect($sql);
while ($db_host = DBfetch($db_hosts)) {
$cmbHosts->addItem($db_host['hostid'], $db_host['host'], NULL, $db_host['proxy_hostid'] == 0 || $_REQUEST['hostid'] > 0 && $db_host['proxy_hostid'] == $_REQUEST['hostid']);
}
$frmHostG->addRow(S_HOSTS, $cmbHosts->Get(S_PROXY . SPACE . S_HOSTS, S_OTHER . SPACE . S_HOSTS));
$frmHostG->addItemToBottomRow(new CButton('save', S_SAVE));
if ($_REQUEST['hostid'] > 0) {
$frmHostG->addItemToBottomRow(array(SPACE, new CButton('clone', S_CLONE), SPACE, new CButtonDelete(S_DELETE_SELECTED_PROXY_Q, url_param('form') . url_param('hostid')), SPACE));
}
$frmHostG->addItemToBottomRow(new CButtonCancel());
$proxies_wdgt->addItem($frmHostG);
$proxies_wdgt->show();
} else {
$numrows = new CDiv();
$numrows->setAttribute('name', 'numrows');
$proxies_wdgt->addHeader(S_PROXIES_BIG);
$proxies_wdgt->addHeader($numrows);
$form = new CForm('proxies.php', 'get');
$form->setName('hosts');
$table = new CTableInfo(S_NO_PROXIES_DEFINED);
$table->setHeader(array(new CCheckBox('all_hosts', NULL, "checkAll('" . $form->GetName() . "','all_hosts','hosts');"), make_sorting_header(S_NAME, 'host'), S_MODE, S_LASTSEEN_AGE, S_HOST_COUNT, S_ITEM_COUNT, S_REQUIRED_PERFORMANCE, S_HOSTS));
示例11: valueComparisonFormForMultiplePeriods
//.........这里部分代码省略.........
$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);
}
$itemidVar = new CVar('itemid', $itemId, 'itemid');
$reportForm->addItem($itemidVar);
$txtCondVal = new CTextBox('item_name', $itemName, 50, 'yes');
$txtCondVal->setAttribute('id', 'item_name');
$btnSelect = new CButton('btn1', _('Select'), 'return PopUp("popup.php?dstfrm=' . $reportForm->GetName() . '&dstfld1=itemid' . '&dstfld2=item_name' . '&srctbl=items' . '&srcfld1=itemid' . '&srcfld2=name' . '&monitored_hosts=1");', 'T');
$reportForm->addRow(_('Item'), array($txtCondVal, $btnSelect));
$paletteCmb = new CComboBox('palette', $palette);
$paletteCmb->addItem(0, _s('Palette #%1$s', 1));
$paletteCmb->addItem(1, _s('Palette #%1$s', 2));
$paletteCmb->addItem(2, _s('Palette #%1$s', 3));
$paletteCmb->addItem(3, _s('Palette #%1$s', 4));
$paletteTypeCmb = new CComboBox('palettetype', $palettetype);
$paletteTypeCmb->addItem(0, _('Middle'));
$paletteTypeCmb->addItem(1, _('Darken'));
$paletteTypeCmb->addItem(2, _('Brighten'));
$reportForm->addRow(_('Palette'), array($paletteCmb, $paletteTypeCmb));
$reportForm->addItemToBottomRow(new CSubmit('report_show', _('Show')));
$reset = new CButton('reset', _('Reset'));
$reset->setType('reset');
$reportForm->addItemToBottomRow($reset);
return $reportForm;
}
示例12: CFormTable
} else {
$apphost = '';
$apphostid = 0;
}
$frmApp = new CFormTable($frm_title);
$frmApp->setHelp("web.applications.php");
if (isset($_REQUEST["applicationid"])) {
$frmApp->addVar("applicationid", $_REQUEST["applicationid"]);
}
$frmApp->addRow(S_NAME, new CTextBox("appname", $appname, 32));
$frmApp->addVar("apphostid", $apphostid);
if (!isset($_REQUEST["applicationid"])) {
// any new application can SELECT host
$frmApp->addRow(S_HOST, array(new CTextBox("apphost", $apphost, 32, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?dstfrm=" . $frmApp->getName() . "&dstfld1=apphostid&dstfld2=apphost&srctbl=hosts_and_templates&srcfld1=hostid&srcfld2=host',450,450);", 'T')));
}
$frmApp->addItemToBottomRow(new CButton('save', S_SAVE));
if (isset($_REQUEST['applicationid'])) {
$frmApp->addItemToBottomRow(SPACE);
$frmApp->addItemToBottomRow(new CButtonDelete(S_DELETE_APPLICATION, url_param('config') . url_param('hostid') . url_param('groupid') . url_param('form') . url_param('applicationid')));
}
$frmApp->addItemToBottomRow(SPACE);
$frmApp->addItemToBottomRow(new CButtonCancel(url_param("config") . url_param("hostid") . url_param('groupid')));
$app_wdgt->addItem($frmApp);
} else {
$form = new CForm(null, 'get');
$form->addItem(array(S_GROUP . SPACE, $pageFilter->getGroupsCB()));
$form->addItem(array(SPACE . S_HOST . SPACE, $pageFilter->getHostsCB()));
$numrows = new CDiv();
$numrows->setAttribute('name', 'numrows');
$app_wdgt->addHeader(S_APPLICATIONS_BIG, $form);
$app_wdgt->addHeader($numrows);
示例13: get_screen_item_form
//.........这里部分代码省略.........
$caption = '';
$id = 0;
$available_groups = get_accessible_groups_by_user($USER_DETAILS, PERM_READ_ONLY);
if (remove_nodes_from_id($resourceid) > 0) {
$result = DBselect('SELECT DISTINCT n.name as node_name,g.groupid,g.name ' . ' FROM hosts_groups hg, groups g ' . ' LEFT JOIN nodes n ON n.nodeid=' . DBid2nodeid('g.groupid') . ' WHERE ' . DBcondition('g.groupid', $available_groups) . ' AND g.groupid=' . $resourceid);
while ($row = DBfetch($result)) {
$row['node_name'] = isset($row['node_name']) ? '(' . $row['node_name'] . ') ' : '';
$caption = $row['node_name'] . $row['name'];
$id = $resourceid;
}
} else {
if (remove_nodes_from_id($resourceid) == 0) {
$result = DBselect('SELECT DISTINCT n.name as node_name ' . ' FROM nodes n ' . ' WHERE n.nodeid=' . id2nodeid($resourceid));
while ($row = DBfetch($result)) {
$row['node_name'] = isset($row['node_name']) ? '(' . $row['node_name'] . ') ' : '';
$caption = $row['node_name'] . S_MINUS_ALL_GROUPS_MINUS;
$id = $resourceid;
}
}
}
$form->addVar('resourceid', $id);
$textfield = new CTextbox('caption', $caption, 60, 'yes');
$selectbtn = new Cbutton('select', S_SELECT, "javascript: return PopUp('popup.php?writeonly=1&dstfrm=" . $form->getName() . "&dstfld1=resourceid&dstfld2=caption&srctbl=host_group_scr&srcfld1=groupid&srcfld2=name',480,450);");
$selectbtn->setAttribute('onmouseover', "javascript: this.style.cursor = 'pointer';");
$form->addRow(S_GROUP, array($textfield, SPACE, $selectbtn));
} else {
// SCREEN_RESOURCE_CLOCK
$form->addVar('resourceid', 0);
}
}
}
}
}
}
}
}
}
if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_HOSTS_INFO, SCREEN_RESOURCE_TRIGGERS_INFO))) {
$cmbStyle = new CComboBox("style", $style);
$cmbStyle->addItem(STYLE_HORISONTAL, S_HORIZONTAL);
$cmbStyle->addItem(STYLE_VERTICAL, S_VERTICAL);
$form->addRow(S_STYLE, $cmbStyle);
} else {
if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_TRIGGERS_OVERVIEW, SCREEN_RESOURCE_DATA_OVERVIEW))) {
$cmbStyle = new CComboBox('style', $style);
$cmbStyle->addItem(STYLE_LEFT, S_LEFT);
$cmbStyle->addItem(STYLE_TOP, S_TOP);
$form->addRow(S_HOSTS_LOCATION, $cmbStyle);
} else {
if ($resourcetype == SCREEN_RESOURCE_CLOCK) {
$cmbStyle = new CComboBox('style', $style);
$cmbStyle->addItem(TIME_TYPE_LOCAL, S_LOCAL_TIME);
$cmbStyle->addItem(TIME_TYPE_SERVER, S_SERVER_TIME);
$form->addRow(S_TIME_TYPE, $cmbStyle);
} else {
$form->addVar('style', 0);
}
}
}
if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_URL))) {
$form->addRow(S_URL, new CTextBox('url', $url, 60));
} else {
$form->addVar('url', '');
}
if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_GRAPH, SCREEN_RESOURCE_SIMPLE_GRAPH, SCREEN_RESOURCE_CLOCK, SCREEN_RESOURCE_URL))) {
$form->addRow(S_WIDTH, new CNumericBox('width', $width, 5));
$form->addRow(S_HEIGHT, new CNumericBox('height', $height, 5));
} else {
$form->addVar('width', 500);
$form->addVar('height', 100);
}
if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_GRAPH, SCREEN_RESOURCE_SIMPLE_GRAPH, SCREEN_RESOURCE_MAP, SCREEN_RESOURCE_CLOCK, SCREEN_RESOURCE_URL))) {
$cmbHalign = new CComboBox('halign', $halign);
$cmbHalign->addItem(HALIGN_CENTER, S_CENTRE);
$cmbHalign->addItem(HALIGN_LEFT, S_LEFT);
$cmbHalign->addItem(HALIGN_RIGHT, S_RIGHT);
$form->addRow(S_HORIZONTAL_ALIGN, $cmbHalign);
} else {
$form->addVar('halign', 0);
}
$cmbValign = new CComboBox('valign', $valign);
$cmbValign->addItem(VALIGN_MIDDLE, S_MIDDLE);
$cmbValign->addItem(VALIGN_TOP, S_TOP);
$cmbValign->addItem(VALIGN_BOTTOM, S_BOTTOM);
$form->addRow(S_VERTICAL_ALIGN, $cmbValign);
$form->addRow(S_COLUMN_SPAN, new CNumericBox('colspan', $colspan, 2));
$form->addRow(S_ROW_SPAN, new CNumericBox('rowspan', $rowspan, 2));
// dynamic AddOn
if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_GRAPH, SCREEN_RESOURCE_SIMPLE_GRAPH, SCREEN_RESOURCE_PLAIN_TEXT))) {
$form->addRow(S_DYNAMIC_ITEM, new CCheckBox('dynamic', $dynamic, null, 1));
}
$form->addItemToBottomRow(new CButton('save', S_SAVE));
if (isset($_REQUEST['screenitemid'])) {
$form->addItemToBottomRow(SPACE);
$form->addItemToBottomRow(new CButtonDelete(null, url_param('form') . url_param('screenid') . url_param('screenitemid')));
}
$form->addItemToBottomRow(SPACE);
$form->addItemToBottomRow(new CButtonCancel(url_param('screenid')));
return $form;
}
示例14: CCol
}
}
$col = new CCol($result);
$col->setAttribute('style', $style);
$resultTable->addRow(new CRow(array($e['list'], $col)));
}
$result = '-';
$style = 'text-align: center;';
if ($allowedTesting && $test) {
if (evalExpressionData($expression, $macrosData)) {
$result = 'TRUE';
$style = 'background-color: #ccf; color: #00f;';
} else {
$result = 'FALSE';
$style = 'background-color: #fcc; color: #f00;';
}
}
$col = new CCol($result);
$col->setAttribute('style', $style);
$resultTable->setFooter(array($outline, $col), $resultTable->headerClass);
$testForm->addRow(_('Result'), $resultTable);
// action buttons
$testButton = new CSubmit('test_expression', _('Test'));
if (!$allowedTesting) {
$testButton->setAttribute('disabled', 'disabled');
}
$testForm->addItemToBottomRow($testButton);
$testForm->addItemToBottomRow(SPACE);
$testForm->addItemToBottomRow(new CButton('close', _('Close'), 'javascript: self.close();'));
$testForm->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
示例15: redirect
$url = is_null($request) ? $USER_DETAILS['url'] : $request;
redirect($url);
exit;
}
}
include_once 'include/page_header.php';
if (isset($_REQUEST['message'])) {
show_error_message($_REQUEST['message']);
}
if (!isset($sessionid) || $USER_DETAILS['alias'] == ZBX_GUEST_USER) {
switch ($authentication_type) {
case ZBX_AUTH_HTTP:
break;
case ZBX_AUTH_LDAP:
case ZBX_AUTH_INTERNAL:
default:
// konqueror bug #138024; adding useless param(login=1) to the form's action path to avoid bug!!
$frmLogin = new CFormTable('Login', 'index.php?login=1', 'post', 'multipart/form-data');
$frmLogin->setHelp('web.index.login');
$frmLogin->addVar('request', $request);
$frmLogin->addRow('Login name', new CTextBox('name'));
$frmLogin->addRow('Password', new CPassBox('password'));
$frmLogin->addItemToBottomRow(new CButton('enter', 'Enter'));
$frmLogin->show(false);
setFocus($frmLogin->getName(), 'name');
$frmLogin->destroy();
}
} else {
echo '<div align="center" class="textcolorstyles">Welcome to ZABBIX! You are connected as <b>' . $USER_DETAILS['alias'] . '</b>.</div>';
}
include_once 'include/page_footer.php';