本文整理汇总了PHP中CFormTable::GetName方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormTable::GetName方法的具体用法?PHP CFormTable::GetName怎么用?PHP CFormTable::GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFormTable
的用法示例。
在下文中一共展示了CFormTable::GetName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CVisibilityBox
$color = get_request('color', '009900');
$calc_fnc = get_request('calc_fnc', 2);
$axisside = get_request('axisside', GRAPH_YAXIS_SIDE_LEFT);
$description = '';
if ($itemid > 0) {
$description = get_item_by_itemid($itemid);
$description = item_description($description);
}
$frmGItem->addVar('gid', $gid);
$frmGItem->addVar('config', $config);
$frmGItem->addVar('list_name', $list_name);
$frmGItem->addVar('itemid', $itemid);
$frmGItem->addRow(array(new CVisibilityBox('caption_visible', !zbx_empty($caption), 'caption', S_DEFAULT), S_CAPTION), new CTextBox('caption', $caption, 32));
// $frmGItem->addRow(S_CAPTION, new CTextBox('caption',$caption,10));
$txtCondVal = new CTextBox('description', $description, 50, 'yes');
$btnSelect = new CButton('btn1', S_SELECT, "return PopUp('popup.php?dstfrm=" . $frmGItem->GetName() . '&dstfld1=itemid&dstfld2=description&srctbl=items' . "&srcfld1=itemid&srcfld2=description&monitored_hosts=1');", 'T');
$frmGItem->addRow(S_PARAMETER, array($txtCondVal, $btnSelect));
$cmbFnc = new CComboBox('calc_fnc', $calc_fnc);
$cmbFnc->addItem(CALC_FNC_MIN, S_MIN_SMALL);
$cmbFnc->addItem(CALC_FNC_AVG, S_AVG_SMALL);
$cmbFnc->addItem(CALC_FNC_MAX, S_MAX_SMALL);
$cmbFnc->addItem(0, S_COUNT);
$frmGItem->addRow(S_FUNCTION, $cmbFnc);
if ($config == 1) {
$cmbAxis = new CComboBox('axisside', $axisside);
$cmbAxis->addItem(GRAPH_YAXIS_SIDE_LEFT, S_LEFT);
$cmbAxis->addItem(GRAPH_YAXIS_SIDE_RIGHT, S_RIGHT);
$frmGItem->addRow(S_AXIS_SIDE, $cmbAxis);
}
if ($config == 1) {
$frmGItem->addRow(S_COLOR, new CColor('color', $color));
示例2: CRow
//,'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
$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);
示例3: bar_report_form3
//.........这里部分代码省略.........
$group_tb = new CTweenBox($reportForm, 'groupids', $groupids, 10);
$options = array('real_hosts' => 1, 'output' => 'extend');
$db_groups = CHostGroup::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(S_GROUPS, $group_tb->Get(S_SELECTED_GROUPS, S_OTHER . SPACE . S_GROUPS));
// ----------
// HOSTS
// validate_group(PERM_READ_ONLY,array('real_hosts'),'web.last.conf.groupid');
$groupid = get_request('groupid', 0);
$cmbGroups = new CComboBox('groupid', $groupid, 'submit()');
$cmbGroups->addItem(0, S_ALL_S);
foreach ($db_groups as $gnum => $group) {
$cmbGroups->addItem($group['groupid'], $group['name']);
}
$td_groups = new CCol(array(S_GROUP, SPACE, $cmbGroups));
$td_groups->setAttribute('style', 'text-align: right;');
$host_tb = new CTweenBox($reportForm, 'hostids', $hostids, 10);
$options = array('real_hosts' => 1, 'output' => array('hostid', 'host'));
if ($groupid > 0) {
$options['groupids'] = $groupid;
}
$db_hosts = CHost::get($options);
$db_hosts = zbx_toHash($db_hosts, 'hostid');
order_result($db_hosts, 'host');
foreach ($db_hosts as $hnum => $host) {
$host_tb->addItem($host['hostid'], $host['host']);
}
$options = array('real_hosts' => 1, 'output' => array('hostid', 'host'), 'hostids' => $hostids);
$db_hosts2 = CHost::get($options);
order_result($db_hosts2, 'host');
foreach ($db_hosts2 as $hnum => $host) {
if (!isset($db_hosts[$host['hostid']])) {
$host_tb->addItem($host['hostid'], $host['host']);
}
}
$reportForm->addRow(S_HOSTS, $host_tb->Get(S_SELECTED_HOSTS, array(S_OTHER . SPACE . S_HOSTS . SPACE . '|' . SPACE . S_GROUP . SPACE, $cmbGroups)));
// ----------
//*/
// PERIOD
$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");');
zbx_add_post_js('addListener($("filter_icon"),' . '"click",' . 'CLNDR[\'avail_report_since\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'avail_report_since\'].clndr));' . 'addListener($("filter_icon"),' . '"click",' . 'CLNDR[\'avail_report_till\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'avail_report_till\'].clndr));');
$reportForm->addRow(S_PERIOD, $reporttimetab);
//-----------
$scale = new CComboBox('scaletype', $scaletype);
$scale->addItem(TIMEPERIOD_TYPE_HOURLY, S_HOURLY);
$scale->addItem(TIMEPERIOD_TYPE_DAILY, S_DAILY);
$scale->addItem(TIMEPERIOD_TYPE_WEEKLY, S_WEEKLY);
$scale->addItem(TIMEPERIOD_TYPE_MONTHLY, S_MONTHLY);
$scale->addItem(TIMEPERIOD_TYPE_YEARLY, S_YEARLY);
$reportForm->addRow(S_SCALE, $scale);
$avgcmb = new CComboBox('avgperiod', $avgperiod);
$avgcmb->addItem(TIMEPERIOD_TYPE_HOURLY, S_HOURLY);
$avgcmb->addItem(TIMEPERIOD_TYPE_DAILY, S_DAILY);
$avgcmb->addItem(TIMEPERIOD_TYPE_WEEKLY, S_WEEKLY);
$avgcmb->addItem(TIMEPERIOD_TYPE_MONTHLY, S_MONTHLY);
$avgcmb->addItem(TIMEPERIOD_TYPE_YEARLY, S_YEARLY);
$reportForm->addRow(S_AVERAGE_BY, $avgcmb);
// ITEMS
$itemid = 0;
$description = '';
if (count($items) && $items[0]['itemid'] > 0) {
$itemid = $items[0]['itemid'];
$description = get_item_by_itemid($itemid);
$description = item_description($description);
}
$reportForm->addVar('items[0][itemid]', $itemid);
$txtCondVal = new CTextBox('items[0][description]', $description, 50, 'yes');
$btnSelect = new CButton('btn1', S_SELECT, "return PopUp('popup.php?dstfrm=" . $reportForm->GetName() . "&dstfld1=items[0][itemid]&dstfld2=items[0][description]&" . "srctbl=items&srcfld1=itemid&srcfld2=description&monitored_hosts=1');", 'T');
$reportForm->addRow(S_ITEM, array($txtCondVal, $btnSelect));
$paletteCmb = new CComboBox('palette', $palette);
$paletteCmb->addItem(0, S_PALETTE . ' #1');
$paletteCmb->addItem(1, S_PALETTE . ' #2');
$paletteCmb->addItem(2, S_PALETTE . ' #3');
$paletteCmb->addItem(3, S_PALETTE . ' #4');
$paletteTypeCmb = new CComboBox('palettetype', $palettetype);
$paletteTypeCmb->addItem(0, S_MIDDLE);
$paletteTypeCmb->addItem(1, S_DARKEN);
$paletteTypeCmb->addItem(2, S_BRIGHTEN);
$reportForm->addRow(S_PALETTE, array($paletteCmb, $paletteTypeCmb));
//--------------
$reportForm->addItemToBottomRow(new CButton('report_show', S_SHOW));
$reset = new CButton('reset', S_RESET);
$reset->setType('reset');
$reportForm->addItemToBottomRow($reset);
return $reportForm;
}
示例4: CFormTable
);
close_window();
}
}
-->
</script>
<?php
}
echo SBR;
$form = new CFormTable(S_CONDITION);
$form->SetHelp('config_triggers.php');
$form->SetName('expression');
$form->AddVar('dstfrm', $dstfrm);
$form->AddVar('dstfld1', $dstfld1);
$form->AddVar('itemid', $itemid);
$form->AddRow(S_ITEM, array(new CTextBox('description', $description, 50, 'yes'), new CButton('select', S_SELECT, "return PopUp('popup.php?dstfrm=" . $form->GetName() . "&dstfld1=itemid&dstfld2=description&" . "srctbl=items&srcfld1=itemid&srcfld2=description',0,0,'zbx_popup_item');")));
$cmbFnc = new CComboBox('expr_type', $expr_type, 'submit()');
foreach ($functions as $id => $f) {
foreach ($f['operators'] as $op => $txt_op) {
$cmbFnc->AddItem($id . '[' . $op . ']', str_replace('{OP}', $txt_op, $f['description']));
}
}
$form->AddRow(S_FUNCTION, $cmbFnc);
if (isset($functions[$function]['params'])) {
foreach ($functions[$function]['params'] as $pid => $pf) {
$pv = isset($param[$pid]) ? $param[$pid] : null;
if ($pf['T'] == T_ZBX_INT) {
if (0 == $pid) {
if (isset($pf['M']) && is_array($pf['M'])) {
$cmbParamType = new CComboBox('paramtype', $paramtype);
foreach ($pf['M'] as $mid => $caption) {
示例5: CFormTable
/************************* FILTER **************************/
/***********************************************************/
$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);
示例6: redirect
$cmbConf->setAttribute('onchange', 'javascript: redirect(this.options[this.selectedIndex].value);');
$cmbConf->addItem('auditlogs.php', S_LOGS);
$cmbConf->addItem('auditacts.php', S_ACTIONS);
$frmForm->addItem($cmbConf);
$audit_wdgt->addPageHeader(S_AUDIT_LOGS_BIG, $frmForm);
$numrows = new CDiv();
$numrows->setAttribute('name', 'numrows');
$audit_wdgt->addHeader(S_LOGS_BIG);
$audit_wdgt->addHeader($numrows);
//--------
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable();
$filterForm->setAttribute('name', 'zbx_filter');
$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);
示例7: 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;
}
示例8: bar_report_form3
//.........这里部分代码省略.........
$group_tb = new CTweenBox($reportForm, 'groupids', $groupids, 10);
$options = array('real_hosts' => 1, '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')));
// ----------
// HOSTS
// validate_group(PERM_READ_ONLY,array('real_hosts'),'web.last.conf.groupid');
$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' => 1, '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' => 1, '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)));
// ----------
//*/
// PERIOD
$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(_('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(_('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");');
zbx_add_post_js('addListener($("filter_icon"),' . '"click",' . 'CLNDR[\'avail_report_since\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'avail_report_since\'].clndr));' . 'addListener($("filter_icon"),' . '"click",' . 'CLNDR[\'avail_report_till\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'avail_report_till\'].clndr));');
$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);
// items
$itemid = 0;
$description = '';
if (count($items) && $items[0]['itemid'] > 0) {
$itemid = $items[0]['itemid'];
$description = get_item_by_itemid($itemid);
$description = itemName($description);
}
$itemidVar = new CVar('items[0][itemid]', $itemid, 'items_0_itemid');
$reportForm->addItem($itemidVar);
$txtCondVal = new CTextBox('items[0][description]', $description, 50, 'yes');
$txtCondVal->setAttribute('id', 'items_0_description');
$btnSelect = new CButton('btn1', _('Select'), "return PopUp('popup.php?dstfrm=" . $reportForm->GetName() . "&dstfld1=items_0_itemid&dstfld2=items_0_description&" . "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;
}
示例9: getRequest
$itemid = getRequest('itemid', 0);
$color = getRequest('color', '009900');
$calc_fnc = getRequest('calc_fnc', 2);
$axisside = getRequest('axisside', GRAPH_YAXIS_SIDE_LEFT);
$frmGItem->addVar('gid', $gid);
$frmGItem->addVar('config', $config);
$frmGItem->addVar('list_name', $list_name);
$frmGItem->addVar('itemid', $itemid);
$frmGItem->addRow(array(new CVisibilityBox('caption_visible', hasRequest('caption') && $caption != $autoCaption, 'caption', _('Default')), _('Caption')), new CTextBox('caption', $caption, 50));
$host = getRequest('host');
$itemName = getRequest('name_expanded');
if ($host && $itemName) {
$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));
示例10: CScript
$script = new CScript("javascript: if(CLNDR['nav_time'].clndr.setSDateFromOuterObj()){" . "\$('nav_time').value = parseInt(CLNDR['nav_time'].clndr.sdt.getTime()/1000); }");
$filterForm->addAction('onsubmit', $script);
$clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer');
$clndr_icon->addAction('onclick', "javascript: var pos = getPosition(this); pos.top+=14; pos.left-=174; CLNDR['nav_time'].clndr.clndrshow(pos.top,pos.left);");
$clndr_icon->setAttribute('style', 'vertical-align: middle;');
$nav_clndr = array(new CNumericBox('nav_day', $_REQUEST['nav_time'] > 0 ? date('d', $_REQUEST['nav_time']) : '', 2), new CNumericBox('nav_month', $_REQUEST['nav_time'] > 0 ? date('m', $_REQUEST['nav_time']) : '', 2), new CNumericBox('nav_year', $_REQUEST['nav_time'] > 0 ? date('Y', $_REQUEST['nav_time']) : '', 4), SPACE, new CNumericBox('nav_hour', $_REQUEST['nav_time'] > 0 ? date('H', $_REQUEST['nav_time']) : '', 2), ':', new CNumericBox('nav_minute', $_REQUEST['nav_time'] > 0 ? date('i', $_REQUEST['nav_time']) : '', 2), $clndr_icon);
zbx_add_post_js('create_calendar(null,["nav_day","nav_month","nav_year","nav_hour","nav_minute"],"nav_time");');
$filterForm->addRow(S_EVENTS_BEFORE, $nav_clndr);
if (EVENT_SOURCE_TRIGGERS == $source) {
$filterForm->addVar('triggerid', $_REQUEST['triggerid']);
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('show_unknown', $show_unknown);
$unkcbx = new CCheckBox('show_unk', $show_unknown, null, '1');
$unkcbx->setAction('javascript: create_var("' . $filterForm->GetName() . '", "show_unknown", (this.checked?1:0), 0); ');
$filterForm->addRow(S_SHOW_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);
//-------
$nav = get_thin_table_header($navigation);
$events_wdgt->addFlicker($filterForm, get_profile('web.events.filter.state', 0));
$events_wdgt->addItem(array($nav, $table, $nav));
示例11: array
$filterForm->addVar('period', get_request('period'));
if (isset($_REQUEST['triggerid']) && $_REQUEST['triggerid'] > 0) {
$dbTrigger = API::Trigger()->get(array('triggerids' => $_REQUEST['triggerid'], 'output' => array('description', 'expression'), 'selectHosts' => array('name'), 'preservekeys' => true, 'expandDescription' => true));
// check if trigger is accessible
if ($dbTrigger) {
$dbTrigger = reset($dbTrigger);
$host = reset($dbTrigger['hosts']);
$trigger = $host['name'] . ':' . $dbTrigger['description'];
} else {
$_REQUEST['triggerid'] = 0;
}
}
if (!isset($trigger)) {
$trigger = '';
}
$row = new CRow(array(new CCol(_('Trigger'), 'form_row_l'), new CCol(array(new CTextBox('trigger', $trigger, 96, 'yes'), new CButton("btn1", _('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('showUnknown', $_REQUEST['showUnknown']);
$unkcbx = new CCheckBox('hide_unk', $_REQUEST['showUnknown'], 'javascript: create_var("' . $filterForm->GetName() . '", "showUnknown", (this.checked?1:0), 0); ', '1');
$filterForm->addRow(_('Show unknown events'), $unkcbx);
$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);
}
$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(_('No events defined.'));
// CHECK IF EVENTS EXISTS {{{
示例12: CButton
$frmService->AddVar('parentid', $parentid);
$cb = new CButton('select_parent', S_CHANGE);
$cb->SetType('button');
$cb->SetAction("javascript: openWinCentered('services_form.php?pservices=1" . url_param('serviceid') . "','ZBX_Services_List',740,420,'scrollbars=1, toolbar=0, menubar=0, resizable=1, dialog=0');");
$frmService->AddRow('Parent Service', array($ctb, $cb));
//----------
//child links
$table = new CTable();
$table->setClass('tableinfo');
$table->setOddRowClass('even_row');
$table->setEvenRowClass('even_row');
$table->attributes['cellpadding'] = 3;
$table->attributes['cellspacing'] = 1;
$table->headerClass = 'header';
$table->footerClass = 'footer';
$table->setHeader(array(new CCheckBox('all_child_services', null, "check_childs('" . $frmService->GetName() . "','childs','all_child_services');"), S_SERVICES, S_SOFT, S_TRIGGER));
$table->setAttribute('id', 'service_childs');
foreach ($childs as $id => $child) {
$prefix = null;
$trigger = '-';
$description = new CLink($child['name'], 'services_form.php?sform=1&serviceid=' . $child['serviceid'], 'action');
if (isset($child['triggerid']) && !empty($child['triggerid'])) {
$trigger = expand_trigger_description($child['triggerid']);
}
$table->AddRow(array(array(new CCheckBox('childs_to_del[' . $child['serviceid'] . '][serviceid]', null, null, $child['serviceid']), new CVar('childs[' . $child['serviceid'] . '][serviceid]', $child['serviceid'])), array($description, new CVar('childs[' . $child['serviceid'] . '][name]', $child['name'])), new CCheckBox('childs[' . $child['serviceid'] . '][soft]', isset($child['soft']) && !empty($child['soft']) ? 'checked' : 'no', null, isset($child['soft']) && !empty($child['soft']) ? 1 : 0), array($trigger, new CVar('childs[' . $child['serviceid'] . '][triggerid]', isset($child['triggerid']) ? $child['triggerid'] : ''))));
}
$cb = new CButton('add_child_service', S_ADD);
$cb->SetType('button');
$cb->SetAction("javascript: openWinCentered('services_form.php?cservices=1" . url_param('serviceid') . "','ZBX_Services_List',640,520,'scrollbars=1, toolbar=0, menubar=0, resizable=0');");
$cb2 = new CButton('del_child_service', S_REMOVE);
$cb2->SetType('button');
示例13: CVisibilityBox
$frmGItem->addVar('dstfrm', $_REQUEST['dstfrm']);
$config = get_request('config', 1);
$gid = get_request('gid', null);
$list_name = get_request('list_name', null);
$caption = get_request('caption', '');
$itemid = get_request('itemid', 0);
$color = get_request('color', '009900');
$calc_fnc = get_request('calc_fnc', 2);
$axisside = get_request('axisside', GRAPH_YAXIS_SIDE_LEFT);
$frmGItem->addVar('gid', $gid);
$frmGItem->addVar('config', $config);
$frmGItem->addVar('list_name', $list_name);
$frmGItem->addVar('itemid', $itemid);
$frmGItem->addRow(array(new CVisibilityBox('caption_visible', !zbx_empty($caption), 'caption', _('Default')), _('Caption')), new CTextBox('caption', $caption, 32));
$txtCondVal = new CTextBox('name', $caption, 50, 'yes');
$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');", '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));
示例14: DBfetch
$frmCnct->AddVar("linkid", $_REQUEST["linkid"]);
$db_link = DBfetch(DBselect('SELECT * FROM sysmaps_link_triggers WHERE linkid=' . $_REQUEST["linkid"] . ' AND triggerid=' . $_REQUEST['triggerid']));
$triggerid = $_REQUEST['triggerid'];
$drawtype = $db_link["drawtype"];
$color = $db_link["color"];
} else {
$triggerid = get_request("triggerid", 0);
$drawtype = get_request("drawtype", 0);
$color = get_request("color", 0);
}
$frmCnct->AddVar("triggerid", $triggerid);
/* START comboboxes preparations */
$cmbType = new CComboBox("drawtype", $drawtype);
foreach (map_link_drawtypes() as $i) {
$value = map_link_drawtype2str($i);
$cmbType->AddItem($i, $value);
}
$btnSelect = new CButton('btn1', S_SELECT, "return PopUp('popup.php?dstfrm=" . $frmCnct->GetName() . "&dstfld1=triggerid&dstfld2=trigger&srctbl=triggers&srcfld1=triggerid&srcfld2=description');", 'T');
$btnSelect->SetType('button');
/* END preparation */
$description = $triggerid > 0 ? expand_trigger_description($triggerid) : '';
$frmCnct->AddRow(S_TRIGGER, array(new CTextBox('trigger', $description, 70, 'yes'), SPACE, $btnSelect));
$frmCnct->AddRow(S_TYPE . ' (' . S_PROBLEM_BIG . ')', $cmbType);
$frmCnct->AddRow(S_COLOR . ' (' . S_PROBLEM_BIG . ')', new CColor('color', $color));
$frmCnct->AddItemToBottomRow(new CButton("save", isset($_REQUEST['triggerid']) ? S_SAVE : S_ADD));
$frmCnct->AddItemToBottomRow(SPACE);
$frmCnct->AddItemToBottomRow(new CButton("cancel", S_CANCEL, 'javascript: window.close();'));
$frmCnct->Show();
}
}
include_once "include/page_footer.php";
示例15: insert_map_link_form
function insert_map_link_form()
{
$frmCnct = new CFormTable('New connector', 'sysmap.php');
$frmCnct->SetHelp('web.sysmap.connector.php');
$frmCnct->addVar('sysmapid', $_REQUEST['sysmapid']);
if (isset($_REQUEST['linkid']) && !isset($_REQUEST['form_refresh'])) {
$frmCnct->addVar('linkid', $_REQUEST['linkid']);
$db_links = DBselect('SELECT * FROM sysmaps_links WHERE linkid=' . $_REQUEST['linkid']);
$db_link = DBfetch($db_links);
$selementid1 = $db_link['selementid1'];
$selementid2 = $db_link['selementid2'];
$triggers = array();
$drawtype = $db_link['drawtype'];
$color = $db_link['color'];
$res = DBselect('SELECT * FROM sysmaps_link_triggers WHERE linkid=' . $_REQUEST['linkid']);
while ($rows = DBfetch($res)) {
$triggers[] = $rows;
}
} else {
if (isset($_REQUEST['linkid'])) {
$frmCnct->addVar('linkid', $_REQUEST['linkid']);
}
$selementid1 = get_request('selementid1', 0);
$selementid2 = get_request('selementid2', 0);
$triggers = get_request('triggers', array());
$drawtype = get_request('drawtype', 0);
$color = get_request('color', 0);
}
/* START comboboxes preparations */
$cmbElements1 = new CComboBox('selementid1', $selementid1);
$cmbElements2 = new CComboBox('selementid2', $selementid2);
$db_selements = DBselect('SELECT selementid,label,elementid,elementtype ' . ' FROM sysmaps_elements ' . ' WHERE sysmapid=' . $_REQUEST['sysmapid']);
while ($db_selement = DBfetch($db_selements)) {
$label = $db_selement['label'];
if ($db_selement['elementtype'] == SYSMAP_ELEMENT_TYPE_HOST) {
$db_host = get_host_by_hostid($db_selement['elementid']);
$label .= ':' . $db_host['host'];
} else {
if ($db_selement['elementtype'] == SYSMAP_ELEMENT_TYPE_MAP) {
$db_map = get_sysmap_by_sysmapid($db_selement['elementid']);
$label .= ':' . $db_map['name'];
} else {
if ($db_selement['elementtype'] == SYSMAP_ELEMENT_TYPE_TRIGGER) {
if ($db_selement['elementid'] > 0) {
$label .= ':' . expand_trigger_description($db_selement['elementid']);
}
} else {
if ($db_selement['elementtype'] == SYSMAP_ELEMENT_TYPE_HOST_GROUP) {
if ($db_selement['elementid'] > 0) {
$db_group = DBfetch(DBselect('SELECT name FROM groups WHERE groupid=' . $db_selement['elementid']));
$label .= ':' . $db_group['name'];
}
}
}
}
}
$cmbElements1->addItem($db_selement['selementid'], $label);
$cmbElements2->addItem($db_selement['selementid'], $label);
}
$cmbType = new CComboBox('drawtype', $drawtype);
foreach (map_link_drawtypes() as $i) {
$value = map_link_drawtype2str($i);
$cmbType->addItem($i, $value);
}
/* END preparation */
$frmCnct->addRow(S_ELEMENT_1, $cmbElements1);
$frmCnct->addRow(S_ELEMENT_2, $cmbElements2);
//trigger links
foreach ($triggers as $id => $trigger) {
if (isset($trigger['triggerid'])) {
$triggers[$id]['description'] = expand_trigger_description($trigger['triggerid']);
}
}
$table = new CTable();
$table->SetClass('tableinfo');
$table->setOddRowClass('even_row');
$table->setEvenRowClass('even_row');
$table->options['cellpadding'] = 3;
$table->options['cellspacing'] = 1;
$table->headerClass = 'header';
$table->footerClass = 'footer';
$table->SetHeader(array(new CCheckBox('all_triggers', null, "CheckAll('" . $frmCnct->GetName() . "','all_triggers','triggers');"), S_TRIGGERS, S_TYPE, S_COLOR));
$table->addOption('id', 'link_triggers');
foreach ($triggers as $id => $trigger) {
if (!isset($trigger['triggerid'])) {
continue;
}
$colorbox = new CSpan(SPACE . SPACE . SPACE);
$colorbox->addOption('style', 'text-decoration: none; outline-color: black; outline-style: solid; outline-width: 1px; background-color: #' . $trigger['color'] . ';');
$table->addRow(array(array(new CCheckBox('triggers[' . $trigger['triggerid'] . '][triggerid]', null, null, $trigger['triggerid']), new CVar('triggers[' . $trigger['triggerid'] . '][triggerid]', $trigger['triggerid'])), array(new CLink($trigger['description'], "javascript: openWinCentered('popup_link_tr.php?form=1&dstfrm=" . $frmCnct->GetName() . "&triggerid=" . $trigger['triggerid'] . url_param('linkid') . "','ZBX_Link_Indicator',560,260,'scrollbars=1, toolbar=0, menubar=0, resizable=0');"), new CVar('triggers[' . $trigger['triggerid'] . '][description]', $trigger['description'])), array(map_link_drawtype2str($trigger['drawtype']), new CVar('triggers[' . $trigger['triggerid'] . '][drawtype]', $trigger['drawtype'])), array($colorbox, new CVar('triggers[' . $trigger['triggerid'] . '][color]', $trigger['color']))));
}
$btnadd = new CButton('btn1', S_ADD, "javascript: openWinCentered('popup_link_tr.php?form=1&dstfrm=" . $frmCnct->GetName() . url_param('linkid') . "','ZBX_Link_Indicator',560,180,'scrollbars=1, toolbar=0, menubar=0, resizable=0');", 'T');
$btnRemove = new CButton('btn1', S_REMOVE, "javascript: remove_childs('" . $frmCnct->GetName() . "','triggers','tr');", 'T');
$btnadd->SetType('button');
$frmCnct->addRow(S_LINK_STATUS_INDICATORS, array($table, BR(), $btnadd, $btnRemove));
//----------
$frmCnct->addRow(S_TYPE . ' (' . S_OK_BIG . ')', $cmbType);
$frmCnct->addRow(S_COLOR . ' (' . S_OK_BIG . ')', new CColor('color', $color));
$frmCnct->addItemToBottomRow(new CButton("save_link", S_SAVE));
if (isset($_REQUEST["linkid"])) {
//.........这里部分代码省略.........