本文整理汇总了PHP中CJs类的典型用法代码示例。如果您正苦于以下问题:PHP CJs类的具体用法?PHP CJs怎么用?PHP CJs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CJs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: decodeJson
/**
* Decodes JSON sting.
*
* @static
*
* @param string $data
* @param bool $asArray get result as array instead of object
*
* @return mixed
*/
public static function decodeJson($data, $asArray = true)
{
if (self::$json === null) {
self::$json = new CJson();
}
return self::$json->decode($data, $asArray);
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:17,代码来源:CJs.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: __construct
public function __construct($name = 'editablecombobox', $value = null, $size = null, $action = null)
{
insert_javascript_for_editable_combobox();
parent::__construct($name, $value, $action);
parent::addAction('onfocus', 'CEditableComboBoxInit(this);');
$width = $size == ZBX_TEXTBOX_STANDARD_SIZE ? ZBX_TEXTAREA_STANDARD_WIDTH : null;
parent::addAction('onchange', 'CEditableComboBoxOnChange(this, ' . CJs::encodeJson($size) . ', ' . CJs::encodeJson($width) . ');');
// prevent Firefox remembering selected option on page refresh
$this->setAttribute('autocomplete', 'off');
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:10,代码来源:CEditableComboBox.php
示例4: doAction
protected function doAction()
{
foreach (CJs::decodeJson($this->getInput('grid')) as $col => $column) {
foreach ($column as $row => $widgetName) {
$widgetName = str_replace('_widget', '', $widgetName);
CProfile::update('web.dashboard.widget.' . $widgetName . '.col', $col, PROFILE_TYPE_INT);
CProfile::update('web.dashboard.widget.' . $widgetName . '.row', $row, PROFILE_TYPE_INT);
}
}
$data = ['main_block' => ''];
$response = new CControllerResponseData($data);
$this->setResponse($response);
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:13,代码来源:CControllerDashboardSort.php
示例5: doAction
protected function doAction()
{
$widget = $this->getInput('widget');
$data = ['main_block' => ''];
// refresh rate
if ($this->hasInput('refreshrate')) {
$refreshrate = $this->getInput('refreshrate');
CProfile::update('web.dashboard.widget.' . $widget . '.rf_rate', $refreshrate, PROFILE_TYPE_INT);
$data['main_block'] = 'PMasters["dashboard"].dolls["' . $widget . '"].frequency(' . CJs::encodeJson($refreshrate) . ');' . "\n" . 'PMasters["dashboard"].dolls["' . $widget . '"].restartDoll();';
}
// widget state
if ($this->hasInput('state')) {
CProfile::update('web.dashboard.widget.' . $widget . '.state', $this->getInput('state'), PROFILE_TYPE_INT);
}
$this->setResponse(new CControllerResponseData($data));
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:16,代码来源:CControllerDashboardWidget.php
示例6: __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
示例7: 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
示例8: toString
public function toString($destroy = true)
{
$url = $this->url;
if ($this->use_sid) {
if (array_key_exists('zbx_sessionid', $_COOKIE)) {
$url .= strpos($url, '&') !== false || strpos($url, '?') !== false ? '&' : '?';
$url .= 'sid=' . substr($_COOKIE['zbx_sessionid'], 16, 16);
}
$confirm_script = $this->confirm_message !== '' ? 'Confirm(' . CJs::encodeJson($this->confirm_message) . ') && ' : '';
$this->onClick("javascript: return " . $confirm_script . "redirect('" . $url . "', 'post', 'sid', true)");
$this->setAttribute('href', 'javascript:void(0)');
} else {
$this->setAttribute('href', $url);
if ($this->confirm_message !== '') {
$this->onClick('javascript: return Confirm(' . CJs::encodeJson($this->confirm_message) . ');');
}
}
return parent::toString($destroy);
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:19,代码来源:CLink.php
示例9: 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());
}
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:40,代码来源:CWidget.php
示例10: serialize
/**
* Encodes the data as a JSON string with HTML entities escaped.
*
* @static
*
* @param array $data
*
* @return string
*/
public static function serialize(array $data)
{
return self::encode(CJs::encodeJson($data));
}
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:13,代码来源:CHtml.php
示例11: prepareSubfilterOutput
function prepareSubfilterOutput($data, $subfilter, $subfilterName)
{
order_result($data, 'name');
$output = array();
foreach ($data as $id => $element) {
$element['name'] = nbsp(CHtml::encode($element['name']));
// is activated
if (str_in_array($id, $subfilter)) {
$span = new CSpan($element['name'] . SPACE . '(' . $element['count'] . ')', 'subfilter_enabled');
$span->onClick(CHtml::encode('javascript: create_var("zbx_filter", "subfilter_set", "1", false);' . 'create_var("zbx_filter", ' . CJs::encodeJson($subfilterName . '[' . $id . ']') . ', null, true);'));
$output[] = $span;
} else {
// subfilter has 0 items
if ($element['count'] == 0) {
$span = new CSpan($element['name'] . SPACE . '(' . $element['count'] . ')', 'subfilter_inactive');
$output[] = $span;
} else {
// this level has no active subfilters
$nspan = $subfilter ? new CSpan(SPACE . '(+' . $element['count'] . ')', 'subfilter_active') : new CSpan(SPACE . '(' . $element['count'] . ')', 'subfilter_active');
$span = new CSpan($element['name'], 'subfilter_disabled');
$span->onClick(CHtml::encode('javascript: create_var("zbx_filter", "subfilter_set", "1", false);' . 'create_var("zbx_filter", ' . CJs::encodeJson($subfilterName . '[' . $id . ']') . ', ' . CJs::encodeJson($id) . ', ' . 'true' . ');'));
$output[] = $span;
$output[] = $nspan;
}
}
$output[] = ', ';
}
array_pop($output);
return $output;
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:30,代码来源:forms.inc.php
示例12: makeErrorIcon
}
}
$errorImg = makeErrorIcon($errors);
}
// templated trigger
if ($this->data['limited']) {
// make all links inside inactive
foreach ($e['list'] as &$obj) {
if (gettype($obj) == 'object' && get_class($obj) == 'CSpan' && $obj->getAttribute('class') == ZBX_STYLE_LINK_ACTION) {
$obj->removeAttribute('class');
$obj->onClick(null);
}
}
unset($obj);
}
$expressionTable->addRow(new CRow([!$this->data['limited'] ? (new CCheckBox('expr_target_single', $e['id']))->setChecked($i == 0)->onClick('check_target(this);') : null, $e['list'], !$this->data['limited'] ? (new CCol((new CButton(null, _('Remove')))->addClass(ZBX_STYLE_BTN_LINK)->onClick('javascript:' . ' if (confirm(' . CJs::encodeJson(_('Delete expression?')) . ')) {' . ' delete_expression("' . $e['id'] . '");' . ' document.forms["' . $triggersForm->getName() . '"].submit();' . ' }')))->addClass(ZBX_STYLE_NOWRAP) : null, $errorImg]));
}
} else {
$allowedTesting = false;
$this->data['outline'] = '';
}
$testButton = (new CButton('test_expression', _('Test')))->onClick('openWinCentered("tr_testexpr.php?expression=" + encodeURIComponent(this.form.elements["expression"].value),' . '"ExpressionTest", 950, 650, "titlebar=no, resizable=yes, scrollbars=yes"); return false;')->addClass(ZBX_STYLE_BTN_LINK);
if (!$allowedTesting) {
$testButton->setAttribute('disabled', 'disabled');
}
if (empty($this->data['outline'])) {
$testButton->setAttribute('disabled', 'disabled');
}
$wrapOutline = new CSpan([$this->data['outline']]);
$triggersFormList->addRow(null, [$wrapOutline, BR(), BR(), (new CDiv([$expressionTable, $testButton]))->addClass(ZBX_STYLE_TABLE_FORMS_SEPARATOR)->setAttribute('style', 'min-width: ' . ZBX_TEXTAREA_BIG_WIDTH . 'px;')]);
$inputMethodToggle = (new CButton(null, _('Close expression constructor')))->addClass(ZBX_STYLE_BTN_LINK)->onClick('javascript: ' . 'document.getElementById("toggle_input_method").value=1;' . 'document.getElementById("input_method").value=' . IM_ESTABLISHED . ';' . 'document.forms["' . $triggersForm->getName() . '"].submit();');
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.triggers.edit.php
示例13: CCol
$buttonCol = new CCol(new CButton('addIPMIInterface', _('Add'), null, 'link_menu'), 'interface-add-control');
$col = new CCol($helpTextWhenDragInterfaceIPMI);
$col->setAttribute('colspan', 6);
$buttonRow = new CRow(array($buttonCol, $col));
$buttonRow->setAttribute('id', 'IPMIIterfacesFooter');
$ifTab->addRow($buttonRow);
$hostList->addRow(_('IPMI interfaces'), new CDiv($ifTab, 'border_dotted objectgroup inlineblock interface-group'), false, null, 'interface-row');
} else {
$interfaces = array();
$existingInterfaceTypes = array();
foreach ($dbHost['interfaces'] as $interface) {
$interface['locked'] = true;
$existingInterfaceTypes[$interface['type']] = true;
$interfaces[$interface['interfaceid']] = $interface;
}
zbx_add_post_js('hostInterfacesManager.add(' . CJs::encodeJson($interfaces) . ');');
zbx_add_post_js('hostInterfacesManager.disable()');
// table for agent interfaces with footer
$ifTab = new CTable(null, 'formElementTable');
$ifTab->setAttribute('id', 'agentInterfaces');
$ifTab->setAttribute('data-type', 'agent');
// header
$ifTab->addRow(array(new CCol(SPACE, 'interface-drag-control'), new CCol(_('IP address'), 'interface-ip'), new CCol(_('DNS name'), 'interface-dns'), new CCol(_('Connect to'), 'interface-connect-to'), new CCol(_('Port'), 'interface-port'), new CCol(_('Default'), 'interface-default'), new CCol(SPACE, 'interface-control')));
$row = new CRow(null, null, 'agentIterfacesFooter');
if (!isset($existingInterfaceTypes[INTERFACE_TYPE_AGENT])) {
$row->addItem(new CCol(null, 'interface-drag-control'));
$row->addItem(new CCol(_('No agent interfaces found.'), null, 5));
}
$ifTab->addRow($row);
$hostList->addRow(_('Agent interfaces'), new CDiv($ifTab, 'border_dotted objectgroup interface-group'), false, null, 'interface-row interface-row-first');
// table for SNMP interfaces with footer
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.host.edit.php
示例14: CPassBox
if (isset($this->data['change_bind_password']) || zbx_empty($this->data['config']['ldap_bind_password'])) {
$authenticationForm->addVar('change_bind_password', 1);
$authenticationFormList->addRow(_('Bind password'), (new CPassBox('ldap_bind_password'))->setWidth(ZBX_TEXTAREA_SMALL_WIDTH));
} else {
$authenticationFormList->addRow(_('Bind password'), (new CSubmit('change_bind_password', _('Change password')))->addClass(ZBX_STYLE_BTN_GREY));
}
$authenticationFormList->addRow(_('Test authentication'), ' [' . _('must be a valid LDAP user') . ']');
$authenticationFormList->addRow(_('Login'), $userComboBox);
$authenticationFormList->addRow(_('User password'), (new CPassBox('user_password'))->setWidth(ZBX_TEXTAREA_SMALL_WIDTH));
}
// append form list to tab
$authenticationTab = new CTabView();
$authenticationTab->addTab('authenticationTab', $this->data['title'], $authenticationFormList);
// create save button
$saveButton = new CSubmit('update', _('Update'));
if ($this->data['is_authentication_type_changed']) {
$saveButton->onClick('javascript: if (confirm(' . CJs::encodeJson(_('Switching authentication method will reset all except this session! Continue?')) . ')) {' . 'jQuery("#authenticationForm").submit(); return true; } else { return false; }');
} elseif ($this->data['config']['authentication_type'] != ZBX_AUTH_LDAP) {
$saveButton->setAttribute('disabled', 'true');
}
// append buttons to form
if ($this->data['config']['authentication_type'] == ZBX_AUTH_LDAP) {
$authenticationTab->setFooter(makeFormFooter($saveButton, [new CSubmit('test', _('Test'))]));
} else {
$authenticationTab->setFooter(makeFormFooter($saveButton));
}
// append tab to form
$authenticationForm->addItem($authenticationTab);
// append form to widget
$widget->addItem($authenticationForm);
return $widget;
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:administration.authentication.edit.php
示例15: function
macroInput = $(macroInput);
macroInput.val(macroInput.val().toUpperCase());
conditions.push({
id: macroInput.data('formulaid'),
type: macroInput.val()
});
});
$('#expression').html(getConditionFormula(conditions, +$('#evaltype').val()));
}
$('#conditions')
.dynamicRows({
template: '#condition-row',
counter: <?php
echo CJs::encodeJson($counter);
?>
,
dataCallback: function(data) {
data.formulaId = num2letter(data.rowNum);
return data;
}
})
.bind('tableupdate.dynamicRows', function(event, options) {
$('#conditionRow').toggle($(options.row, $(this)).length > 1);
})
.bind('rowremove.dynamicRows', function() {
updateExpression();
})
.on('change', '.macro', function() {
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.host.discovery.edit.js.php
示例16: dirname
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__) . '/js/adm.regexprs.edit.js.php';
zbx_add_post_js('zabbixRegExp.addExpressions(' . CJs::encodeJson(array_values($this->get('expressions'))) . ');');
$form = new CForm();
$form->attr('id', 'zabbixRegExpForm');
$form->addVar('form', 1);
$form->addVar('regexpid', $this->data['regexpid']);
/*
* Expressions tab
*/
$exprTab = new CFormList('exprTab');
$nameTextBox = new CTextBox('name', $this->get('name'), ZBX_TEXTBOX_STANDARD_SIZE, false, 128);
$nameTextBox->attr('autofocus', 'autofocus');
$exprTab->addRow(_('Name'), $nameTextBox);
$exprTable = new CTable(null, 'formElementTable formWideTable');
$exprTable->attr('id', 'exprTable');
$exprTable->setHeader(array(_('Expression'), new CCol(_('Expression type'), 'nowrap'), new CCol(_('Case sensitive'), 'nowrap'), SPACE));
$exprTable->setFooter(new CButton('add', _('Add'), null, 'link_menu exprAdd'));
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:administration.general.regularexpressions.edit.php
示例17: t
}
});
}
jQuery.when(jqxhr).done(function() {
jQuery('#add_new_dcheck').prop('disabled', false);
if (validationErrors.length) {
showModalWindow(
t(<?php
echo CJs::encodeJson(_('Discovery check error'));
?>
),
validationErrors.join('\n'),
[{text: t(<?php
echo CJs::encodeJson(_('Close'));
?>
), click: function() {
jQuery(this).dialog('destroy');
}}]
);
}
else {
dCheck.name = jQuery('#type :selected').text();
if (typeof dCheck.ports !== 'undefined' && dCheck.ports != discoveryCheckDefaultPort(dCheck.type)) {
dCheck.name += ' (' + dCheck.ports + ')';
}
if (dCheck.key_) {
dCheck.name += ' "' + dCheck.key_ + '"';
}
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.discovery.edit.js.php
示例18: function
handle: 'span.ui-icon-arrowthick-2-n-s',
revert: 'invalid',
stop: function(event, ui) {
var hostInterfaceId = jQuery(this).data('interfaceid');
resetMainInterfaces();
resetUseipInterface(hostInterfaceId)
}
});
}
function addNotDraggableIcon(domElement) {
domElement.children().first().append('<span class="ui-icon ui-icon-arrowthick-2-n-s state-disabled"></span>');
jQuery('.ui-icon', domElement).hover(
function (event) {
jQuery('<div>' + <?php
echo CJs::encodeJson(_('Interface is used by items that require this type of the interface.'));
?>
+ '</div>')
.css({position: 'absolute', opacity: 1, padding: '2px'})
.addClass('ui-state-highlight')
.appendTo(event.target.parentNode);
},
function (event) {
jQuery(event.target).next().remove();
}
)
}
function getDomElementsAttrsForInterface(hostInterface) {
var attrs = {
disabled: '',
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:configuration.host.edit.js.php
示例19: CButton
$icon = (new CButton(null))->addClass(ZBX_STYLE_BTN_WIDGET_ACTION)->setTitle(_('Action'))->setMenuPopup(CMenuPopupHelper::getRefresh($widgetid, $rate));
$dashboardGrid[$col][$row] = (new CCollapsibleUiWidget($widgetid, (new CDiv())->addClass('preloader')))->setExpanded($expanded)->setHeader($widget['header'], [$icon], true, 'zabbix.php?action=dashboard.widget')->setFooter((new CList())->setId($widgetid . '_footer'));
$widgetRefreshParams[$widgetid] = ['frequency' => $rate, 'url' => 'zabbix.php?action=' . $widget['action'], 'counter' => 0, 'darken' => 0, 'params' => ['widgetRefresh' => $widgetid]];
}
// sort dashboard grid
foreach ($dashboardGrid as $key => $val) {
ksort($dashboardGrid[$key]);
}
$dashboardRow = (new CDiv([(new CDiv($dashboardGrid[0]))->addClass('cell'), (new CDiv($dashboardGrid[1]))->addClass('cell'), (new CDiv($dashboardGrid[2]))->addClass('cell')]))->addClass('row');
$dashboardTable = (new CDiv($dashboardRow))->addClass('table')->addClass('widget-placeholder');
$dashboard->addItem($dashboardTable)->show();
/*
* Javascript
*/
// start refresh process
$this->addPostJS('initPMaster("dashboard", ' . CJs::encodeJson($widgetRefreshParams) . ');');
// activating blinking
$this->addPostJS('jqBlink.blink();');
?>
<script type="text/javascript">
/**
* @see init.js add.popup event
*/
function addPopupValues(list) {
var favourites = {graphid: 1, itemid: 1, screenid: 1, slideshowid: 1, sysmapid: 1};
if (isset(list.object, favourites)) {
var favouriteIds = [];
for (var i = 0; i < list.values.length; i++) {
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:monitoring.dashboard.view.php
示例20: zbx_empty
$dashconf['severity'] = zbx_empty($severity) ? null : explode(';', $severity);
$dashconf['severity'] = zbx_toHash($dashconf['severity']);
$config = select_config();
$dashconf['extAck'] = $config['event_ack_enable'] ? CProfile::get('web.dashconf.events.extAck', 0) : 0;
}
/*
* Actions
*/
if (isset($_REQUEST['favobj'])) {
$_REQUEST['pmasterid'] = get_request('pmasterid', 'mainpage');
if ($_REQUEST['favobj'] == 'hat') {
if ($_REQUEST['favaction'] == 'flop') {
$widgetName = substr($_REQUEST['favref'], 4);
CProfile::update('web.dashboard.widget.' . $widgetName . '.state', $_REQUEST['favstate'], PROFILE_TYPE_INT);
} elseif (getRequest('favaction') == 'sort') {
$favdata = CJs::decodeJson(getRequest('favdata'));
foreach ($favdata as $col => $column) {
foreach ($column as $row => $widgetName) {
$widgetName = substr($widgetName, 4, -7);
CProfile::update('web.dashboard.widget.' . $widgetName . '.col', $col, PROFILE_TYPE_INT);
CProfile::update('web.dashboard.widget.' . $widgetName . '.row', $row, PROFILE_TYPE_INT);
}
}
} elseif ($_REQUEST['favaction'] == 'refresh') {
switch ($_REQUEST['favref']) {
case 'hat_syssum':
$syssum = make_system_status($dashconf);
$syssum->show();
break;
case 'hat_hoststat':
$hoststat = make_hoststat_summary($dashconf);
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:dashboard.php
注:本文中的CJs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论