本文整理汇总了PHP中CTable::setAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP CTable::setAttribute方法的具体用法?PHP CTable::setAttribute怎么用?PHP CTable::setAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTable
的用法示例。
在下文中一共展示了CTable::setAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
public function get($caption_l = S_IN, $caption_r = S_OTHER)
{
$grp_tab = new CTable();
$grp_tab->setAttribute('name', $this->name);
$grp_tab->setAttribute('id', $this->name);
$grp_tab->setCellSpacing(0);
$grp_tab->setCellPadding(0);
if (!is_null($caption_l) || !is_null($caption_r)) {
$grp_tab->addRow(array($caption_l, SPACE, $caption_r));
}
$add_btn = new CButton('add', ' « ');
//S_ADD);//
$add_btn->setType('button');
$add_btn->setAction('javascript: moveListBoxSelectedItem("' . $this->form->GetName() . '","' . $this->varname . '","' . $this->id_r . '","' . $this->id_l . '","add");');
$rmv_btn = new CButton('remove', ' » ');
//S_REMOVE);//
$rmv_btn->setType('button');
$rmv_btn->setAction('javascript: moveListBoxSelectedItem("' . $this->form->GetName() . '","' . $this->varname . '","' . $this->id_l . '","' . $this->id_r . '","rmv");');
$grp_tab->addRow(array($this->lbox, new CCol(array($add_btn, BR(), $rmv_btn), 'top'), $this->rbox));
return $grp_tab;
}
示例2: CWidget
** 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.
**/
$mapWidget = new CWidget('hat_maps');
$mapTable = new CTable(_('No maps found.'), 'map map-container');
$mapTable->setAttribute('style', 'margin-top: 4px;');
$icon = $fsIcon = null;
if (!empty($this->data['maps'])) {
$mapComboBox = new CComboBox('sysmapid', getRequest('sysmapid', 0), 'submit()');
foreach ($this->data['maps'] as $sysmapId => $map) {
$mapComboBox->addItem($sysmapId, $map['name']);
}
$headerMapForm = new CForm('get');
$headerMapForm->addVar('fullscreen', $this->data['fullscreen']);
$headerMapForm->addItem(array(_('Maps'), SPACE, $mapComboBox));
$headerSeverityMinForm = new CForm('get');
$headerSeverityMinForm->addVar('fullscreen', $this->data['fullscreen']);
$headerSeverityMinForm->addItem(array(SPACE, _('Minimum severity'), SPACE, $this->data['pageFilter']->getSeveritiesMinCB()));
$mapWidget->addHeader($this->data['map']['name'], array($headerMapForm, $headerSeverityMinForm));
// get map parent maps
$parentMaps = array();
示例3: CFormList
$triggersForm->addVar('action', $this->data['action']);
if ($this->data['parent_discoveryid']) {
$triggersForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
}
foreach ($this->data['g_triggerid'] as $triggerid) {
$triggersForm->addVar('g_triggerid[' . $triggerid . ']', $triggerid);
}
// create form list
$triggersFormList = new CFormList('triggersFormList');
// append severity to form list
$severityDiv = new CSeverity(array('id' => 'priority_div', 'name' => 'priority', 'value' => $this->data['priority']));
$triggersFormList->addRow(array(_('Severity'), SPACE, new CVisibilityBox('visible[priority]', isset($this->data['visible']['priority']), 'priority_div', _('Original'))), $severityDiv);
// append dependencies to form list
if (empty($this->data['parent_discoveryid'])) {
$dependenciesTable = new CTable(_('No dependencies defined.'), 'formElementTable');
$dependenciesTable->setAttribute('style', 'min-width: 500px;');
$dependenciesTable->setAttribute('id', 'dependenciesTable');
$dependenciesTable->setHeader(array(_('Name'), _('Action')));
foreach ($this->data['dependencies'] as $dependency) {
$triggersForm->addVar('dependencies[]', $dependency['triggerid'], 'dependencies_' . $dependency['triggerid']);
$hostNames = array();
foreach ($dependency['hosts'] as $host) {
$hostNames[] = CHtml::encode($host['name']);
$hostNames[] = ', ';
}
array_pop($hostNames);
if ($dependency['flags'] == ZBX_FLAG_DISCOVERY_NORMAL) {
$description = new CLink(array($hostNames, NAME_DELIMITER, CHtml::encode($dependency['description'])), 'triggers.php?form=update&hostid=' . $dependency['hostid'] . '&triggerid=' . $dependency['triggerid']);
$description->setAttribute('target', '_blank');
} else {
$description = array($hostNames, NAME_DELIMITER, $dependency['description']);
示例4: CWidget
$search_wdgt = new CWidget('search_wdgt');
$search = get_request('search', '');
// Header
if (zbx_empty($search)) {
$search = 'Search pattern is empty';
}
$search_wdgt->addHeader(array(S_SEARCH_BIG . ': ', bold($search)), SPACE);
//-------------
$left_tab = new CTable();
$left_tab->setCellPadding(3);
$left_tab->setCellSpacing(3);
$left_tab->setAttribute('border', 0);
$right_tab = new CTable();
$right_tab->setCellPadding(3);
$right_tab->setCellSpacing(3);
$right_tab->setAttribute('border', 0);
// FIND Hosts
$params = array('nodeids' => get_current_nodeid(), 'extendoutput' => true, 'pattern' => $search, 'extend_pattern' => true, 'limit' => $rows_per_page, 'order' => 'host');
$db_hosts = CHost::get($params);
$hosts = selectByPattern($db_hosts, 'host', $search, $rows_per_page);
$hostids = array_keys($hosts);
$hostsgroups = array();
$sql = 'SELECT * FROM hosts_groups hg WHERE ' . DBcondition('hg.hostid', $hostids);
$res = DBselect($sql);
while ($hostgroup = DBfetch($res)) {
$hostsgroups[$hostgroup['hostid']] = $hostgroup['groupid'];
}
$params = array('nodeids' => get_current_nodeid(), 'pattern' => $search, 'extend_pattern' => true, 'count' => 1);
$hosts_count = CHost::get($params);
$overalCount = $hosts_count['rowscount'];
$viewCount = count($hosts);
示例5: get
public function get()
{
$widget = array();
if (!empty($this->pageHeaders)) {
$widget[] = $this->createPageHeader();
}
if (!empty($this->headers)) {
$widget[] = $this->createHeader();
}
if (!empty($this->flicker)) {
$flicker_domid = 'flicker_' . $this->bodyId;
$flicker_tab = new CTable();
$flicker_tab->setAttribute('width', '100%');
$flicker_tab->setCellPadding(0);
$flicker_tab->setCellSpacing(0);
$div = new CDiv($this->flicker, null, $flicker_domid);
if (!$this->flicker_state) {
$div->setAttribute('style', 'display: none;');
}
$icon_l = new CDiv(SPACE . SPACE, $this->flicker_state ? 'dbl_arrow_up' : 'dbl_arrow_down', 'flicker_icon_l');
$icon_l->setAttribute('title', _('Maximize') . '/' . _('Minimize'));
$icon_r = new CDiv(SPACE . SPACE, $this->flicker_state ? 'dbl_arrow_up' : 'dbl_arrow_down', 'flicker_icon_r');
$icon_r->setAttribute('title', _('Maximize') . '/' . _('Minimize'));
$icons_row = new CTable(null, 'textwhite');
$flickerTitleWhenVisible = _('Hide filter');
$flickerTitleWhenHidden = _('Show filter');
$flickerTitle = $this->flicker_state ? $flickerTitleWhenVisible : $flickerTitleWhenHidden;
$icons_row->addRow(array($icon_l, new CSpan(SPACE . $flickerTitle . SPACE, null, 'flicker_title'), $icon_r));
$thin_tab = $this->createFlicker($icons_row);
$thin_tab->attr('id', 'filter_icon');
$thin_tab->addAction('onclick', "javascript: changeFlickerState(" . "'" . $flicker_domid . "', " . CJs::encodeJson($flickerTitleWhenVisible) . ", " . CJs::encodeJson($flickerTitleWhenHidden) . ");");
$flicker_tab->addRow($thin_tab, 'textcolorstyles pointer');
$flicker_tab->addRow($div);
$widget[] = $flicker_tab;
}
$div = new CDiv($this->body, 'w');
$div->setAttribute('id', $this->bodyId);
$widget[] = $div;
return new CDiv($widget, $this->getRootClass());
}
示例6: show_messages
function show_messages($bool = true, $okmsg = null, $errmsg = null)
{
global $page, $ZBX_MESSAGES;
if (!defined('PAGE_HEADER_LOADED')) {
return null;
}
if (defined('ZBX_API_REQUEST')) {
return null;
}
if (!isset($page['type'])) {
$page['type'] = PAGE_TYPE_HTML;
}
$imageMessages = array();
if (!$bool && !is_null($errmsg)) {
$msg = _('ERROR') . ': ' . $errmsg;
} elseif ($bool && !is_null($okmsg)) {
$msg = $okmsg;
}
if (isset($msg)) {
switch ($page['type']) {
case PAGE_TYPE_IMAGE:
// save all of the messages in an array to display them later in an image
$imageMessages[] = array('text' => $msg, 'color' => !$bool ? array('R' => 255, 'G' => 0, 'B' => 0) : array('R' => 34, 'G' => 51, 'B' => 68));
break;
case PAGE_TYPE_XML:
echo htmlspecialchars($msg) . "\n";
break;
case PAGE_TYPE_HTML:
default:
$msg_tab = new CTable($msg, $bool ? 'msgok' : 'msgerr');
$msg_tab->setCellPadding(0);
$msg_tab->setCellSpacing(0);
$row = array();
$msg_col = new CCol(bold($msg), 'msg_main msg');
$msg_col->setAttribute('id', 'page_msg');
$row[] = $msg_col;
if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
$msg_details = new CDiv(_('Details'), 'blacklink');
$msg_details->setAttribute('onclick', 'javascript: showHide("msg_messages", IE ? "block" : "table");');
$msg_details->setAttribute('title', _('Maximize') . '/' . _('Minimize'));
array_unshift($row, new CCol($msg_details, 'clr'));
}
$msg_tab->addRow($row);
$msg_tab->show();
break;
}
}
if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
if ($page['type'] == PAGE_TYPE_IMAGE) {
foreach ($ZBX_MESSAGES as $msg) {
// save all of the messages in an array to display them later in an image
if ($msg['type'] == 'error') {
$imageMessages[] = array('text' => $msg['message'], 'color' => array('R' => 255, 'G' => 55, 'B' => 55));
} else {
$imageMessages[] = array('text' => $msg['message'], 'color' => array('R' => 155, 'G' => 155, 'B' => 55));
}
}
} elseif ($page['type'] == PAGE_TYPE_XML) {
foreach ($ZBX_MESSAGES as $msg) {
echo '[' . $msg['type'] . '] ' . $msg['message'] . "\n";
}
} else {
$lst_error = new CList(null, 'messages');
foreach ($ZBX_MESSAGES as $msg) {
$lst_error->addItem($msg['message'], $msg['type']);
$bool = $bool && 'error' !== strtolower($msg['type']);
}
$msg_show = 6;
$msg_count = count($ZBX_MESSAGES);
if ($msg_count > $msg_show) {
$msg_count = $msg_show * 16;
$lst_error->setAttribute('style', 'height: ' . $msg_count . 'px;');
}
$tab = new CTable(null, $bool ? 'msgok' : 'msgerr');
$tab->setCellPadding(0);
$tab->setCellSpacing(0);
$tab->setAttribute('id', 'msg_messages');
$tab->setAttribute('style', 'width: 100%;');
if (isset($msg_tab) && $bool) {
$tab->setAttribute('style', 'display: none;');
}
$tab->addRow(new CCol($lst_error, 'msg'));
$tab->show();
}
$ZBX_MESSAGES = null;
}
// draw an image with the messages
if ($page['type'] == PAGE_TYPE_IMAGE && count($imageMessages) > 0) {
$imageFontSize = 8;
// calculate the size of the text
$imageWidth = 0;
$imageHeight = 0;
foreach ($imageMessages as &$msg) {
$size = imageTextSize($imageFontSize, 0, $msg['text']);
$msg['height'] = $size['height'] - $size['baseline'];
// calculate the total size of the image
$imageWidth = max($imageWidth, $size['width']);
$imageHeight += $size['height'] + 1;
}
unset($msg);
//.........这里部分代码省略.........
示例7: show_messages
function show_messages($bool = true, $okmsg = null, $errmsg = null)
{
global $page, $ZBX_MESSAGES;
if (!defined('PAGE_HEADER_LOADED')) {
return null;
}
if (defined('ZBX_API_REQUEST')) {
return null;
}
if (!isset($page['type'])) {
$page['type'] = PAGE_TYPE_HTML;
}
$message = array();
$width = 0;
$height = 0;
if (!$bool && !is_null($errmsg)) {
$msg = _('ERROR') . ': ' . $errmsg;
} elseif ($bool && !is_null($okmsg)) {
$msg = $okmsg;
}
if (isset($msg)) {
switch ($page['type']) {
case PAGE_TYPE_IMAGE:
array_push($message, array('text' => $msg, 'color' => !$bool ? array('R' => 255, 'G' => 0, 'B' => 0) : array('R' => 34, 'G' => 51, 'B' => 68), 'font' => 2));
$width = max($width, imagefontwidth(2) * zbx_strlen($msg) + 1);
$height += imagefontheight(2) + 1;
break;
case PAGE_TYPE_XML:
echo htmlspecialchars($msg) . "\n";
break;
case PAGE_TYPE_HTML:
default:
$msg_tab = new CTable($msg, $bool ? 'msgok' : 'msgerr');
$msg_tab->setCellPadding(0);
$msg_tab->setCellSpacing(0);
$row = array();
$msg_col = new CCol(bold($msg), 'msg_main msg');
$msg_col->setAttribute('id', 'page_msg');
$row[] = $msg_col;
if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
$msg_details = new CDiv(_('Details'), 'blacklink');
$msg_details->setAttribute('onclick', 'javascript: showHide("msg_messages", IE ? "block" : "table");');
$msg_details->setAttribute('title', _('Maximize') . '/' . _('Minimize'));
array_unshift($row, new CCol($msg_details, 'clr'));
}
$msg_tab->addRow($row);
$msg_tab->show();
break;
}
}
if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
if ($page['type'] == PAGE_TYPE_IMAGE) {
$msg_font = 2;
foreach ($ZBX_MESSAGES as $msg) {
if ($msg['type'] == 'error') {
array_push($message, array('text' => $msg['message'], 'color' => array('R' => 255, 'G' => 55, 'B' => 55), 'font' => $msg_font));
} else {
array_push($message, array('text' => $msg['message'], 'color' => array('R' => 155, 'G' => 155, 'B' => 55), 'font' => $msg_font));
}
$width = max($width, imagefontwidth($msg_font) * zbx_strlen($msg['message']) + 1);
$height += imagefontheight($msg_font) + 1;
}
} elseif ($page['type'] == PAGE_TYPE_XML) {
foreach ($ZBX_MESSAGES as $msg) {
echo '[' . $msg['type'] . '] ' . $msg['message'] . "\n";
}
} else {
$lst_error = new CList(null, 'messages');
foreach ($ZBX_MESSAGES as $msg) {
$lst_error->addItem($msg['message'], $msg['type']);
$bool = $bool && 'error' != zbx_strtolower($msg['type']);
}
$msg_show = 6;
$msg_count = count($ZBX_MESSAGES);
if ($msg_count > $msg_show) {
$msg_count = $msg_show * 16;
$lst_error->setAttribute('style', 'height: ' . $msg_count . 'px;');
}
$tab = new CTable(null, $bool ? 'msgok' : 'msgerr');
$tab->setCellPadding(0);
$tab->setCellSpacing(0);
$tab->setAttribute('id', 'msg_messages');
$tab->setAttribute('style', 'width: 100%;');
if (isset($msg_tab) && $bool) {
$tab->setAttribute('style', 'display: none;');
}
$tab->addRow(new CCol($lst_error, 'msg'));
$tab->show();
}
$ZBX_MESSAGES = null;
}
if ($page['type'] == PAGE_TYPE_IMAGE && count($message) > 0) {
$width += 2;
$height += 2;
$canvas = imagecreate($width, $height);
imagefilledrectangle($canvas, 0, 0, $width, $height, imagecolorallocate($canvas, 255, 255, 255));
foreach ($message as $id => $msg) {
$message[$id]['y'] = 1 + (isset($previd) ? $message[$previd]['y'] + $message[$previd]['h'] : 0);
$message[$id]['h'] = imagefontheight($msg['font']);
imagestring($canvas, $msg['font'], 1, $message[$id]['y'], $msg['text'], imagecolorallocate($canvas, $msg['color']['R'], $msg['color']['G'], $msg['color']['B']));
//.........这里部分代码省略.........
示例8: time
$color = get_request('color', '009900');
$report_timesince = get_request('report_timesince', time() - 86400);
$report_timetill = get_request('report_timetill', time());
$frmPd->addVar('config', $config);
$frmPd->addVar('report_timesince', $report_timesince);
$frmPd->addVar('report_timetill', $report_timetill);
if (isset($_REQUEST['period_id'])) {
$frmPd->addVar('period_id', $_REQUEST['period_id']);
}
$frmPd->addRow(array(new CVisibilityBox('caption_visible', !zbx_empty($caption), 'caption', S_DEFAULT), S_CAPTION), new CTextBox('caption', $caption, 10));
// $frmPd->addRow(S_CAPTION, new CTextBox('caption',$caption,10));
//*
$clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer');
$clndr_icon->addAction('onclick', 'javascript: ' . 'var pos = getPosition(this); ' . 'pos.top+=10; ' . 'pos.left+=16; ' . "CLNDR['avail_report_since'].clndr.clndrshow(pos.top,pos.left);");
$reporttimetab = new CTable(null, 'calendar');
$reporttimetab->setAttribute('width', '10%');
$reporttimetab->setCellPadding(0);
$reporttimetab->setCellSpacing(0);
$reporttimetab->addRow(array(S_FROM, new CNumericBox('report_since_day', $report_timesince > 0 ? date('d', $report_timesince) : '', 2), '/', new CNumericBox('report_since_month', $report_timesince > 0 ? date('m', $report_timesince) : '', 2), '/', new CNumericBox('report_since_year', $report_timesince > 0 ? date('Y', $report_timesince) : '', 4), SPACE, new CNumericBox('report_since_hour', $report_timesince > 0 ? date('H', $report_timesince) : '', 2), ':', new CNumericBox('report_since_minute', $report_timesince > 0 ? date('i', $report_timesince) : '', 2), $clndr_icon));
zbx_add_post_js('create_calendar(null,' . '["report_since_day","report_since_month","report_since_year","report_since_hour","report_since_minute"],' . '"avail_report_since",' . '"report_timesince");');
$clndr_icon->addAction('onclick', 'javascript: ' . 'var pos = getPosition(this); ' . 'pos.top+=10; ' . 'pos.left+=16; ' . "CLNDR['avail_report_till'].clndr.clndrshow(pos.top,pos.left);");
$reporttimetab->addRow(array(S_TILL, new CNumericBox('report_till_day', $report_timetill > 0 ? date('d', $report_timetill) : '', 2), '/', new CNumericBox('report_till_month', $report_timetill > 0 ? date('m', $report_timetill) : '', 2), '/', new CNumericBox('report_till_year', $report_timetill > 0 ? date('Y', $report_timetill) : '', 4), SPACE, new CNumericBox('report_till_hour', $report_timetill > 0 ? date('H', $report_timetill) : '', 2), ':', new CNumericBox('report_till_minute', $report_timetill > 0 ? date('i', $report_timetill) : '', 2), $clndr_icon));
zbx_add_post_js('create_calendar(null,' . '["report_till_day","report_till_month","report_till_year","report_till_hour","report_till_minute"],' . '"avail_report_till",' . '"report_timetill");');
$frmPd->addRow(S_PERIOD, $reporttimetab);
//*/
if ($config != 1) {
$frmPd->addRow(S_COLOR, new CColor('color', $color));
} else {
$frmPd->addVar('color', $color);
}
$frmPd->addItemToBottomRow(new CButton('save', isset($_REQUEST['period_id']) ? S_UPDATE : S_ADD));
示例9: CVisibilityBox
$hostFormList->addRow(array(_('New host group'), SPACE, new CVisibilityBox('visible[newgroup]', isset($this->data['visible']['newgroup']), 'newgroup', _('Original'))), new CTextBox('newgroup', $this->data['newgroup'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64), null, null, 'new');
// append proxy to form list
$proxyComboBox = new CComboBox('proxy_hostid', $this->data['proxy_hostid']);
$proxyComboBox->addItem(0, _('(no proxy)'));
foreach ($this->data['proxies'] as $proxie) {
$proxyComboBox->addItem($proxie['hostid'], $proxie['host']);
}
$hostFormList->addRow(array(_('Monitored by proxy'), SPACE, new CVisibilityBox('visible[proxy_hostid]', isset($this->data['visible']['proxy_hostid']), 'proxy_hostid', _('Original'))), $proxyComboBox);
// append status to form list
$statusComboBox = new CComboBox('status', $this->data['status']);
$statusComboBox->addItem(HOST_STATUS_MONITORED, _('Monitored'));
$statusComboBox->addItem(HOST_STATUS_NOT_MONITORED, _('Not monitored'));
$hostFormList->addRow(array(_('Status'), SPACE, new CVisibilityBox('visible[status]', isset($this->data['visible']['status']), 'status', _('Original'))), $statusComboBox);
// append templates table to from list
$templatesTable = new CTable(_('No templates defined.'), 'formElementTable');
$templatesTable->setAttribute('style', 'min-width: 500px;');
$templatesTable->setAttribute('id', 'template_table');
$templatesTable->setHeader(array(_('Name'), _('Action')));
foreach ($this->data['templates'] as $templateid => $templateName) {
$hostForm->addVar('templates[' . $templateid . ']', $templateName);
$row = new CRow(array($templateName, new CButton('remove', _('Remove'), 'javascript: removeTemplate("' . $templateid . '");', 'link_menu')));
$row->setAttribute('id', 'template_row_' . $templateid);
$templatesTable->addRow($row);
}
$templatesDiv = new CDiv(array($templatesTable, new CButton('btn1', _('Add'), 'return PopUp("popup.php?srctbl=templates&srcfld1=hostid&srcfld2=host' . '&dstfrm=' . $hostForm->getName() . '&dstfld1=new_template&templated_hosts=1' . url_param($this->data['templates'], false, 'existed_templates') . '", 450, 450)', 'link_menu'), BR(), BR(), new CCheckBox('mass_replace_tpls', $this->data['mass_replace_tpls']), SPACE, _('Replace'), BR(), new CCheckBox('mass_clear_tpls', $this->data['mass_clear_tpls']), SPACE, _('Clear when unlinking')), 'objectgroup inlineblock border_dotted ui-corner-all');
$templatesDiv->setAttribute('id', 'templates_div');
$hostFormList->addRow(array(_('Link templates'), SPACE, new CVisibilityBox('visible[template_table]', !empty($this->data['visible']['template_table']) ? 'yes' : 'no', 'templates_div', _('Original'))), $templatesDiv);
// append ipmi to form list
$ipmiAuthtypeComboBox = new CComboBox('ipmi_authtype', $this->data['ipmi_authtype']);
$ipmiAuthtypeComboBox->addItems(ipmiAuthTypes());
$hostFormList->addRow(array(_('IPMI authentication algorithm'), SPACE, new CVisibilityBox('visible[ipmi_authtype]', isset($this->data['visible']['ipmi_authtype']), 'ipmi_authtype', _('Original'))), $ipmiAuthtypeComboBox);
示例10: show_history
function show_history($itemid, $from, $stime, $period)
{
//$till=date(S_DATE_FORMAT_YMDHMS,time(NULL)-$from*3600);
//show_table_header(S_TILL.SPACE.$till.' ( '.zbx_date2age($stime,$stime+$period).' )');
$td = new CCol(get_js_sizeable_graph('graph', 'chart.php?itemid=' . $itemid . url_param($from, false, 'from') . url_param($stime, false, 'stime') . url_param($period, false, 'period')));
$td->setAttribute('align', 'center');
$tr = new CRow($td);
$tr->setAttribute('bgcolor', '#dddddd');
$table = new CTable();
$table->setAttribute('width', '100%');
$table->setAttribute('bgcolor', '#cccccc');
$table->setAttribute('cellspacing', '1');
$table->setAttribute('cellpadding', '3');
$table->addRow($tr);
$table->show();
}
示例11: CLink
$servicesChildTable->setHeader(array(_('Services'), _('Soft'), _('Trigger'), _('Action')));
foreach ($this->data['children'] as $child) {
$childrenLink = new CLink($child['name'], 'services.php?form=1&serviceid=' . $child['serviceid']);
$childrenLink->setAttribute('target', '_blank');
$row = new CRow(array(array($childrenLink, new CVar('children[' . $child['serviceid'] . '][name]', $child['name']), new CVar('children[' . $child['serviceid'] . '][serviceid]', $child['serviceid'])), new CCheckBox('children[' . $child['serviceid'] . '][soft]', isset($child['soft']) && !empty($child['soft']) ? 'checked' : 'no', null, 1), !empty($child['trigger']) ? $child['trigger'] : '-', new CButton('remove', _('Remove'), 'javascript: removeDependentChild(\'' . $child['serviceid'] . '\');', 'link_menu')));
$row->setAttribute('id', 'children_' . $child['serviceid']);
$servicesChildTable->addRow($row);
}
$servicesDependenciesFormList = new CFormList('servicesDependensiesFormList');
$servicesDependenciesFormList->addRow(_('Depends on'), new CDiv(array($servicesChildTable, new CButton('add_child_service', _('Add'), "javascript: openWinCentered('services.php?cservices=1" . url_param('serviceid') . "', 'ZBX_Services_List', 640, 520, 'scrollbars=1, toolbar=0, menubar=0, resizable=0');", 'link_menu')), 'objectgroup inlineblock border_dotted ui-corner-all'));
/*
* Service times tab
*/
$servicesTimeFormList = new CFormList('servicesTimeFormList');
$servicesTimeTable = new CTable(_('No times defined. Work 24x7.'), 'formElementTable');
$servicesTimeTable->setAttribute('style', 'min-width: 500px;');
$servicesTimeTable->setHeader(array(_('Type'), _('Interval'), _('Note'), _('Action')));
$i = 0;
foreach ($this->data['times'] as $serviceTime) {
switch ($serviceTime['type']) {
case SERVICE_TIME_TYPE_UPTIME:
$type = new CSpan(_('Uptime'), 'enabled');
$from = dowHrMinToStr($serviceTime['ts_from']);
$to = dowHrMinToStr($serviceTime['ts_to'], true);
break;
case SERVICE_TIME_TYPE_DOWNTIME:
$type = new CSpan(_('Downtime'), 'disabled');
$from = dowHrMinToStr($serviceTime['ts_from']);
$to = dowHrMinToStr($serviceTime['ts_to'], true);
break;
case SERVICE_TIME_TYPE_ONETIME_DOWNTIME:
示例12: CComboBox
$locationComboBox = new CComboBox('label_location', $this->data['sysmap']['label_location']);
$locationComboBox->addItems(array(0 => _('Bottom'), 1 => _('Left'), 2 => _('Right'), 3 => _('Top')));
$sysmapList->addRow(_('Icon label location'), $locationComboBox);
// append show unack to form list
$showUnackComboBox = new CComboBox('show_unack', $this->data['sysmap']['show_unack']);
$showUnackComboBox->addItems(array(EXTACK_OPTION_ALL => _('All'), EXTACK_OPTION_BOTH => _('Separated'), EXTACK_OPTION_UNACK => _('Unacknowledged only')));
$showUnackComboBox->setEnabled($this->data['config']['event_ack_enable']);
if (!$this->data['config']['event_ack_enable']) {
$showUnackComboBox->setAttribute('title', _('Acknowledging disabled'));
}
$sysmapList->addRow(_('Problem display'), $showUnackComboBox);
// append severity min to form list
$sysmapList->addRow(_('Minimum trigger severity'), new CSeverity(array('name' => 'severity_min', 'value' => $this->data['sysmap']['severity_min'])));
// create url table
$urlTable = new CTable(_('No URLs defined.'), 'formElementTable');
$urlTable->setAttribute('style', 'min-width: 500px;');
$urlTable->setHeader(array(_('Name'), _('URL'), _('Element'), SPACE));
if (empty($this->data['sysmap']['urls'])) {
$this->data['sysmap']['urls'][] = array('name' => '', 'url' => '', 'elementtype' => 0);
}
$i = 0;
foreach ($this->data['sysmap']['urls'] as $url) {
$urlLabel = new CTextBox('urls[' . $i . '][name]', $url['name'], 32);
$urlLink = new CTextBox('urls[' . $i . '][url]', $url['url'], 32);
$urlEtype = new CComboBox('urls[' . $i . '][elementtype]', $url['elementtype']);
$urlEtype->addItems(sysmap_element_types());
$removeButton = new CSpan(_('Remove'), 'link_menu');
$removeButton->addAction('onclick', '$("urlEntry_' . $i . '").remove();');
$urlRow = new CRow(array($urlLabel, $urlLink, $urlEtype, $removeButton));
$urlRow->setAttribute('id', 'urlEntry_' . $i);
$urlTable->addRow($urlRow);
示例13: array
$page['title'] = _zeT('Not Supported Items');
$page['file'] = 'zbxe-ns.php';
$page['hist_arg'] = array('groupid', 'hostid', 'graphid');
$page['scripts'] = array('class.calendar.js', 'scriptaculous.js?load=effects');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
include_once 'include/page_header.php';
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = array('groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'applicationid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'itemid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'timeshiftsource' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'timeshiftprojection' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'agregation' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'num_projection' => array(T_ZBX_STR, O_OPT, P_SYS, DB_ID, null), 'formato' => array(T_ZBX_STR, O_OPT, P_SYS, DB_ID, null), 'report_timesince' => array(T_ZBX_STR, O_OPT, null, null, 'isset({filter})'), 'report_timetill' => array(T_ZBX_STR, O_OPT, null, null, 'isset({filter})'));
check_fields($fields);
// --------------------------- Filtro ---------------------------------------------------------------------
$options = array('groups' => array('monitored_hosts' => 1), 'hosts' => array('monitored_hosts' => 1), 'groupid' => get_request('groupid', null), 'hostid' => get_request('hostid', null));
$hostid = $_REQUEST['hostid'] = get_request('hostid', 0);
$groupid = $_REQUEST['groupid'] = get_request('groupid', 0);
$pageFilter = new CPageFilter($options);
$filter_table = new CTable('', 'filter_config');
$filter_table->setAttribute('border', 0);
$filter_table->setAttribute('width', '100%');
$cmbGroups = $pageFilter->getGroupsCB(true);
$cmbHosts = $pageFilter->getHostsCB(true);
$filter_table->addRow(array(array(bold(_('Group')), ': ', $cmbGroups), array(bold(_('Host')), ': ', $cmbHosts), array()));
$groupids = checkAccessGroup('groupid');
$hostids = checkAccessHost('hostid');
// --------------------------- Fim Filtro ---------------------------------------------------------------------
$options = array();
$options['templated_hosts'] = 1;
$hosts = API::Host()->get($options);
$filtroSegHosts = " hos.status <> 1 AND " . dbConditionInt('hos.hostid', zbx_objectValues($hosts, 'hostid'));
$rep2_wdgt = new CWidget();
$rep2_wdgt->addPageHeader(_zeT('Not Supported Items Report'));
$filter_form = new CForm();
$filter_form->setMethod('get');
示例14: show_messages
function show_messages($bool = TRUE, $okmsg = NULL, $errmsg = NULL)
{
global $page, $ZBX_MESSAGES;
if (!defined('PAGE_HEADER_LOADED')) {
return;
}
if (defined('ZBX_API_REQUEST')) {
return;
}
if (!isset($page['type'])) {
$page['type'] = PAGE_TYPE_HTML;
}
$message = array();
$width = 0;
$height = 0;
$img_space = null;
if (!$bool && !is_null($errmsg)) {
$msg = S_CONFIG_ERROR_HEAD . ': ' . $errmsg;
} else {
if ($bool && !is_null($okmsg)) {
$msg = $okmsg;
}
}
$api_errors = CZBXAPI::resetErrors();
if (!empty($api_errors)) {
error($api_errors);
}
if (isset($msg)) {
switch ($page['type']) {
case PAGE_TYPE_IMAGE:
array_push($message, array('text' => $msg, 'color' => !$bool ? array('R' => 255, 'G' => 0, 'B' => 0) : array('R' => 34, 'G' => 51, 'B' => 68), 'font' => 2));
$width = max($width, ImageFontWidth(2) * zbx_strlen($msg) + 1);
$height += imagefontheight(2) + 1;
break;
case PAGE_TYPE_XML:
echo htmlspecialchars($msg) . "\n";
break;
// case PAGE_TYPE_JS: break;
// case PAGE_TYPE_JS: break;
case PAGE_TYPE_HTML:
default:
$msg_tab = new CTable($msg, $bool ? 'msgok' : 'msgerr');
$msg_tab->setCellPadding(0);
$msg_tab->setCellSpacing(0);
$row = array();
$msg_col = new CCol(bold($msg), 'msg_main msg');
$msg_col->setAttribute('id', 'page_msg');
$row[] = $msg_col;
if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
$msg_details = new CDiv(S_DETAILS, 'blacklink');
$msg_details->setAttribute('onclick', "javascript: ShowHide('msg_messages', IE?'block':'table');");
$msg_details->setAttribute('title', S_MAXIMIZE . '/' . S_MINIMIZE);
array_unshift($row, new CCol($msg_details, 'clr'));
}
$msg_tab->addRow($row);
$msg_tab->show();
$img_space = new CImg('images/general/tree/zero.gif', 'space', '100', '2');
break;
}
}
if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
if ($page['type'] == PAGE_TYPE_IMAGE) {
$msg_font = 2;
foreach ($ZBX_MESSAGES as $msg) {
if ($msg['type'] == 'error') {
array_push($message, array('text' => $msg['message'], 'color' => array('R' => 255, 'G' => 55, 'B' => 55), 'font' => $msg_font));
} else {
array_push($message, array('text' => $msg['message'], 'color' => array('R' => 155, 'G' => 155, 'B' => 55), 'font' => $msg_font));
}
$width = max($width, imagefontwidth($msg_font) * zbx_strlen($msg['message']) + 1);
$height += imagefontheight($msg_font) + 1;
}
} else {
if ($page['type'] == PAGE_TYPE_XML) {
foreach ($ZBX_MESSAGES as $msg) {
echo '[' . $msg['type'] . '] ' . $msg['message'] . "\n";
}
} else {
$lst_error = new CList(null, 'messages');
foreach ($ZBX_MESSAGES as $msg) {
$lst_error->addItem($msg['message'], $msg['type']);
$bool = $bool && 'error' != zbx_strtolower($msg['type']);
}
//message scroll if needed
$msg_show = 6;
$msg_count = count($ZBX_MESSAGES);
if ($msg_count > $msg_show) {
$msg_count = $msg_show;
$msg_count = $msg_count * 16;
$lst_error->setAttribute('style', 'height: ' . $msg_count . 'px;');
}
$tab = new CTable(null, $bool ? 'msgok' : 'msgerr');
$tab->setCellPadding(0);
$tab->setCellSpacing(0);
$tab->setAttribute('id', 'msg_messages');
$tab->setAttribute('style', 'width: 100%;');
if (isset($msg_tab) && $bool) {
$tab->setAttribute('style', 'display: none;');
}
$tab->addRow(new CCol($lst_error, 'msg'));
//.........这里部分代码省略.........
示例15: createHeader
private function createHeader()
{
$header = array_shift($this->headers);
$td_l = new CCol(SPACE);
$td_l->setAttribute('width', '100%');
$right_row = array($td_l);
if (!is_null($header['right'])) {
foreach ($header['right'] as $num => $r_item) {
$right_row[] = new CCol($r_item);
}
}
if (!is_null($this->state)) {
$icon = new CIcon(S_SHOW . '/' . S_HIDE, $this->state ? 'arrowup' : 'arrowdown', "change_hat_state(this,'" . $this->domid . "');");
$icon->setAttribute('id', $this->domid . '_icon');
$right_row[] = new CCol($icon);
}
$right_tab = new CTable(null, 'nowrap');
$right_tab->setAttribute('width', '100%');
$right_tab->addRow($right_row, 'textblackwhite');
$header['right'] = $right_tab;
$header_tab = new CTable(null, $this->css_class);
$header_tab->setCellSpacing(0);
$header_tab->setCellPadding(1);
if (!empty($this->flicker)) {
// $header_tab->setAttribute('style','border-bottom: 0px;');
}
$header_tab->addRow($this->createHeaderRow($header['left'], $right_tab), 'first');
foreach ($this->headers as $num => $header) {
$header_tab->addRow($this->createHeaderRow($header['left'], $header['right']), 'next');
}
return $header_tab;
}