本文整理汇总了PHP中CDiv类的典型用法代码示例。如果您正苦于以下问题:PHP CDiv类的具体用法?PHP CDiv怎么用?PHP CDiv使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CDiv类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Process screen.
*
* @return CDiv (screen inside container)
*/
public function get()
{
$error = null;
$timeOffset = null;
$timeZone = null;
switch ($this->screenitem['style']) {
case TIME_TYPE_HOST:
$items = API::Item()->get(array('itemids' => $this->screenitem['resourceid'], 'selectHosts' => array('host'), 'output' => array('itemid', 'value_type')));
$item = reset($items);
$host = reset($item['hosts']);
$lastValue = Manager::History()->getLast(array($item));
if ($lastValue) {
$lastValue = reset($lastValue[$item['itemid']]);
$item['lastvalue'] = $lastValue['value'];
$item['lastclock'] = $lastValue['clock'];
} else {
$item['lastvalue'] = '0';
$item['lastclock'] = '0';
}
$timeType = $host['host'];
preg_match('/([+-]{1})([\\d]{1,2}):([\\d]{1,2})/', $item['lastvalue'], $arr);
if (!empty($arr)) {
$timeZone = $arr[2] * SEC_PER_HOUR + $arr[3] * SEC_PER_MIN;
if ($arr[1] == '-') {
$timeZone = 0 - $timeZone;
}
}
if ($lastvalue = strtotime($item['lastvalue'])) {
$diff = time() - $item['lastclock'];
$timeOffset = $lastvalue + $diff;
} else {
$error = _('NO DATA');
}
break;
case TIME_TYPE_SERVER:
$error = null;
$timeType = _('SERVER');
$timeOffset = time();
$timeZone = date('Z');
break;
default:
$error = null;
$timeType = _('LOCAL');
$timeOffset = null;
$timeZone = null;
break;
}
if ($this->screenitem['width'] > $this->screenitem['height']) {
$this->screenitem['width'] = $this->screenitem['height'];
}
$item = new CFlashClock($this->screenitem['width'], $this->screenitem['height'], $this->action);
$item->setTimeError($error);
$item->setTimeType($timeType);
$item->setTimeZone($timeZone);
$item->setTimeOffset($timeOffset);
$flashclockOverDiv = new CDiv(null, 'flashclock');
$flashclockOverDiv->setAttribute('style', 'width: ' . $this->screenitem['width'] . 'px; height: ' . $this->screenitem['height'] . 'px;');
return $this->getOutput(array($item, $flashclockOverDiv));
}
开发者ID:davidmr001,项目名称:zatree-2.2,代码行数:64,代码来源:CScreenClock.php
示例2: build
/**
* Display the widget in expanded or collapsed state.
*/
public function build()
{
$body = new CDiv($this->body, 'body');
$body->setAttribute('id', $this->id);
if (!$this->open) {
$body->setAttribute('style', 'display: none;');
if ($this->footer) {
$this->footer->setAttribute('style', 'display: none;');
}
}
$this->cleanItems();
$this->addItem($this->header);
$this->addItem($body);
$this->addItem($this->footer);
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:18,代码来源:CCollapsibleUiWidget.php
示例3: addValue
public function addValue($name, $value, $checked = null)
{
$this->count++;
$id = str_replace(array('[', ']'), array('_'), $this->name) . '_' . $this->count;
$radio = new CInput('radio', $this->name, $value);
$radio->attr('id', zbx_formatDomId($id));
if (strcmp($value, $this->value) == 0 || !is_null($checked) || $checked) {
$radio->attr('checked', 'checked');
}
$label = new CLabel($name, $id);
$outerDiv = new CDiv(array($radio, $label));
if ($this->orientation == self::ORIENTATION_HORIZONTAL) {
$outerDiv->addClass('inlineblock');
}
parent::addItem($outerDiv);
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:16,代码来源:class.cradiobuttonlist.php
示例4: __construct
public function __construct($header, $messages = [], $buttons = [])
{
parent::__construct($header);
$this->addClass(ZBX_STYLE_MSG_BAD);
$this->addClass('msg-global');
if ($messages) {
parent::addItem((new CDiv((new CList($messages))->addClass(ZBX_STYLE_MSG_DETAILS_BORDER)))->addClass(ZBX_STYLE_MSG_DETAILS));
}
parent::addItem((new CDiv($buttons))->addClass('msg-buttons'));
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:10,代码来源:CWarning.php
示例5: get
/**
* Process screen.
*
* @return CDiv (screen inside container)
*/
public function get()
{
$image = new CImg('map.php?noedit=1&sysmapid=' . $this->screenitem['resourceid'] . '&width=' . $this->screenitem['width'] . '&height=' . $this->screenitem['height'] . '&curtime=' . time());
$image->setAttribute('id', 'map_' . $this->screenitem['screenitemid']);
if ($this->mode == SCREEN_MODE_PREVIEW) {
$sysmap = API::Map()->get(array('sysmapids' => $this->screenitem['resourceid'], 'output' => API_OUTPUT_EXTEND, 'selectSelements' => API_OUTPUT_EXTEND, 'selectLinks' => API_OUTPUT_EXTEND, 'expandUrls' => true, 'nopermissions' => true, 'preservekeys' => true));
$sysmap = reset($sysmap);
$actionMap = getActionMapBySysmap($sysmap);
$image->setMap($actionMap->getName());
$output = array($actionMap, $image);
} elseif ($this->mode == SCREEN_MODE_EDIT) {
$output = array($image, BR(), new CLink(_('Change'), $this->action));
} else {
$output = array($image);
}
$this->insertFlickerfreeJs();
$div = new CDiv($output, 'map-container flickerfreescreen', $this->getScreenId());
$div->setAttribute('data-timestamp', $this->timestamp);
$div->addStyle('position: relative;');
return $div;
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:26,代码来源:CScreenMap.php
示例6: bodyToString
function bodyToString($destroy = true)
{
$left = new CDiv(null, 'left');
$left->addItem(new CDiv($this->getList(), 'left_menu'));
$link1 = new CLink('www.zabbix.com', 'http://www.zabbix.com/', null, null, true);
$link1->setAttribute('target', '_blank');
$link2 = new CLink('GPL v2', 'http://www.zabbix.com/license.php', null, null, true);
$link2->setAttribute('target', '_blank');
$licence = new CDiv(array($link1, BR(), ' Licensed under ', $link2), 'setup_wizard_licence');
$left->addItem($licence);
$right = new CDiv(null, 'right');
if ($this->getStep() == 0) {
$right->addItem(new CDiv(null, 'blank_title'));
$right->addItem(new CDiv($this->getState(), 'blank_under_title'));
$container = new CDiv(array($left, $right), 'setup_wizard setup_wizard_welcome');
} else {
$right->addItem(new CDiv($this->stage[$this->getStep()]['title'], 'setup_title'));
$right->addItem(new CDiv($this->getState(), 'under_title'));
$container = new CDiv(array($left, $right), 'setup_wizard');
}
if (isset($this->stage[$this->getStep() + 1])) {
$next = new CSubmit('next[' . $this->getStep() . ']', _('Next') . SPACE . '»');
} else {
$next = new CSubmit('finish', _('Finish'));
}
if (isset($this->HIDE_CANCEL_BUTTON) && $this->HIDE_CANCEL_BUTTON) {
$cancel = null;
} else {
$cancel = new CDiv(new CSubmit('cancel', _('Cancel')), 'footer_left');
}
if ($this->DISABLE_NEXT_BUTTON) {
$next->setEnabled(false);
}
// if the user is not logged in (first setup run) hide the "previous" button on the final step
if ($this->getStep() && (CWebUser::$data && CWebUser::getType() == USER_TYPE_SUPER_ADMIN || $this->getStep() < 5)) {
$back = new CSubmit('back[' . $this->getStep() . ']', '«' . SPACE . _('Previous'));
} else {
$back = null;
}
$footer = new CDiv(array($cancel, new CDiv(array($back, $next), 'footer_right')), 'footer');
$container->addItem($footer);
return parent::bodyToString($destroy) . $container->ToString();
}
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:43,代码来源:setup.inc.php
示例7: toString
public function toString($destroy = true)
{
if (count($this->tabs) == 1) {
$this->setAttribute('class', 'min-width ui-tabs ui-widget ui-widget-content ui-corner-all widget');
$header = reset($this->headers);
$header = new CDiv($header);
$header->addClass('ui-corner-all ui-widget-header header');
$header->setAttribute('id', 'tab_' . key($this->headers));
$this->addItem($header);
$tab = reset($this->tabs);
$tab->addClass('ui-tabs ui-tabs-panel ui-widget ui-widget-content ui-corner-all widget');
$this->addItem($tab);
} else {
$headersList = new CList();
foreach ($this->headers as $id => $header) {
$tabLink = new CLink($header, '#' . $id, null, null, false);
$tabLink->setAttribute('id', 'tab_' . $id);
$headersList->addItem($tabLink);
}
$this->addItem($headersList);
$this->addItem($this->tabs);
$options = array();
if (!is_null($this->selectedTab)) {
$options['selected'] = $this->selectedTab;
}
if ($this->rememberTab) {
$options['cookie'] = array();
}
zbx_add_post_js('jQuery("#' . $this->id . '").tabs(' . zbx_jsvalue($options, true) . ').show();');
}
return parent::toString($destroy);
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:32,代码来源:class.ctabview.php
示例8: CLink
if (time() - $trigger['lastchange'] < TRIGGER_BLINK_PERIOD) {
$status->setAttribute('name', 'blink');
}
$lastchange = new CLink(zbx_date2str(S_DATE_FORMAT_YMDHMS, $trigger['lastchange']), 'events.php?triggerid=' . $trigger['triggerid']);
//.'&stime='.date('YmdHis', $trigger['lastchange']
if ($config['event_ack_enable']) {
if ($trigger['event_count']) {
$to_ack = new CCol(array(new CLink(S_ACKNOWLEDGE, 'acknow.php?triggers[]=' . $trigger['triggerid'] . '&backurl=' . $page['file'], 'on'), ' (' . $trigger['event_count'] . ')'));
} else {
$to_ack = new CCol(S_ACKNOWLEDGED, 'off');
}
} else {
$to_ack = null;
}
if ($show_events != EVENTS_OPTION_NOEVENT && !empty($trigger['events'])) {
$open_close = new CDiv(SPACE, 'filterclosed');
$open_close->setAttribute('data-switcherid', $trigger['triggerid']);
} else {
if ($show_events == EVENTS_OPTION_NOEVENT) {
$open_close = null;
} else {
$open_close = SPACE;
}
}
$severity_col = new CCol(get_severity_description($trigger['priority']), get_severity_style($trigger['priority'], $trigger['value']));
if ($show_event_col) {
$severity_col->setColSpan(2);
}
$table->addRow(array($open_close, $config['event_ack_enable'] ? $show_event_col ? null : new CCheckBox('triggers[' . $trigger['triggerid'] . ']', 'no', null, $trigger['triggerid']) : null, $severity_col, $status, $lastchange, zbx_date2age($trigger['lastchange']), $show_event_col ? SPACE : NULL, $to_ack, get_node_name_by_elid($trigger['triggerid']), $host, $tr_desc, new CLink(zbx_empty($trigger['comments']) ? S_ADD : S_SHOW, 'tr_comments.php?triggerid=' . $trigger['triggerid'])), 'even_row');
if ($show_events != EVENTS_OPTION_NOEVENT) {
$i = 1;
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:tr_status.php
示例9: array_merge
if (isset($services[$row['serviceid']])) {
$services[$row['serviceid']] = array_merge($services[$row['serviceid']], $row);
} else {
$services[$row['serviceid']] = $row;
}
if (isset($row['serviceupid'])) {
$services[$row['serviceupid']]['childs'][] = array('id' => $row['serviceid'], 'soft' => 0, 'linkid' => 0);
}
if (isset($row['servicedownid'])) {
$services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']);
}
}
$treeServ = array();
createShowServiceTree($services, $treeServ);
//return into $treeServ parametr
//permission issue
$treeServ = del_empty_nodes($treeServ);
$tree = new CTree($treeServ, array('caption' => bold(S_SERVICE), 'status' => bold(S_STATUS), 'reason' => bold(S_REASON), 'sla' => bold(S_SLA_LAST_7_DAYS), 'sla2' => bold(nbsp(S_SLA)), 'graph' => bold(S_GRAPH)));
if ($tree) {
$url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
$tab = create_hat(S_IT_SERVICES_BIG, $tree->getHTML(), null, 'hat_services', get_profile('web.srv_status.hats.hat_services.state', 1));
$tab->Show();
unset($tab);
} else {
error('Can not format Tree. Check logik structure in service links');
}
}
include_once "include/page_footer.php";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:srv_status.php
示例10: foreach
foreach ($this->data['new_operation']['opcommand_hst'] as $ohnum => $cmd) {
$this->data['new_operation']['opcommand_hst'][$ohnum]['name'] = $cmd['hostid'] > 0 ? $hosts[$cmd['hostid']]['name'] : '';
}
order_result($this->data['new_operation']['opcommand_hst'], 'name');
$groups = API::HostGroup()->get(array('groupids' => zbx_objectValues($this->data['new_operation']['opcommand_grp'], 'groupid'), 'output' => array('groupid', 'name'), 'preservekeys' => true, 'editable' => true));
$this->data['new_operation']['opcommand_grp'] = array_values($this->data['new_operation']['opcommand_grp']);
foreach ($this->data['new_operation']['opcommand_grp'] as $ognum => $cmd) {
$this->data['new_operation']['opcommand_grp'][$ognum]['name'] = $groups[$cmd['groupid']]['name'];
}
order_result($this->data['new_operation']['opcommand_grp'], 'name');
// js add commands
$jsInsert = 'addPopupValues(' . zbx_jsvalue(array('object' => 'hostid', 'values' => $this->data['new_operation']['opcommand_hst'])) . ');';
$jsInsert .= 'addPopupValues(' . zbx_jsvalue(array('object' => 'groupid', 'values' => $this->data['new_operation']['opcommand_grp'])) . ');';
zbx_add_post_js($jsInsert);
// target list
$cmdList = new CDiv($cmdList, 'objectgroup border_dotted ui-corner-all inlineblock');
$cmdList->setAttribute('id', 'opCmdList');
$newOperationsTable->addRow(array(_('Target list'), $cmdList), 'indent_top');
// type
$typeComboBox = new CComboBox('new_operation[opcommand][type]', $this->data['new_operation']['opcommand']['type'], 'javascript: showOpTypeForm();');
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_IPMI, _('IPMI'));
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT, _('Custom script'));
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_SSH, _('SSH'));
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_TELNET, _('Telnet'));
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT, _('Global script'));
$userScriptId = new CVar('new_operation[opcommand][scriptid]', $this->data['new_operation']['opcommand']['scriptid']);
$userScriptName = new CTextBox('new_operation[opcommand][script]', $this->data['new_operation']['opcommand']['script'], 32, true);
$userScriptSelect = new CButton('select_opcommand_script', _('Select'), null, 'link_menu');
$userScript = new CDiv(array($userScriptId, $userScriptName, SPACE, $userScriptSelect), 'class_opcommand_userscript inlineblock hidden');
$newOperationsTable->addRow(array(_('Type'), array($typeComboBox, SPACE, $userScript)), 'indent_bottom');
// script
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.action.edit.php
示例11: CFormList
** 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.
**/
include 'include/views/js/administration.general.triggerSeverity.js.php';
$severityTab = new CFormList('scriptsTab');
$headerDiv = new CDiv(_('Custom severity'), 'inlineblock');
$headerDiv->addStyle('width: 16.3em; margin-left: 3px; zoom:1; *display: inline;');
$severityTab->addRow(SPACE, array($headerDiv, _('Colour')));
$severityNameTB0 = new CTextBox('severity_name_0', $this->data['config']['severity_name_0']);
$severityNameTB0->addStyle('width: 15em;');
$severityNameTB0->setAttribute('maxlength', 32);
$severityColorTB0 = new CColor('severity_color_0', $this->data['config']['severity_color_0']);
$severityTab->addRow(_('Not classified'), array($severityNameTB0, SPACE, $severityColorTB0));
$severityNameTB1 = new CTextBox('severity_name_1', $this->data['config']['severity_name_1']);
$severityNameTB1->addStyle('width: 15em;');
$severityNameTB1->setAttribute('maxlength', 32);
$severityColorTB1 = new CColor('severity_color_1', $this->data['config']['severity_color_1']);
$severityTab->addRow(_('Information'), array($severityNameTB1, SPACE, $severityColorTB1));
$severityNameTB2 = new CTextBox('severity_name_2', $this->data['config']['severity_name_2']);
$severityNameTB2->addStyle('width: 15em;');
$severityNameTB2->setAttribute('maxlength', 32);
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:administration.general.triggerSeverity.edit.php
示例12: getHostInventories
// getting inventory fields to make a drop down
$inventoryFields = getHostInventories(true);
// 'true' means list should be ordered by title
$inventoryFieldsComboBox = new CComboBox('filter_field', $this->data['filterField']);
foreach ($inventoryFields as $inventoryField) {
$inventoryFieldsComboBox->addItem($inventoryField['db_field'], $inventoryField['title']);
}
$exactComboBox = new CComboBox('filter_exact', $this->data['filterExact']);
$exactComboBox->addItem('0', _('like'));
$exactComboBox->addItem('1', _('exactly'));
$filterTable->addRow(array(array(array(bold(_('Field')), SPACE, $inventoryFieldsComboBox), array($exactComboBox, new CTextBox('filter_field_value', $this->data['filterFieldValue'], 20)))), 'host-inventories');
$filter = new CSubmit('filter_set', _('Filter'));
$filter->useJQueryStyle('main');
$reset = new CSubmit('filter_rst', _('Reset'));
$reset->useJQueryStyle();
$divButtons = new CDiv(array($filter, SPACE, $reset));
$divButtons->setAttribute('style', 'padding: 4px 0px;');
$footerCol = new CCol($divButtons, 'controls');
$filterTable->addRow($footerCol);
$filterForm = new CForm('get');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addItem($filterTable);
$hostInventoryWidget->addFlicker($filterForm, CProfile::get('web.hostinventories.filter.state', 0));
$hostInventoryWidget->addHeaderRowNumber();
$table = new CTableInfo(_('No hosts found.'));
$table->setHeader(array(make_sorting_header(_('Host'), 'name', $this->data['sort'], $this->data['sortorder']), _('Group'), make_sorting_header(_('Name'), 'pr_name', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Type'), 'pr_type', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('OS'), 'pr_os', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Serial number A'), 'pr_serialno_a', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Tag'), 'pr_tag', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('MAC address A'), 'pr_macaddress_a', $this->data['sort'], $this->data['sortorder'])));
foreach ($this->data['hosts'] as $host) {
$hostGroups = array();
foreach ($host['groups'] as $group) {
$hostGroups[] = $group['name'];
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:inventory.host.list.php
示例13: _
$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']);
}
$row = new CRow(array($description, new CButton('remove', _('Remove'), 'javascript: removeDependency(\'' . $dependency['triggerid'] . '\');', 'link_menu')));
$row->setAttribute('id', 'dependency_' . $dependency['triggerid']);
$dependenciesTable->addRow($row);
}
$dependenciesDiv = new CDiv(array($dependenciesTable, new CButton('btn1', _('Add'), 'return PopUp("popup.php?' . 'dstfrm=massupdate' . '&dstact=add_dependency' . '&reference=deptrigger' . '&dstfld1=new_dependency' . '&srctbl=triggers' . '&objname=triggers' . '&srcfld1=triggerid' . '&multiselect=1' . '&with_triggers=1", 1000, 700);', 'link_menu')), 'objectgroup inlineblock border_dotted ui-corner-all');
$dependenciesDiv->setAttribute('id', 'dependencies_div');
$triggersFormList->addRow(array(_('Replace dependencies'), SPACE, new CVisibilityBox('visible[dependencies]', isset($this->data['visible']['dependencies']), 'dependencies_div', _('Original'))), $dependenciesDiv);
}
// append tabs to form
$triggersTab = new CTabView();
$triggersTab->addTab('triggersTab', _('Mass update'), $triggersFormList);
$triggersForm->addItem($triggersTab);
// append buttons to form
$triggersForm->addItem(makeFormFooter(new CSubmit('massupdate', _('Update')), new CButtonCancel(url_params(array('groupid', 'hostid', 'parent_discoveryid')))));
$triggersWidget->addItem($triggersForm);
return $triggersWidget;
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:configuration.triggers.massupdate.php
示例14: makeTriggersPopup
/**
* Generate table for dashboard triggers popup.
*
* @see make_system_status
*
* @param array $triggers
* @param array $ackParams
* @param array $actions
*
* @return CTableInfo
*/
function makeTriggersPopup(array $triggers, array $ackParams, array $actions)
{
$config = select_config();
$popupTable = new CTableInfo();
$popupTable->setAttribute('style', 'width: 400px;');
$popupTable->setHeader(array(is_show_all_nodes() ? _('Node') : null, _('Host'), _('Issue'), _('Age'), _('Info'), $config['event_ack_enable'] ? _('Ack') : null, _('Actions')));
CArrayHelper::sort($triggers, array(array('field' => 'lastchange', 'order' => ZBX_SORT_DOWN)));
foreach ($triggers as $trigger) {
// unknown triggers
$unknown = SPACE;
if ($trigger['state'] == TRIGGER_STATE_UNKNOWN) {
$unknown = new CDiv(SPACE, 'status_icon iconunknown');
$unknown->setHint($trigger['error'], '', 'on');
}
// ack
if ($config['event_ack_enable']) {
$ack = isset($trigger['event']['eventid']) ? getEventAckState($trigger['event'], true, true, $ackParams) : _('No events');
} else {
$ack = null;
}
// action
$action = isset($trigger['event']['eventid']) && isset($actions[$trigger['event']['eventid']]) ? $actions[$trigger['event']['eventid']] : _('-');
$popupTable->addRow(array(get_node_name_by_elid($trigger['triggerid']), $trigger['hosts'][0]['name'], getSeverityCell($trigger['priority'], $trigger['description']), zbx_date2age($trigger['lastchange']), $unknown, $ack, $action));
}
return $popupTable;
}
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:37,代码来源:blocks.inc.php
示例15: 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);
//.........这里部分代码省略.........
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:101,代码来源:func.inc.php
示例16: array_pop
}
array_pop($sub_menu_row);
$sub_menu_div = new CDiv($sub_menu_row);
$sub_menu_div->setAttribute('id', 'sub_' . $label);
$sub_menu_div->addAction('onmouseover', 'javascript: MMenu.submenu_mouseOver();');
$sub_menu_div->addAction('onmouseout', 'javascript: MMenu.mouseOut();');
if (isset($page['menu']) && $page['menu'] == $label) {
$menu_selected = true;
$sub_menu_div->setAttribute('style', 'display: block;');
insert_js('MMenu.def_label = ' . zbx_jsvalue($label));
} else {
$sub_menu_div->setAttribute('style', 'display: none;');
}
$menu_divs[] = $sub_menu_div;
}
$sub_menu_div = new CDiv(SPACE);
$sub_menu_div->setAttribute('id', 'sub_empty');
$sub_menu_div->setAttribute('style', 'display: ' . ($menu_selected ? 'none;' : 'block;'));
$menu_divs[] = $sub_menu_div;
$search_div = null;
if ($page['file'] != 'index.php' && CWebUser::$data['userid'] > 0) {
$searchForm = new CView('general.search');
$search_div = $searchForm->render();
}
$sub_menu_table->addRow(array($menu_divs, $search_div));
$page_menu->addItem($sub_menu_table);
$page_menu->show();
}
// create history
if (isset($page['hist_arg']) && CWebUser::$data['alias'] != ZBX_GUEST_USER && $page['type'] == PAGE_TYPE_HTML && !defined('ZBX_PAGE_NO_MENU')) {
$table = new CTable(null, 'history left');
开发者ID:hujingguang,项目名称:work,代码行数:31,代码来源:page_header.php
示例17: 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']));
//.........这里部分代码省略.........
开发者ID:itnihao,项目名称:Zabbix_,代码行数:101,代码来源:func.inc.php
示例18: CSpan
if ($inventory_mode == HOST_INVENTORY_AUTOMATIC) {
$input->setAttribute('disabled', 'disabled');
}
} else {
$populatingItemCell = '';
}
$input->addStyle('float: left;');
$populatingItem = new CSpan($populatingItemCell, 'populating_item');
if ($inventory_mode != HOST_INVENTORY_AUTOMATIC) {
// those links are visible only in automatic mode
$populatingItem->addStyle('display: none');
}
$inventoryFormList->addRow($inventoryInfo['title'], array($input, $populatingItem));
}
// clearing the float
$clearFixDiv = new CDiv();
$clearFixDiv->addStyle('clear: both;');
$inventoryFormList->addRow('', $clearFixDiv);
$divTabs->addTab('inventoryTab', _('Host inventory'), $inventoryFormList);
$frmHost->addItem($divTabs);
/*
* footer
*/
$others = array();
// do not display the clone and delete buttons for clone forms and new host forms
if (getRequest('hostid') && !in_array(getRequest('form'), array('clone', 'full_clone'))) {
$others[] = new CSubmit('clone', _('Clone'));
$others[] = new CSubmit('full_clone', _('Full clone'));
$others[] = new CButtonDelete(_('Delete selected host?'), url_param('form') . url_param('hostid') . url_param('groupid'));
}
$others[] = new CButtonCancel(url_param('groupid'));
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.host.edit.php
示例19: CRow
$trigger = '';
}
$row = new CRow(array(new CCol(S_TRIGGER, 'form_row_l'), new CCol(array(new CTextBox('trigger', $trigger, 96, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->getName() . "&dstfld1=triggerid&dstfld2=trigger" . "&srctbl=triggers&srcfld1=triggerid&srcfld2=description&real_hosts=1');", 'T')), 'form_row_r')));
$filterForm->addRow($row);
$filterForm->addVar('hide_unknown', $_REQUEST['hide_unknown']);
$unkcbx = new CCheckBox('hide_unk', $_REQUEST['hide_unknown'], null, '1');
$unkcbx->setAction('javascript: create_var("' . $filterForm->GetName() . '", "hide_unknown", (this.checked?1:0), 0); ');
$filterForm->addRow(S_HIDE_UNKNOWN, $unkcbx);
$reset = new CButton('filter_rst', S_RESET);
$reset->setType('button');
$reset->setAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();');
$filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER));
$filterForm->addItemToBottomRow($reset);
}
$events_wdgt->addFlicker($filterForm, CProfile::get('web.events.filter.state', 0));
$scroll_div = new CDiv();
$scroll_div->setAttribute('id', 'scrollbar_cntr');
$events_wdgt->addFlicker($scroll_div, CProfile::get('web.events.filter.state', 0));
// }}} FILTER
$table = new CTableInfo(S_NO_EVENTS_FOUND);
// CHECK IF EVENTS EXISTS {{{
$options = array('output' => API_OUTPUT_EXTEND, 'sortfield' => 'eventid', 'sortorder' => ZBX_SORT_UP, 'nopermissions' => 1, 'limit' => 1);
if ($source == EVENT_SOURCE_DISCOVERY) {
$options['source'] = EVENT_SOURCE_DISCOVERY;
} else {
if (isset($_REQUEST['triggerid']) &&
|
请发表评论