本文整理汇总了PHP中CFormTable::addVar方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormTable::addVar方法的具体用法?PHP CFormTable::addVar怎么用?PHP CFormTable::addVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFormTable
的用法示例。
在下文中一共展示了CFormTable::addVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$fields['test_expression'] = array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null);
if (!check_fields($fields)) {
$test = false;
}
// actions
if (isset($_REQUEST['test_expression'])) {
show_messages();
$test = true;
} else {
$test = false;
}
// form
$testForm = new CFormTable(_('Test'), 'tr_testexpr.php');
$testForm->addHelpIcon();
$testForm->setTableClass('formlongtable formtable');
$testForm->addVar('expression', $expression);
$testForm->addRow(_('Test data'), $dataTable);
$resultTable = new CTable(null, 'tableinfo');
$resultTable->setAttribute('id', 'result_list');
$resultTable->setOddRowClass('even_row');
$resultTable->setEvenRowClass('even_row');
$resultTable->setHeader(array(_('Expression'), _('Result')));
ksort($rplcts, SORT_NUMERIC);
foreach ($eHTMLTree as $e) {
$result = '-';
$style = 'text-align: center;';
if ($allowedTesting && $test && isset($e['expression'])) {
if (evalExpressionData($e['expression']['value'], $macrosData)) {
$result = 'TRUE';
$style = 'background-color: #ccf; color: #00f;';
} else {
示例2: array
$r_form->addItem(array(S_GROUP . SPACE, $pageFilter->getGroupsCB(true)));
$r_form->addItem(array(SPACE . S_HOST . SPACE, $pageFilter->getHostsCB(true)));
$r_form->addVar('fullscreen', $_REQUEST['fullscreen']);
$fs_icon = get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen']));
$trigg_wdgt->addPageHeader(S_STATUS_OF_TRIGGERS_BIG . ' [' . date(S_DATE_FORMAT_YMDHMS) . ']', array($fs_icon));
$numrows = new CDiv();
$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);
示例3: unset
if (!isset($_REQUEST['groupids'][$groupid])) {
continue;
}
unset($_REQUEST['groupids'][$groupid]);
}
}
}
}
$dashboard_wdgt = new CWidget();
// Header
$dashboard_wdgt->setClass('header');
$dashboard_wdgt->addPageHeader(S_DASHBOARD_CONFIGURATION_BIG, SPACE);
//-------------
// GROUPS
$dashForm = new CFormTable(S_FILTER);
$dashForm->addVar('form_refresh', 1);
$dashForm->setName('dashconf');
$dashForm->setAttribute('id', 'dashform');
if (isset($_REQUEST['form_refresh'])) {
$filterEnable = get_request('filterEnable', 0);
$groupids = get_request('groupids', array());
$groupids = zbx_toHash($groupids);
$grpswitch = get_request('grpswitch', 0);
$maintenance = get_request('maintenance', 0);
$extAck = get_request('extAck', 0);
$severity = get_request('trgSeverity', array());
$severity = array_keys($severity);
} else {
$filterEnable = CProfile::get('web.dashconf.filter.enable', 0);
$groupids = get_favorites('web.dashconf.groups.groupids');
$groupids = zbx_objectValues($groupids, 'value');
示例4: array
for ($i = 0; $i < 6; $i++) {
if ($rq_severity & 1 << $i) {
$severity[$i] = $i;
}
}
} else {
$severity = get_request('severity', array(0, 1, 2, 3, 4, 5));
}
$media = get_request('media', -1);
$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);
示例5: CDiv
$cmbSource->addItem(EVENT_SOURCE_DISCOVERY, S_DISCOVERY);
$r_form->addItem(array(SPACE . S_SOURCE . SPACE, $cmbSource));
}
$events_wdgt->addHeader(S_EVENTS_BIG, $r_form);
$numrows = new CDiv();
$numrows->setAttribute('name', 'numrows');
$events_wdgt->addHeader($numrows);
// }}} HEADER
// FILTER {{{
$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');
示例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: dirname
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__) . '/js/common.filter.trigger.js.php';
$overview = $this->data['overview'];
$filter = $this->data['filter'];
$config = select_config();
$filterForm = new CFormTable(null, null, 'get');
$filterForm->setTableClass('formtable old-filter');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addVar('fullscreen', $filter['fullScreen']);
$filterForm->addVar('groupid', $filter['groupId']);
$filterForm->addVar('hostid', $filter['hostId']);
// trigger status
$filterForm->addRow(_('Triggers status'), new CComboBox('show_triggers', $filter['showTriggers'], null, array(TRIGGERS_OPTION_ALL => _('Any'), TRIGGERS_OPTION_RECENT_PROBLEM => _('Recent problem'), TRIGGERS_OPTION_IN_PROBLEM => _('Problem'))));
// ack status
if ($config['event_ack_enable']) {
$filterForm->addRow(_('Acknowledge status'), new CComboBox('ack_status', $filter['ackStatus'], null, array(ZBX_ACK_STS_ANY => _('Any'), ZBX_ACK_STS_WITH_UNACK => _('With unacknowledged events'), ZBX_ACK_STS_WITH_LAST_UNACK => _('With last event unacknowledged'))));
}
// events
if (!$overview) {
$eventsComboBox = new CComboBox('show_events', $filter['showEvents'], null, array(EVENTS_OPTION_NOEVENT => _('Hide all'), EVENTS_OPTION_ALL => _n('Show all (%1$s day)', 'Show all (%1$s days)', $config['event_expire'])));
if ($config['event_ack_enable']) {
$eventsComboBox->addItem(EVENTS_OPTION_NOT_ACK, _n('Show unacknowledged (%1$s day)', 'Show unacknowledged (%1$s days)', $config['event_expire']));
}
$filterForm->addRow(_('Events'), $eventsComboBox);
示例8: 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);
}
//.........这里部分代码省略.........
示例9: 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"])) {
//.........这里部分代码省略.........
示例10: CButton
$cmbConf->addItem('nodes.php', S_NODES);
$cmbConf->addItem('proxies.php', S_PROXIES);
$frmForm->addItem($cmbConf);
if (!isset($_REQUEST['form'])) {
$frmForm->addItem(new CButton('form', S_CREATE_PROXY));
}
$proxies_wdgt->addPageHeader(S_CONFIGURATION_OF_PROXIES, $frmForm);
if (isset($_REQUEST['form'])) {
$_REQUEST['hostid'] = get_request('hostid', 0);
$frm_title = S_PROXY;
$frmHostG = new CFormTable($frm_title, 'proxies.php');
$frmHostG->setHelp('web.proxy.php');
if ($_REQUEST['hostid'] > 0) {
$proxy = get_host_by_hostid($_REQUEST['hostid']);
$frm_title = S_PROXY . ' [' . $proxy['host'] . ']';
$frmHostG->addVar('hostid', $_REQUEST['hostid']);
}
if ($_REQUEST['hostid'] > 0 && !isset($_REQUEST['form_refresh'])) {
$name = $proxy['host'];
$status = $proxy['status'];
if ($status == HOST_STATUS_PROXY_PASSIVE) {
$useip = $proxy['useip'];
$dns = $proxy['dns'];
$ip = $proxy['ip'];
$port = $proxy['port'];
} else {
$useip = get_request('useip', 1);
$dns = get_request('dns', '');
$ip = get_request('ip', '0.0.0.0');
$port = get_request('port', 10051);
}
示例11: CButton
$next_page = new CButton('next_page', S_NEXT . ' »');
if ($col < $limit) {
$next_page->setAttribute('disabled', 'disabled');
}
//*/
$navForm->addItem(array($prev_page, SPACE, $next_page));
$navigation = $navForm;
//------------
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable();
//,'events.php?filter_set=1','POST',null,'sform');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
// $filterForm->setMethod('get');
$filterForm->addVar('nav_time', $_REQUEST['nav_time']);
$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 = "";
}
示例12: CFormTable
$apphostid = $row['hostid'];
} else {
$appname = get_request("appname", "");
$apphostid = get_request("apphostid", get_request("hostid", 0));
}
$db_host = get_host_by_hostid($apphostid, 1);
if ($db_host) {
$apphost = $db_host["host"];
} 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);
示例13: Clink
$prev = 'Prev 100';
$next = 'Next 100';
if ($_REQUEST['start'] > 0) {
$prev = new Clink('Prev ' . PAGE_SIZE, 'audit.php?prev=1' . url_param('start') . url_param('config'), 'styled');
}
if ($table->GetNumRows() >= PAGE_SIZE) {
$next = new Clink('Next ' . PAGE_SIZE, 'audit.php?next=1' . url_param('start') . url_param('config'), 'styled');
}
$filterForm = new CFormTable(S_FILTER);
//,'events.php?filter_set=1','POST',null,'sform');
$filterForm->addOption('name', 'zbx_filter');
$filterForm->addOption('id', 'zbx_filter');
$filterForm->setMethod('get');
$script = new CScript("javascript: if(CLNDR['audit_since'].clndr.setSDateFromOuterObj()){" . "\$('filter_timesince').value = parseInt(CLNDR['audit_since'].clndr.sdt.getTime()/1000);}" . "if(CLNDR['audit_till'].clndr.setSDateFromOuterObj()){" . "\$('filter_timetill').value = parseInt(CLNDR['audit_till'].clndr.sdt.getTime()/1000);}");
$filterForm->addAction('onsubmit', $script);
$filterForm->addVar('filter_timesince', $_REQUEST['filter_timesince'] > 0 ? $_REQUEST['filter_timesince'] : '');
$filterForm->addVar('filter_timetill', $_REQUEST['filter_timetill'] > 0 ? $_REQUEST['filter_timetill'] : '');
$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);
示例14: get_screen_item_form
function get_screen_item_form()
{
global $USER_DETAILS;
$form = new CFormTable(S_SCREEN_CELL_CONFIGURATION, 'screenedit.php?screenid=' . $_REQUEST['screenid']);
$form->SetHelp('web.screenedit.cell.php');
if (isset($_REQUEST['screenitemid'])) {
$sql = 'SELECT * ' . ' FROM screens_items' . ' WHERE screenid=' . $_REQUEST['screenid'] . ' AND screenitemid=' . $_REQUEST['screenitemid'];
$iresult = DBSelect($sql);
$form->addVar('screenitemid', $_REQUEST['screenitemid']);
} else {
$form->addVar('x', $_REQUEST['x']);
$form->addVar('y', $_REQUEST['y']);
}
if (isset($_REQUEST['screenitemid']) && !isset($_REQUEST['form_refresh'])) {
$irow = DBfetch($iresult);
$resourcetype = $irow['resourcetype'];
$resourceid = $irow['resourceid'];
$width = $irow['width'];
$height = $irow['height'];
$colspan = $irow['colspan'];
$rowspan = $irow['rowspan'];
$elements = $irow['elements'];
$valign = $irow['valign'];
$halign = $irow['halign'];
$style = $irow['style'];
$url = $irow['url'];
$dynamic = $irow['dynamic'];
} else {
$resourcetype = get_request('resourcetype', 0);
$resourceid = get_request('resourceid', 0);
$width = get_request('width', 500);
$height = get_request('height', 100);
$colspan = get_request('colspan', 0);
$rowspan = get_request('rowspan', 0);
$elements = get_request('elements', 25);
$valign = get_request('valign', VALIGN_DEFAULT);
$halign = get_request('halign', HALIGN_DEFAULT);
$style = get_request('style', 0);
$url = get_request('url', '');
$dynamic = get_request('dynamic', SCREEN_SIMPLE_ITEM);
}
$form->addVar('screenid', $_REQUEST['screenid']);
// a-z order!!!
$cmbRes = new CCombobox('resourcetype', $resourcetype, 'submit()');
$cmbRes->addItem(SCREEN_RESOURCE_CLOCK, S_CLOCK);
$cmbRes->addItem(SCREEN_RESOURCE_DATA_OVERVIEW, S_DATA_OVERVIEW);
$cmbRes->addItem(SCREEN_RESOURCE_GRAPH, S_GRAPH);
$cmbRes->addItem(SCREEN_RESOURCE_ACTIONS, S_HISTORY_OF_ACTIONS);
$cmbRes->addItem(SCREEN_RESOURCE_EVENTS, S_HISTORY_OF_EVENTS);
$cmbRes->addItem(SCREEN_RESOURCE_HOSTS_INFO, S_HOSTS_INFO);
$cmbRes->addItem(SCREEN_RESOURCE_MAP, S_MAP);
$cmbRes->addItem(SCREEN_RESOURCE_PLAIN_TEXT, S_PLAIN_TEXT);
$cmbRes->addItem(SCREEN_RESOURCE_SCREEN, S_SCREEN);
$cmbRes->addItem(SCREEN_RESOURCE_SERVER_INFO, S_SERVER_INFO);
$cmbRes->addItem(SCREEN_RESOURCE_SIMPLE_GRAPH, S_SIMPLE_GRAPH);
$cmbRes->addItem(SCREEN_RESOURCE_HOSTGROUP_TRIGGERS, S_STATUS_OF_HOSTGROUP_TRIGGERS);
$cmbRes->addItem(SCREEN_RESOURCE_HOST_TRIGGERS, S_STATUS_OF_HOST_TRIGGERS);
$cmbRes->addItem(SCREEN_RESOURCE_SYSTEM_STATUS, S_SYSTEM_STATUS);
$cmbRes->addItem(SCREEN_RESOURCE_TRIGGERS_INFO, S_TRIGGERS_INFO);
$cmbRes->addItem(SCREEN_RESOURCE_TRIGGERS_OVERVIEW, S_TRIGGERS_OVERVIEW);
$cmbRes->addItem(SCREEN_RESOURCE_URL, S_URL);
$form->addRow(S_RESOURCE, $cmbRes);
if ($resourcetype == SCREEN_RESOURCE_GRAPH) {
// User-defined graph
$options = array('graphids' => $resourceid, 'select_hosts' => array('hostid', 'host'), 'output' => API_OUTPUT_EXTEND);
$graphs = CGraph::get($options);
$caption = '';
$id = 0;
if (!empty($graphs)) {
$id = $resourceid;
$graph = reset($graphs);
order_result($graph['hosts'], 'host');
$graph['host'] = reset($graph['hosts']);
$caption = $graph['host']['host'] . ':' . $graph['name'];
$nodeName = get_node_name_by_elid($graph['host']['hostid']);
if (!zbx_empty($nodeName)) {
$caption = '(' . $nodeName . ') ' . $caption;
}
}
$form->addVar('resourceid', $id);
$textfield = new CTextbox('caption', $caption, 75, 'yes');
$selectbtn = new CButton('select', S_SELECT, "javascript: return PopUp('popup.php?writeonly=1&dstfrm=" . $form->getName() . "&real_hosts=1&dstfld1=resourceid&dstfld2=caption&srctbl=graphs&srcfld1=graphid&srcfld2=name',800,450);");
$selectbtn->setAttribute('onmouseover', "javascript: this.style.cursor = 'pointer';");
$form->addRow(S_GRAPH_NAME, array($textfield, SPACE, $selectbtn));
} else {
if ($resourcetype == SCREEN_RESOURCE_SIMPLE_GRAPH) {
// Simple graph
$options = array('itemids' => $resourceid, 'select_hosts' => array('hostid', 'host'), 'output' => API_OUTPUT_EXTEND);
$items = CItem::get($options);
$caption = '';
$id = 0;
if (!empty($items)) {
$id = $resourceid;
$item = reset($items);
$item['host'] = reset($item['hosts']);
$caption = item_description($item);
$nodeName = get_node_name_by_elid($item['itemid']);
if (!zbx_empty($nodeName)) {
$caption = '(' . $nodeName . ') ' . $caption;
}
//.........这里部分代码省略.........
示例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';