本文整理汇总了PHP中zbx_add_post_js函数的典型用法代码示例。如果您正苦于以下问题:PHP zbx_add_post_js函数的具体用法?PHP zbx_add_post_js怎么用?PHP zbx_add_post_js使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zbx_add_post_js函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Process screen.
*
* @return CDiv (screen inside container)
*/
public function get()
{
$this->dataId = 'graph_full';
$containerId = 'graph_container';
// time control
$graphDims = getGraphDims($this->graphid);
if ($graphDims['graphtype'] == GRAPH_TYPE_PIE || $graphDims['graphtype'] == GRAPH_TYPE_EXPLODED) {
$loadSBox = 0;
$src = 'chart6.php';
} else {
$loadSBox = 1;
$src = 'chart2.php';
}
$src .= '?graphid=' . $this->graphid . '&period=' . $this->timeline['period'] . '&stime=' . $this->timeline['stimeNow'] . $this->getProfileUrlParams();
$this->timeline['starttime'] = date(TIMESTAMP_FORMAT, get_min_itemclock_by_graphid($this->graphid));
$timeControlData = array('id' => $this->getDataId(), 'containerid' => $containerId, 'src' => $src, 'objDims' => $graphDims, 'loadSBox' => $loadSBox, 'loadImage' => 1, 'dynamic' => 1, 'periodFixed' => CProfile::get($this->profileIdx . '.timelinefixed', 1), 'sliderMaximumTimePeriod' => ZBX_MAX_PERIOD);
// output
if ($this->mode == SCREEN_MODE_JS) {
$timeControlData['dynamic'] = 0;
$timeControlData['loadSBox'] = 0;
return 'timeControl.addObject("' . $this->getDataId() . '", ' . zbx_jsvalue($this->timeline) . ', ' . zbx_jsvalue($timeControlData) . ')';
} else {
if ($this->mode == SCREEN_MODE_SLIDESHOW) {
insert_js('timeControl.addObject("' . $this->getDataId() . '", ' . zbx_jsvalue($this->timeline) . ', ' . zbx_jsvalue($timeControlData) . ');');
} else {
zbx_add_post_js('timeControl.addObject("' . $this->getDataId() . '", ' . zbx_jsvalue($this->timeline) . ', ' . zbx_jsvalue($timeControlData) . ');');
}
return $this->getOutput(new CDiv(null, 'center', $containerId), true, array('graphid' => $this->graphid));
}
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:35,代码来源:CScreenChart.php
示例2: __construct
/**
* @param array $options['objectOptions'] an array of parameters to be added to the request URL
*
* @see jQuery.multiSelect()
*/
public function __construct(array $options = [])
{
parent::__construct('div', true);
$this->addClass('multiselect');
$this->setId(zbx_formatDomId($options['name']));
// url
$url = new CUrl('jsrpc.php');
$url->setArgument('type', PAGE_TYPE_TEXT_RETURN_JSON);
$url->setArgument('method', 'multiselect.get');
$url->setArgument('objectName', $options['objectName']);
if (!empty($options['objectOptions'])) {
foreach ($options['objectOptions'] as $optionName => $optionvalue) {
$url->setArgument($optionName, $optionvalue);
}
}
$params = ['url' => $url->getUrl(), 'name' => $options['name'], 'labels' => ['No matches found' => _('No matches found'), 'More matches found...' => _('More matches found...'), 'type here to search' => _('type here to search'), 'new' => _('new'), 'Select' => _('Select')]];
if (array_key_exists('data', $options)) {
$params['data'] = zbx_cleanHashes($options['data']);
}
foreach (['ignored', 'defaultValue', 'disabled', 'selectedLimit', 'addNew'] as $option) {
if (array_key_exists($option, $options)) {
$params[$option] = $options[$option];
}
}
if (array_key_exists('popup', $options)) {
foreach (['parameters', 'width', 'height'] as $option) {
if (array_key_exists($option, $options['popup'])) {
$params['popup'][$option] = $options['popup'][$option];
}
}
}
zbx_add_post_js('jQuery("#' . $this->getAttribute('id') . '").multiSelect(' . CJs::encodeJson($params) . ');');
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:38,代码来源:CMultiSelect.php
示例3: local_generateHeader
function local_generateHeader($data)
{
// only needed for zbx_construct_menu
global $page;
header('Content-Type: text/html; charset=UTF-8');
// construct menu
$main_menu = [];
$sub_menus = [];
zbx_construct_menu($main_menu, $sub_menus, $page, $data['controller']['action']);
$pageHeader = new CView('layout.htmlpage.header', ['javascript' => ['files' => $data['javascript']['files']], 'page' => ['title' => $data['page']['title']], 'user' => ['lang' => CWebUser::$data['lang'], 'theme' => CWebUser::$data['theme']]]);
echo $pageHeader->getOutput();
if ($data['fullscreen'] == 0) {
global $ZBX_SERVER_NAME;
$pageMenu = new CView('layout.htmlpage.menu', ['server_name' => isset($ZBX_SERVER_NAME) ? $ZBX_SERVER_NAME : '', 'menu' => ['main_menu' => $main_menu, 'sub_menus' => $sub_menus, 'selected' => $page['menu']], 'user' => ['is_guest' => CWebUser::isGuest(), 'alias' => CWebUser::$data['alias'], 'name' => CWebUser::$data['name'], 'surname' => CWebUser::$data['surname']]]);
echo $pageMenu->getOutput();
}
echo '<div class="' . ZBX_STYLE_ARTICLE . '">';
// should be replaced with addPostJS() at some point
zbx_add_post_js('initMessages({});');
// if a user logs in after several unsuccessful attempts, display a warning
if ($failedAttempts = CProfile::get('web.login.attempt.failed', 0)) {
$attempt_ip = CProfile::get('web.login.attempt.ip', '');
$attempt_date = CProfile::get('web.login.attempt.clock', 0);
$error_msg = _n('%4$s failed login attempt logged. Last failed attempt was from %1$s on %2$s at %3$s.', '%4$s failed login attempts logged. Last failed attempt was from %1$s on %2$s at %3$s.', $attempt_ip, zbx_date2str(DATE_FORMAT, $attempt_date), zbx_date2str(TIME_FORMAT, $attempt_date), $failedAttempts);
error($error_msg);
CProfile::update('web.login.attempt.failed', 0, PROFILE_TYPE_INT);
}
show_messages();
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:29,代码来源:layout.htmlpage.php
示例4: 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
示例5: add_doll_objects
function add_doll_objects($ref_tab, $pmid = 'mainpage')
{
$upd_script = array();
foreach ($ref_tab as $id => $doll) {
$upd_script[$doll['id']] = format_doll_init($doll);
}
zbx_add_post_js('initPMaster(' . zbx_jsvalue($pmid) . ',' . zbx_jsvalue($upd_script) . ');');
}
开发者ID:rennhak,项目名称:zabbix,代码行数:8,代码来源:func.inc.php
示例6: useJQueryStyle
public function useJQueryStyle()
{
$this->setAttribute('class', $this->getAttribute('class') . ' jqueryinputset');
if (!defined('ZBX_JQUERY_INPUTSET')) {
define('ZBX_JQUERY_INPUTSET', true);
zbx_add_post_js('setTimeout(function() { jQuery("div.jqueryinputset").buttonset(); }, 10);');
}
return $this;
}
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:9,代码来源:class.cdiv.php
示例7: useJQueryStyle
public function useJQueryStyle($class = '')
{
$this->jQuery = true;
$this->attr('class', 'jqueryinput ' . $this->getAttribute('class') . ' ' . $class);
if (!defined('ZBX_JQUERY_INPUT')) {
define('ZBX_JQUERY_INPUT', true);
zbx_add_post_js('jQuery("input.jqueryinput").button();');
}
return $this;
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:10,代码来源:class.cinput.php
示例8: toString
public function toString($destroy = true)
{
if (!isset($this->attributes['checked'])) {
foreach ($this->object_name as $obj_name) {
if (empty($obj_name)) {
continue;
}
zbx_add_post_js('visibility_status_changeds(false, ' . zbx_jsvalue($obj_name) . ', ' . zbx_jsvalue($this->replace_to) . ');');
}
}
return parent::toString($destroy);
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:12,代码来源:CVisibilityBox.php
示例9: __construct
public function __construct(&$form, $name, $value = null, $size = 10)
{
zbx_add_post_js('if (IE7) $$("select option[disabled]").each(function(e) { e.setStyle({color: "gray"}); });');
$this->form =& $form;
$this->name = $name . '_tweenbox';
$this->varname = $name;
$this->value = zbx_toHash($value);
$this->id_l = $this->varname . '_left';
$this->id_r = $this->varname . '_right';
$this->lbox = new CListBox($this->id_l, null, $size);
$this->rbox = new CListBox($this->id_r, null, $size);
$this->lbox->setAttribute('style', 'width: 280px;');
$this->rbox->setAttribute('style', 'width: 280px;');
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:14,代码来源:class.ctweenbox.php
示例10: __construct
/**
* @param array $options['objectOptions'] an array of parameters to be added to the request URL
*
* @see jQuery.multiSelect()
*/
public function __construct(array $options = array())
{
parent::__construct('div', 'yes');
$this->addClass('multiselect');
$this->attr('id', zbx_formatDomId($options['name']));
// url
$url = new Curl('jsrpc.php');
$url->setArgument('type', PAGE_TYPE_TEXT_RETURN_JSON);
$url->setArgument('method', 'multiselect.get');
$url->setArgument('objectName', $options['objectName']);
if (!empty($options['objectOptions'])) {
foreach ($options['objectOptions'] as $optionName => $optionvalue) {
$url->setArgument($optionName, $optionvalue);
}
}
$params = array('id' => $this->getAttribute('id'), 'url' => $url->getUrl(), 'name' => $options['name'], 'labels' => array('No matches found' => _('No matches found'), 'More matches found...' => _('More matches found...'), 'type here to search' => _('type here to search'), 'new' => _('new'), 'Select' => _('Select')), 'data' => empty($options['data']) ? array() : zbx_cleanHashes($options['data']), 'ignored' => isset($options['ignored']) ? $options['ignored'] : null, 'defaultValue' => isset($options['defaultValue']) ? $options['defaultValue'] : null, 'disabled' => isset($options['disabled']) ? $options['disabled'] : false, 'selectedLimit' => isset($options['selectedLimit']) ? $options['selectedLimit'] : null, 'addNew' => isset($options['addNew']) ? $options['addNew'] : false, 'popup' => array('parameters' => isset($options['popup']['parameters']) ? $options['popup']['parameters'] : null, 'width' => isset($options['popup']['width']) ? $options['popup']['width'] : null, 'height' => isset($options['popup']['height']) ? $options['popup']['height'] : null, 'buttonClass' => isset($options['popup']['buttonClass']) ? $options['popup']['buttonClass'] : null));
zbx_add_post_js('jQuery("#' . $this->getAttribute('id') . '").multiSelect(' . CJs::encodeJson($params) . ')');
}
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:23,代码来源:class.cmultiselect.php
示例11: get
/**
* Process screen.
*
* @return CDiv (screen inside container)
*/
public function get()
{
$this->dataId = 'graph_' . $this->screenitem['screenitemid'] . '_' . $this->screenitem['screenid'];
$resourceid = !empty($this->screenitem['real_resourceid']) ? $this->screenitem['real_resourceid'] : $this->screenitem['resourceid'];
$containerid = 'graph_container_' . $this->screenitem['screenitemid'] . '_' . $this->screenitem['screenid'];
$graphDims = getGraphDims();
$graphDims['graphHeight'] = $this->screenitem['height'];
$graphDims['width'] = $this->screenitem['width'];
// get time control
$timeControlData = array('id' => $this->getDataId(), 'containerid' => $containerid, 'objDims' => $graphDims, 'loadImage' => 1, 'periodFixed' => CProfile::get('web.screens.timelinefixed', 1), 'sliderMaximumTimePeriod' => ZBX_MAX_PERIOD);
// host feature
if ($this->screenitem['dynamic'] == SCREEN_DYNAMIC_ITEM && !empty($this->hostid)) {
$newitemid = get_same_item_for_host($resourceid, $this->hostid);
$resourceid = !empty($newitemid) ? $newitemid : '';
}
if ($this->mode == SCREEN_MODE_PREVIEW && !empty($resourceid)) {
$this->action = 'history.php?action=' . HISTORY_GRAPH . '&itemids[]=' . $resourceid . '&period=' . $this->timeline['period'] . '&stime=' . $this->timeline['stimeNow'] . $this->getProfileUrlParams();
}
if ($resourceid && $this->mode != SCREEN_MODE_EDIT) {
if ($this->mode == SCREEN_MODE_PREVIEW) {
$timeControlData['loadSBox'] = 1;
}
}
$timeControlData['src'] = $resourceid ? 'chart.php?itemids[]=' . $resourceid . '&' . $this->screenitem['url'] . '&width=' . $this->screenitem['width'] . '&height=' . $this->screenitem['height'] : 'chart3.php?';
$timeControlData['src'] .= $this->mode == SCREEN_MODE_EDIT ? '&period=3600&stime=' . date(TIMESTAMP_FORMAT, time()) : '&period=' . $this->timeline['period'] . '&stime=' . $this->timeline['stimeNow'];
$timeControlData['src'] .= $this->getProfileUrlParams();
// output
if ($this->mode == SCREEN_MODE_JS) {
return 'timeControl.addObject("' . $this->getDataId() . '", ' . CJs::encodeJson($this->timeline) . ', ' . CJs::encodeJson($timeControlData) . ')';
} else {
if ($this->mode == SCREEN_MODE_SLIDESHOW) {
insert_js('timeControl.addObject("' . $this->getDataId() . '", ' . CJs::encodeJson($this->timeline) . ', ' . CJs::encodeJson($timeControlData) . ');');
} else {
zbx_add_post_js('timeControl.addObject("' . $this->getDataId() . '", ' . CJs::encodeJson($this->timeline) . ', ' . CJs::encodeJson($timeControlData) . ');');
}
if ($this->mode == SCREEN_MODE_EDIT || $this->mode == SCREEN_MODE_SLIDESHOW) {
$item = new CDiv();
} elseif ($this->mode == SCREEN_MODE_PREVIEW) {
$item = new CLink(null, 'history.php?action=' . HISTORY_GRAPH . '&itemids[]=' . $resourceid . '&period=' . $this->timeline['period'] . '&stime=' . $this->timeline['stimeNow']);
}
$item->setAttribute('id', $containerid);
return $this->getOutput($item);
}
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:49,代码来源:CScreenSimpleGraph.php
示例12: insert_show_color_picker_javascript
function insert_show_color_picker_javascript()
{
global $SHOW_COLOR_PICKER_SCRIPT_ISERTTED;
if ($SHOW_COLOR_PICKER_SCRIPT_ISERTTED) {
return;
}
$SHOW_COLOR_PICKER_SCRIPT_ISERTTED = true;
$table = '';
$table .= '<table cellspacing="0" cellpadding="1">';
$table .= '<tr>';
/* gray colors */
foreach (array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'b', 'C', 'D', 'E', 'F') as $c) {
$color = $c . $c . $c . $c . $c . $c;
$table .= '<td>' . unpack_object(new CColorCell(null, $color, 'set_color(\\\'' . $color . '\\\')')) . '</td>';
}
$table .= '</tr>';
/* other colors */
$colors = array(array('r' => 0, 'g' => 0, 'b' => 1), array('r' => 0, 'g' => 1, 'b' => 0), array('r' => 1, 'g' => 0, 'b' => 0), array('r' => 0, 'g' => 1, 'b' => 1), array('r' => 1, 'g' => 0, 'b' => 1), array('r' => 1, 'g' => 1, 'b' => 0));
$brigs = array(array(0 => '0', 1 => '3'), array(0 => '0', 1 => '4'), array(0 => '0', 1 => '5'), array(0 => '0', 1 => '6'), array(0 => '0', 1 => '7'), array(0 => '0', 1 => '8'), array(0 => '0', 1 => '9'), array(0 => '0', 1 => 'A'), array(0 => '0', 1 => 'B'), array(0 => '0', 1 => 'C'), array(0 => '0', 1 => 'D'), array(0 => '0', 1 => 'E'), array(0 => '3', 1 => 'F'), array(0 => '6', 1 => 'F'), array(0 => '9', 1 => 'F'), array(0 => 'C', 1 => 'F'));
foreach ($colors as $c) {
$table .= '<tr>';
foreach ($brigs as $br) {
$r = $br[$c['r']];
$g = $br[$c['g']];
$b = $br[$c['b']];
$color = $r . $r . $g . $g . $b . $b;
$table .= '<td>' . unpack_object(new CColorCell(null, $color, 'set_color(\\\'' . $color . '\\\')')) . '</td>';
}
$table .= '</tr>';
}
$table .= '</table>';
$cancel = '<span onclick="javascript:hide_color_picker();" class="link">' . S_CANCEL . '</span>';
$script = 'var color_picker = null;
var curr_lbl = null;
var curr_txt = null;' . "\n";
$script .= "var color_table = '" . $table . $cancel . "'\n";
insert_js($script);
print '<script type="text/javascript" src="js/color_picker.js"></script>';
zbx_add_post_js('create_color_picker();');
}
开发者ID:phedders,项目名称:zabbix,代码行数:40,代码来源:class.ccolor.php
示例13: zbx_objectValues
$applications = zbx_objectValues($item['applications'], 'name');
$applications = implode(', ', $applications);
if (empty($applications)) {
$applications = '-';
}
} else {
$applications = '-';
}
$itemTable->addRow(array(new CCheckBox('group_itemid[' . $item['itemid'] . ']', null, null, $item['itemid']), $description, $item['key_'], $item['delay'], $item['history'], in_array($item['value_type'], array(ITEM_VALUE_TYPE_STR, ITEM_VALUE_TYPE_LOG, ITEM_VALUE_TYPE_TEXT)) ? '' : $item['trends'], item_type2str($item['type']), new CCol($applications, 'wraptext'), $status));
}
// create go buttons
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('activate', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected item prototypes?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('disable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected item prototypes?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected item prototypes?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "group_itemid";');
zbx_add_post_js('chkbxRange.prefix = "' . $this->data['parent_discoveryid'] . '";');
zbx_add_post_js('cookie.prefix = "' . $this->data['parent_discoveryid'] . '";');
// append table to form
$itemForm->addItem(array($this->data['paging'], $itemTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$itemsWidget->addItem($itemForm);
return $itemsWidget;
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.item.prototype.list.php
示例14: CRow
$row = new CRow(array(SPACE, $config['event_ack_enable'] ? $ack_cb_col : null, $status, $clock, zbx_date2age($row_event['clock']), zbx_date2age($next_clock, $row_event['clock']), $config['event_ack_enable'] ? $ack : NULL, is_show_all_nodes() ? SPACE : null, $empty_col), 'odd_row');
$row->setAttribute('data-parentid', $trigger['triggerid']);
$row->addStyle('display: none;');
$table->addRow($row);
if ($i > $config['event_show_max']) {
break;
}
}
}
}
//----- GO ------
$footer = null;
if ($config['event_ack_enable']) {
$goBox = new CComboBox('go');
$goBox->addItem('bulkacknowledge', S_BULK_ACKNOWLEDGE);
// goButton name is necessary!!!
$goButton = new CButton('goButton', S_GO . ' (0)');
$goButton->setAttribute('id', 'goButton');
$show_event_col ? zbx_add_post_js('chkbxRange.pageGoName = "events";') : zbx_add_post_js('chkbxRange.pageGoName = "triggers";');
$footer = get_table_header(array($goBox, $goButton));
}
//----
$table = array($paging, $table, $paging, $footer);
$m_form->addItem($table);
$trigg_wdgt->addItem($m_form);
$trigg_wdgt->show();
zbx_add_post_js('blink.init();');
zbx_add_post_js("var switcher = new CSwitcher('{$switcherName}');");
$jsmenu = new CPUMenu(null, 170);
$jsmenu->InsertJavaScript();
include_once 'include/page_footer.php';
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:tr_status.php
示例15: insert_map_form
if (isset($_REQUEST["form"])) {
insert_map_form();
} else {
$form = new CForm();
$form->setName('frm_maps');
$numrows = new CSpan(null, 'info');
$numrows->setAttribute('name', 'numrows');
$header = get_table_header(array(S_MAPS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
show_table_header($header);
$table = new CTableInfo(S_NO_MAPS_DEFINED);
$table->SetHeader(array(new CCheckBox('all_maps', NULL, "checkAll('" . $form->getName() . "','all_maps','maps');"), make_sorting_link(S_NAME, 'sm.name'), make_sorting_link(S_WIDTH, 'sm.width'), make_sorting_link(S_HEIGHT, 'sm.height'), S_MAP));
$result = DBselect('SELECT sm.sysmapid,sm.name,sm.width,sm.height ' . ' FROM sysmaps sm' . ' WHERE ' . DBin_node('sm.sysmapid') . order_by('sm.name,sm.width,sm.height', 'sm.sysmapid'));
while ($row = DBfetch($result)) {
if (!sysmap_accessible($row["sysmapid"], PERM_READ_WRITE)) {
continue;
}
$table->AddRow(array(new CCheckBox('maps[' . $row['sysmapid'] . ']', NULL, NULL, $row['sysmapid']), new CLink($row["name"], "sysmaps.php?form=update" . "&sysmapid=" . $row["sysmapid"] . "#form", 'action'), $row["width"], $row["height"], new CLink(S_EDIT, "sysmap.php?sysmapid=" . $row["sysmapid"])));
}
//----- GO ------
$goBox = new CComboBox('go');
$goBox->addItem('delete', S_DELETE_SELECTED);
// goButton name is necessary!!!
$goButton = new CButton('goButton', S_GO . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "maps";');
$table->setFooter(new CCol(array($goBox, $goButton)));
$form->addItem($table);
$form->show();
zbx_add_post_js('insert_in_element("numrows","' . $table->getNumRows() . '");');
}
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:sysmaps.php
示例16: array
case OPERATION_TYPE_TEMPLATE_ADD:
case OPERATION_TYPE_TEMPLATE_REMOVE:
if (!isset($this->data['new_operation']['optemplate'])) {
$this->data['new_operation']['optemplate'] = array();
}
$templateList = new CTable();
$templateList->setAttribute('id', 'opTemplateList');
$templateList->addRow(new CRow(new CCol(array(new CMultiSelect(array('name' => 'discoveryTemplates', 'objectName' => 'templates', 'objectOptions' => array('editable' => true))), new CButton('add', _('Add'), 'return addDiscoveryTemplates();', 'link_menu')), null, 2), null, 'opTemplateListFooter'));
// load templates
$templateIds = isset($this->data['new_operation']['optemplate']) ? zbx_objectValues($this->data['new_operation']['optemplate'], 'templateid') : array();
if ($templateIds) {
$templates = API::Template()->get(array('templateids' => $templateIds, 'output' => array('templateid', 'name')));
order_result($templates, 'name');
$jsInsert = '';
$jsInsert .= 'addPopupValues(' . zbx_jsvalue(array('object' => 'dsc_templateid', 'values' => $templates)) . ');';
zbx_add_post_js($jsInsert);
}
$caption = OPERATION_TYPE_TEMPLATE_ADD == $this->data['new_operation']['operationtype'] ? _('Link with templates') : _('Unlink from templates');
$newOperationsTable->addRow(array($caption, new CDiv($templateList, 'objectgroup inlineblock border_dotted ui-corner-all')));
break;
}
// append operation conditions to form list
if ($this->data['eventsource'] == 0) {
if (!isset($this->data['new_operation']['opconditions'])) {
$this->data['new_operation']['opconditions'] = array();
} else {
zbx_rksort($this->data['new_operation']['opconditions']);
}
$allowed_opconditions = get_opconditions_by_eventsource($this->data['eventsource']);
$grouped_opconditions = array();
$operationConditionsTable = new CTable(_('No conditions defined.'), 'formElementTable');
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.action.edit.php
示例17: CLink
if ($hosts) {
$hosts[] = ', ';
}
$hosts[] = new CLink($host['name'], 'hosts.php?form=update&hostid=' . $host['hostid'], $style);
}
}
$lastAccess = '-';
if (isset($proxy['lastaccess'])) {
$lastAccess = $proxy['lastaccess'] == 0 ? '-' : zbx_date2age($proxy['lastaccess']);
}
$proxyTable->addRow(array(new CCheckBox('hosts[' . $proxy['proxyid'] . ']', null, null, $proxy['proxyid']), isset($proxy['host']) ? new CLink($proxy['host'], 'proxies.php?form=update&proxyid=' . $proxy['proxyid']) : '', isset($proxy['status']) && $proxy['status'] == HOST_STATUS_PROXY_ACTIVE ? _('Active') : _('Passive'), $lastAccess, isset($proxy['host']) ? count($proxy['hosts']) : '', isset($proxy['item_count']) ? $proxy['item_count'] : 0, isset($proxy['perf']) ? $proxy['perf'] : '-', new CCol(empty($hosts) ? '-' : $hosts, 'wraptext')));
}
// create go buttons
$goComboBox = new CComboBox('action');
$goOption = new CComboItem('proxy.massenable', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable hosts monitored by selected proxies?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('proxy.massdisable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable hosts monitored by selected proxies?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('proxy.massdelete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected proxies?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "hosts";');
// append table to form
$proxyForm->addItem(array($this->data['paging'], $proxyTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$proxyWidget->addItem($proxyForm);
return $proxyWidget;
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:administration.proxy.list.php
示例18: make_latest_issues
//.........这里部分代码省略.........
foreach ($triggers as $tnum => $trigger) {
// if trigger is lost (broken expression) we skip it
if (empty($trigger['hosts'])) {
unset($triggers[$tnum]);
continue;
}
$host = reset($trigger['hosts']);
$trigger['hostid'] = $host['hostid'];
$trigger['hostname'] = $host['name'];
if ($trigger['lastEvent']) {
$trigger['lastEvent']['acknowledges'] = isset($eventAcknowledges[$trigger['lastEvent']['eventid']]) ? $eventAcknowledges[$trigger['lastEvent']['eventid']]['acknowledges'] : null;
}
$triggers[$tnum] = $trigger;
}
$hostIds = zbx_objectValues($triggers, 'hostid');
// get hosts
$hosts = API::Host()->get(array('hostids' => $hostIds, 'output' => array('hostid', 'name', 'status', 'maintenance_status', 'maintenance_type', 'maintenanceid'), 'selectScreens' => API_OUTPUT_COUNT, 'preservekeys' => true));
// actions
$actions = getEventActionsStatHints($eventIds);
// ack params
$ackParams = isset($filter['screenid']) ? array('screenid' => $filter['screenid']) : array();
$config = select_config();
// indicator of sort field
if ($showSortIndicator) {
$sortDiv = new CDiv(SPACE, $filter['sortorder'] === ZBX_SORT_DOWN ? 'icon_sortdown default_cursor' : 'icon_sortup default_cursor');
$sortDiv->addStyle('float: left');
$hostHeaderDiv = new CDiv(array(_('Host'), SPACE));
$hostHeaderDiv->addStyle('float: left');
$issueHeaderDiv = new CDiv(array(_('Issue'), SPACE));
$issueHeaderDiv->addStyle('float: left');
$lastChangeHeaderDiv = new CDiv(array(_('Time'), SPACE));
$lastChangeHeaderDiv->addStyle('float: left');
}
$table = new CTableInfo(_('No events found.'));
$table->setHeader(array(is_show_all_nodes() ? _('Node') : null, $showSortIndicator && $filter['sortfield'] === 'hostname' ? array($hostHeaderDiv, $sortDiv) : _('Host'), $showSortIndicator && $filter['sortfield'] === 'priority' ? array($issueHeaderDiv, $sortDiv) : _('Issue'), $showSortIndicator && $filter['sortfield'] === 'lastchange' ? array($lastChangeHeaderDiv, $sortDiv) : _('Last change'), _('Age'), _('Info'), $config['event_ack_enable'] ? _('Ack') : null, _('Actions')));
$scripts = API::Script()->getScriptsByHosts($hostIds);
// triggers
foreach ($triggers as $trigger) {
$host = $hosts[$trigger['hostid']];
$hostName = new CSpan($host['name'], 'link_menu');
$hostName->setMenuPopup(getMenuPopupHost($host, $scripts[$host['hostid']]));
// add maintenance icon with hint if host is in maintenance
$maintenanceIcon = null;
if ($host['maintenance_status']) {
$maintenanceIcon = new CDiv(null, 'icon-maintenance-abs');
// get maintenance
$maintenances = API::Maintenance()->get(array('maintenanceids' => $host['maintenanceid'], 'output' => API_OUTPUT_EXTEND, 'limit' => 1));
if ($maintenance = reset($maintenances)) {
$hint = $maintenance['name'] . ' [' . ($host['maintenance_type'] ? _('Maintenance without data collection') : _('Maintenance with data collection')) . ']';
if (isset($maintenance['description'])) {
// double quotes mandatory
$hint .= "\n" . $maintenance['description'];
}
$maintenanceIcon->setHint($hint);
$maintenanceIcon->addClass('pointer');
}
$hostName->addClass('left-to-icon-maintenance-abs');
}
$hostDiv = new CDiv(array($hostName, $maintenanceIcon), 'maintenance-abs-cont');
// unknown triggers
$unknown = SPACE;
if ($trigger['state'] == TRIGGER_STATE_UNKNOWN) {
$unknown = new CDiv(SPACE, 'status_icon iconunknown');
$unknown->setHint($trigger['error'], '', 'on');
}
// trigger has events
if ($trigger['lastEvent']) {
// description
$description = CMacrosResolverHelper::resolveEventDescription(zbx_array_merge($trigger, array('clock' => $trigger['lastEvent']['clock'], 'ns' => $trigger['lastEvent']['ns'])));
// ack
$ack = getEventAckState($trigger['lastEvent'], empty($filter['backUrl']) ? true : $filter['backUrl'], true, $ackParams);
} else {
// description
$description = CMacrosResolverHelper::resolveEventDescription(zbx_array_merge($trigger, array('clock' => $trigger['lastchange'], 'ns' => '999999999')));
// ack
$ack = new CSpan(_('No events'), 'unknown');
}
// description
if (!zbx_empty($trigger['url'])) {
$description = new CLink($description, resolveTriggerUrl($trigger), null, null, true);
} else {
$description = new CSpan($description, 'pointer');
}
$description = new CCol($description, getSeverityStyle($trigger['priority']));
if ($trigger['lastEvent']) {
$description->setHint(make_popup_eventlist($trigger['triggerid'], $trigger['lastEvent']['eventid']), '', '', false);
}
// clock
$clock = new CLink(zbx_date2str(_('d M Y H:i:s'), $trigger['lastchange']), 'events.php?triggerid=' . $trigger['triggerid'] . '&source=0&show_unknown=1&nav_time=' . $trigger['lastchange']);
// actions
$actionHint = $trigger['lastEvent'] && isset($actions[$trigger['lastEvent']['eventid']]) ? $actions[$trigger['lastEvent']['eventid']] : SPACE;
$table->addRow(array(get_node_name_by_elid($trigger['triggerid']), $hostDiv, $description, $clock, zbx_date2age($trigger['lastchange']), $unknown, $ack, $actionHint));
}
// initialize blinking
zbx_add_post_js('jqBlink.blink();');
$script = new CJSScript(get_js("jQuery('#hat_lastiss_footer').html('" . _s('Updated: %s', zbx_date2str(_('H:i:s'))) . "')"));
$infoDiv = new CDiv(_n('%1$d of %2$d issue is shown', '%1$d of %2$d issues are shown', count($triggers), $triggersTotalCount));
$infoDiv->addStyle('text-align: right; padding-right: 3px;');
return new CDiv(array($table, $infoDiv, $script));
}
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:101,代码来源:blocks.inc.php
示例19: CForm
$discoveryWidget->addHeaderRowNumber();
// create form
$discoveryForm = new CForm();
$discoveryForm->setName('druleForm');
// create table
$discoveryTable = new CTableInfo(_('No discovery rules found.'));
$discoveryTable->setHeader(array(new CCheckBox('all_drules', null, "checkAll('" . $discoveryForm->getName() . "', 'all_drules', 'g_druleid');"), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), _('IP range'), _('Delay'), _('Checks'), _('Status')));
foreach ($data['drules'] as $drule) {
array_push($drule['description'], new CLink($drule['name'], '?form=update&druleid=' . $drule['druleid']));
$status = new CCol(new CLink(discovery_status2str($drule['status']), '?g_druleid[]=' . $drule['druleid'] . '&action=' . ($drule['status'] == DRULE_STATUS_ACTIVE ? 'drule.massdisable' : 'drule.massenable'), discovery_status2style($drule['status'])));
$discoveryTable->addRow(array(new CCheckBox('g_druleid[' . $drule['druleid'] . ']', null, null, $drule['druleid']), $drule['description'], $drule['iprange'], $drule['delay'], !empty($drule['checks']) ? implode(', ', $drule['checks']) : '', $status));
}
// create go buttons
$goComboBox = new CComboBox('action');
$goOption = new CComboItem('drule.massenable', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected discovery rules?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('drule.massdisable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected discovery rules?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('drule.massdelete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected discovery rules?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "g_druleid";');
// append table to form
$discoveryForm->addItem(array($this->data['paging'], $discoveryTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$discoveryWidget->addItem($discoveryForm);
return $discoveryWidget;
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:configuration.discovery.list.php
示例20: insertScreenCleanJs
/**
* Insert javascript to clean all screen items.
*
* @static
*/
public static function insertScreenCleanJs()
{
zbx_add_post_js('window.flickerfreeScreen.cleanAll();');
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:9,代码来源:CScreenBuilder.php
注:本文中的zbx_add_post_js函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论