本文整理汇总了PHP中CTableInfo::addItem方法的典型用法代码示例。如果您正苦于以下问题:PHP CTableInfo::addItem方法的具体用法?PHP CTableInfo::addItem怎么用?PHP CTableInfo::addItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTableInfo
的用法示例。
在下文中一共展示了CTableInfo::addItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CTableInfo
/*
** Zabbix
** Copyright (C) 2001-2014 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** 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.
**/
$iconMapTable = new CTableInfo(_('No icon maps found.'));
$iconMapTable->setHeader(array(_('Name'), _('Icon map')));
$iconMapTable->addItem(BR());
foreach ($this->data['iconmaps'] as $iconMap) {
$row = array();
foreach ($iconMap['mappings'] as $mapping) {
$row[] = $this->data['inventoryList'][$mapping['inventory_link']] . NAME_DELIMITER . $mapping['expression'] . SPACE . '⇒' . SPACE . $this->data['iconList'][$mapping['iconid']];
$row[] = BR();
}
$iconMapTable->addRow(array(new CLink($iconMap['name'], 'adm.iconmapping.php?form=update&iconmapid=' . $iconMap['iconmapid']), $row));
}
return $iconMapTable;
示例2: get_expressions_tab
function get_expressions_tab()
{
if (isset($_REQUEST['regexpid']) && !isset($_REQUEST["form_refresh"])) {
$expressions = array();
$sql = 'SELECT e.* ' . ' FROM expressions e ' . ' WHERE ' . DBin_node('e.expressionid') . ' AND e.regexpid=' . $_REQUEST['regexpid'] . ' ORDER BY e.expression_type';
$db_exps = DBselect($sql);
while ($exp = DBfetch($db_exps)) {
$expressions[] = $exp;
}
} else {
$expressions = get_request('expressions', array());
}
$tblExp = new CTableInfo();
$tblExp->setHeader(array(new CCheckBox('all_expressions', null, 'CheckAll("Regular expression","all_expressions","g_expressionid");'), S_EXPRESSION, S_EXPECTED_RESULT, S_IGNORE_CASE, S_EDIT));
// zbx_rksort($timeperiods);
foreach ($expressions as $id => $expression) {
$exp_result = expression_type2str($expression['expression_type']);
if (EXPRESSION_TYPE_ANY_INCLUDED == $expression['expression_type']) {
$exp_result .= ' (' . S_DELIMITER . "='" . $expression['exp_delimiter'] . "')";
}
$tblExp->addRow(array(new CCheckBox('g_expressionid[]', 'no', null, $id), $expression['expression'], $exp_result, $expression['case_sensitive'] ? S_YES : S_NO, new CButton('edit_expressionid[' . $id . ']', S_EDIT)));
$tblExp->addItem(new Cvar('expressions[' . $id . '][expression]', $expression['expression']));
$tblExp->addItem(new Cvar('expressions[' . $id . '][expression_type]', $expression['expression_type']));
$tblExp->addItem(new Cvar('expressions[' . $id . '][case_sensitive]', $expression['case_sensitive']));
$tblExp->addItem(new Cvar('expressions[' . $id . '][exp_delimiter]', $expression['exp_delimiter']));
}
$buttons = array();
if (!isset($_REQUEST['new_expression'])) {
$buttons[] = new CButton('new_expression', S_NEW);
$buttons[] = new CButton('delete_expression', S_DELETE);
}
$td = new CCol($buttons);
$td->addOption('colspan', '5');
$td->addOption('style', 'text-align: right;');
$tblExp->SetFooter($td);
return $tblExp;
}
示例3: get_expressions_tab
function get_expressions_tab()
{
if (isset($_REQUEST['regexpid']) && !isset($_REQUEST['form_refresh'])) {
$expressions = array();
$sql = 'SELECT e.* ' . ' FROM expressions e ' . ' WHERE ' . DBin_node('e.expressionid') . ' AND e.regexpid=' . zbx_dbstr($_REQUEST['regexpid']) . ' ORDER BY e.expression_type';
$db_exps = DBselect($sql);
while ($exp = DBfetch($db_exps)) {
$expressions[] = $exp;
}
} else {
$expressions = get_request('expressions', array());
}
$tblExp = new CTableInfo();
$tblExp->setHeader(array(new CCheckBox('all_expressions', null, 'checkAll("regularExpressionsForm", "all_expressions", "g_expressionid");'), _('Expression'), _('Expected result'), _('Case sensitive'), _('Edit')));
foreach ($expressions as $id => $expression) {
$exp_result = expression_type2str($expression['expression_type']);
if (EXPRESSION_TYPE_ANY_INCLUDED == $expression['expression_type']) {
$exp_result .= ' (' . _('Delimiter') . "='" . $expression['exp_delimiter'] . "')";
}
$tblExp->addRow(array(new CCheckBox('g_expressionid[]', 'no', null, $id), $expression['expression'], $exp_result, $expression['case_sensitive'] ? _('Yes') : _('No'), new CSubmit('edit_expressionid[' . $id . ']', _('Edit'))));
if (isset($expression['expressionid'])) {
$tblExp->addItem(new CVar('expressions[' . $id . '][expressionid]', $expression['expressionid']));
}
$tblExp->addItem(new CVar('expressions[' . $id . '][expression]', $expression['expression']));
$tblExp->addItem(new CVar('expressions[' . $id . '][expression_type]', $expression['expression_type']));
$tblExp->addItem(new CVar('expressions[' . $id . '][case_sensitive]', $expression['case_sensitive']));
$tblExp->addItem(new CVar('expressions[' . $id . '][exp_delimiter]', $expression['exp_delimiter']));
}
$buttons = array();
if (!isset($_REQUEST['new_expression'])) {
$buttons[] = new CSubmit('new_expression', _('New'));
$buttons[] = new CSubmit('delete_expression', _('Delete'));
}
$td = new CCol($buttons);
$td->setAttribute('colspan', '5');
$td->setAttribute('style', 'text-align: right;');
$tblExp->setFooter($td);
return $tblExp;
}
示例4: CTableInfo
// MAINTENANCE PERIODS {{{
$tblPeriod = new CTableInfo();
if (isset($_REQUEST['maintenanceid']) && !isset($_REQUEST['form_refresh'])) {
$timeperiods = array();
$sql = 'SELECT DISTINCT mw.maintenanceid, tp.* ' . ' FROM timeperiods tp, maintenances_windows mw ' . ' WHERE mw.maintenanceid=' . $_REQUEST['maintenanceid'] . ' AND tp.timeperiodid=mw.timeperiodid ' . ' ORDER BY tp.timeperiod_type ASC';
$db_timeperiods = DBselect($sql);
while ($timeperiod = DBfetch($db_timeperiods)) {
$timeperiods[] = $timeperiod;
}
} else {
$timeperiods = get_request('timeperiods', array());
}
$tblPeriod->setHeader(array(new CCheckBox('all_periods', null, 'checkAll("' . S_PERIOD . '","all_periods","g_timeperiodid");'), S_PERIOD_TYPE, S_SCHEDULE, S_PERIOD, S_ACTION));
foreach ($timeperiods as $id => $timeperiod) {
$tblPeriod->addRow(array(new CCheckBox('g_timeperiodid[]', 'no', null, $id), timeperiod_type2str($timeperiod['timeperiod_type']), new CCol(shedule2str($timeperiod), 'wraptext'), zbx_date2age(0, $timeperiod['period']), new CButton('edit_timeperiodid[' . $id . ']', S_EDIT)));
$tblPeriod->addItem(new Cvar('timeperiods[' . $id . '][timeperiod_type]', $timeperiod['timeperiod_type']));
$tblPeriod->addItem(new Cvar('timeperiods[' . $id . '][every]', $timeperiod['every']));
$tblPeriod->addItem(new Cvar('timeperiods[' . $id . '][month]', $timeperiod['month']));
$tblPeriod->addItem(new Cvar('timeperiods[' . $id . '][dayofweek]', $timeperiod['dayofweek']));
$tblPeriod->addItem(new Cvar('timeperiods[' . $id . '][day]', $timeperiod['day']));
$tblPeriod->addItem(new Cvar('timeperiods[' . $id . '][start_time]', $timeperiod['start_time']));
$tblPeriod->addItem(new Cvar('timeperiods[' . $id . '][start_date]', $timeperiod['start_date']));
$tblPeriod->addItem(new Cvar('timeperiods[' . $id . '][period]', $timeperiod['period']));
}
$footer = array();
if (!isset($_REQUEST['new_timeperiod'])) {
$footer[] = new CButton('new_timeperiod', S_NEW);
}
if ($tblPeriod->ItemsCount() > 0) {
$footer[] = new CButton('del_timeperiod', S_DELETE_SELECTED);
}
示例5: CCheckBox
$oper_details->setHint(nl2br(get_operation_desc(LONG_DESCRITION, $condition)));
$esc_steps_txt = null;
$esc_period_txt = null;
$esc_delay_txt = null;
if ($condition['esc_step_from'] < 1) {
$condition['esc_step_from'] = 1;
}
if (isset($_REQUEST['escalation'])) {
$esc_steps_txt = $condition['esc_step_from'] . ' - ' . $condition['esc_step_to'];
/* Display N-N as N */
$esc_steps_txt = $condition['esc_step_from'] == $condition['esc_step_to'] ? $condition['esc_step_from'] : $condition['esc_step_from'] . ' - ' . $condition['esc_step_to'];
$esc_period_txt = $condition['esc_period'] ? $condition['esc_period'] : S_DEFAULT;
$esc_delay_txt = $delay[$condition['esc_step_from']] ? convert_units($delay[$condition['esc_step_from']], 'uptime') : S_IMMEDIATELY;
}
$tblOper->addRow(array(new CCheckBox("g_operationid[]", 'no', null, $id), $esc_steps_txt, $oper_details, $esc_period_txt, $esc_delay_txt, new CButton('edit_operationid[' . $id . ']', S_EDIT)));
$tblOper->addItem(new CVar('operations[' . $id . '][operationtype]', $condition['operationtype']));
$tblOper->addItem(new CVar('operations[' . $id . '][object]', $condition['object']));
$tblOper->addItem(new CVar('operations[' . $id . '][objectid]', $condition['objectid']));
$tblOper->addItem(new CVar('operations[' . $id . '][mediatypeid]', $condition['mediatypeid']));
$tblOper->addItem(new CVar('operations[' . $id . '][shortdata]', $condition['shortdata']));
$tblOper->addItem(new CVar('operations[' . $id . '][longdata]', $condition['longdata']));
$tblOper->addItem(new CVar('operations[' . $id . '][esc_period]', $condition['esc_period']));
$tblOper->addItem(new CVar('operations[' . $id . '][esc_step_from]', $condition['esc_step_from']));
$tblOper->addItem(new CVar('operations[' . $id . '][esc_step_to]', $condition['esc_step_to']));
$tblOper->addItem(new CVar('operations[' . $id . '][default_msg]', $condition['default_msg']));
$tblOper->addItem(new CVar('operations[' . $id . '][evaltype]', $condition['evaltype']));
foreach ($condition['opconditions'] as $opcondid => $opcond) {
foreach ($opcond as $field => $value) {
$tblOper->addItem(new CVar('operations[' . $id . '][opconditions][' . $opcondid . '][' . $field . ']', $value));
}
}