本文整理汇总了PHP中CView类的典型用法代码示例。如果您正苦于以下问题:PHP CView类的具体用法?PHP CView怎么用?PHP CView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: refund
/**
* 响应生成refund
*/
public function refund()
{
$r = $this->input->get('r');
//响应列表页
if ($r == 'index') {
CView::show('admin/pay/refund');
return;
}
//生成退款订单
if ($r == 'gen') {
$return = $this->_modelPay->newRefund();
$repArr = array(0, 'successful');
if ($return <= 0) {
$repArr = array(1000, 'fail');
}
CAjax::show($repArr[0], $repArr[1]);
}
//退款列表
if ($r == 'list') {
$criteria = $this->input->get();
$page = (int) $this->input->get('page');
$rows = (int) $this->input->get('rows');
$list = $this->_modelPay->refunds($page, $rows, $criteria);
echo json_encode($list);
}
//执行退款
if ($r == 'do') {
$id = $this->input->post('id');
$return = $this->_modelPay->doRefund($id);
CAjax::show(0, 'successful');
}
}
开发者ID:shreksrg,项目名称:microHR,代码行数:35,代码来源:payman.php
示例2: regMajor
/**
* 注册院校专业
*/
protected function regMajor()
{
if (REQUEST_METHOD == 'POST') {
$academy = $this->input->post('academy', true);
$major = $this->input->post('major', true);
$this->setSession('academy', $academy);
$this->setSession('major', $major);
//保存注册
$return = $this->regSave();
CAjax::result($return);
} else {
CView::show('register/reg_gender');
}
}
开发者ID:shreksrg,项目名称:microHR,代码行数:17,代码来源:Register.php
示例3: index
public function index()
{
if (REQUEST_METHOD == 'POST') {
$return = $this->login();
//用户登录
$repArr = array(-1, 'fail');
if ($return === true) {
$repArr = array(0, 'successful');
}
CAjax::show($repArr[0], $repArr[1]);
} else {
CView::show('admin/login');
}
}
开发者ID:shreksrg,项目名称:microHR,代码行数:14,代码来源:loginman.php
示例4: append
/**
* 新增故事
*/
public function append()
{
if (REQUEST_METHOD == 'POST') {
$content = $this->input->post('content');
if (strlen($content) <= 0) {
return false;
}
$return = $this->_modelStory->append($this->_user->id, $content);
$show['view'] = 'message/error';
$show['message'] = array('code' => -1, 'content' => '故事提交失败');
if ($return === true) {
$show['view'] = 'message/info';
$show['message'] = array('code' => 0, 'content' => '故事提交成功');
}
CView::show($show['view'], $show['message']);
} else {
CView::show('story/form');
}
}
开发者ID:shreksrg,项目名称:microHR,代码行数:22,代码来源:Stories.php
示例5: edit
/**
* 编辑订单
*/
public function edit()
{
if (REQUEST_METHOD == 'POST') {
$data = $this->input->post();
// 表单输入验证
/*$validator = $this->validateForm();
if ($validator->run() == false)
CAjax::show('1000', '表单输入值不合法,请检查');*/
$reVal = $this->_modelOrder->editOrder($data);
$repArr = array('0', 'successful');
if ($reVal !== true) {
$repArr = array('1001', 'fail');
}
CAjax::show($repArr[0], $repArr[1]);
} else {
$id = $this->input->get('id');
$data['order'] = $this->_modelOrder->getOrder($id);
CView::show('admin/order/edit', $data);
}
}
开发者ID:shreksrg,项目名称:microHR,代码行数:23,代码来源:orderman.php
示例6: DBend
$result = DBend($result);
if ($page['type'] == PAGE_TYPE_JS && $result) {
echo 'switchElementClass("addrm_fav", "iconminus", "iconplus");';
}
}
}
if (!empty($_REQUEST['period']) || !empty($_REQUEST['stime'])) {
CScreenBase::calculateTime(array('profileIdx' => 'web.screens', 'profileIdx2' => $pageFilter->graphid, 'updateProfile' => true, 'period' => getRequest('period'), 'stime' => getRequest('stime')));
$curl = new CUrl();
$curl->removeArgument('period');
$curl->removeArgument('stime');
ob_end_clean();
DBstart();
CProfile::flush();
DBend();
redirect($curl->getUrl());
}
ob_end_flush();
if ($page['type'] == PAGE_TYPE_JS || $page['type'] == PAGE_TYPE_HTML_BLOCK) {
require_once dirname(__FILE__) . '/include/page_footer.php';
exit;
}
/*
* Display
*/
$data = array('pageFilter' => $pageFilter, 'graphid' => $pageFilter->graphid, 'fullscreen' => $_REQUEST['fullscreen']);
// render view
$chartsView = new CView('monitoring.charts', $data);
$chartsView->render();
$chartsView->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:charts.php
示例7: access_deny
$trigger = API::Trigger()->get(['triggerids' => $_REQUEST['triggerid'], 'output' => API_OUTPUT_EXTEND, 'expandDescription' => true]);
if (!$trigger) {
access_deny();
}
$trigger = reset($trigger);
/*
* Actions
*/
if (hasRequest('update')) {
DBstart();
$result = DBexecute('UPDATE triggers' . ' SET comments=' . zbx_dbstr(getRequest('comments')) . ' WHERE triggerid=' . zbx_dbstr(getRequest('triggerid')));
$trigger['comments'] = $_REQUEST['comments'];
if ($result) {
add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_TRIGGER, _('Trigger') . ' [' . $_REQUEST['triggerid'] . '] [' . $trigger['description'] . '] ' . _('Comments') . ' [' . $_REQUEST['comments'] . ']');
}
$result = DBend($result);
show_messages($result, _('Description updated'), _('Cannot update description'));
} elseif (isset($_REQUEST['cancel'])) {
jsRedirect('tr_status.php');
exit;
}
/*
* Display
*/
$triggerEditable = API::Trigger()->get(['triggerids' => $_REQUEST['triggerid'], 'output' => ['triggerid'], 'editable' => true]);
$data = ['triggerid' => getRequest('triggerid'), 'trigger' => $trigger, 'isTriggerEditable' => !empty($triggerEditable), 'isCommentExist' => !empty($trigger['comments'])];
// render view
$triggerCommentView = new CView('monitoring.triggerComment', $data);
$triggerCommentView->render();
$triggerCommentView->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:tr_comments.php
示例8: clearCookies
clearCookies($goResult, $_REQUEST['hostid']);
}
/*
* Display
*/
if (isset($_REQUEST['form'])) {
$data = getItemFormData(array('is_discovery_rule' => true));
$data['page_header'] = _('CONFIGURATION OF DISCOVERY RULES');
// render view
$itemView = new CView('configuration.item.edit', $data);
$itemView->render();
$itemView->show();
} else {
$data = array('hostid' => get_request('hostid', 0), 'host' => $host, 'showErrorColumn' => $host['status'] != HOST_STATUS_TEMPLATE);
$sortfield = getPageSortField('name');
// discoveries
$data['discoveries'] = API::DiscoveryRule()->get(array('hostids' => $data['hostid'], 'output' => API_OUTPUT_EXTEND, 'editable' => true, 'selectItems' => API_OUTPUT_COUNT, 'selectGraphs' => API_OUTPUT_COUNT, 'selectTriggers' => API_OUTPUT_COUNT, 'selectHostPrototypes' => API_OUTPUT_COUNT, 'sortfield' => $sortfield, 'limit' => $config['search_limit'] + 1));
$data['discoveries'] = CMacrosResolverHelper::resolveItemNames($data['discoveries']);
if ($sortfield === 'status') {
orderItemsByStatus($data['discoveries'], getPageSortOrder());
} else {
order_result($data['discoveries'], $sortfield, getPageSortOrder());
}
// paging
$data['paging'] = getPagingLine($data['discoveries'], array('itemid'), array('hostid' => get_request('hostid')));
// render view
$discoveryView = new CView('configuration.host.discovery.list', $data);
$discoveryView->render();
$discoveryView->show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:host_discovery.php
示例9: array
$data = array();
$data['form_refresh'] = get_request('form_refresh', 0);
// form has been submitted
if ($data['form_refresh']) {
$data['ok_period'] = get_request('ok_period');
$data['blink_period'] = get_request('blink_period');
$data['problem_unack_color'] = get_request('problem_unack_color');
$data['problem_ack_color'] = get_request('problem_ack_color');
$data['ok_unack_color'] = get_request('ok_unack_color');
$data['ok_ack_color'] = get_request('ok_ack_color');
$data['problem_unack_style'] = get_request('problem_unack_style');
$data['problem_ack_style'] = get_request('problem_ack_style');
$data['ok_unack_style'] = get_request('ok_unack_style');
$data['ok_ack_style'] = get_request('ok_ack_style');
} else {
$config = select_config(false);
$data['ok_period'] = $config['ok_period'];
$data['blink_period'] = $config['blink_period'];
$data['problem_unack_color'] = $config['problem_unack_color'];
$data['problem_ack_color'] = $config['problem_ack_color'];
$data['ok_unack_color'] = $config['ok_unack_color'];
$data['ok_ack_color'] = $config['ok_ack_color'];
$data['problem_unack_style'] = $config['problem_unack_style'];
$data['problem_ack_style'] = $config['problem_ack_style'];
$data['ok_unack_style'] = $config['ok_unack_style'];
$data['ok_ack_style'] = $config['ok_ack_style'];
}
$triggerDisplayingForm = new CView('administration.general.triggerDisplayOptions.edit', $data);
$cnf_wdgt->addItem($triggerDisplayingForm->render());
$cnf_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:adm.triggerdisplayoptions.php
示例10:
<?php
/**
* $Id$
*
* @package Mediboard
* @subpackage system
* @author SARL OpenXtrem <[email protected]>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CCanDo::checkRead();
$date = CValue::getOrSession("date", CMbDT::date());
$user_id = CValue::getOrSession("user_id");
$interval = CValue::getOrSession("interval", "one-day");
CView::enforceSlave();
CAppUI::requireModuleFile("dPstats", "graph_userlog");
$to = CMbDT::date("+1 DAY", $date);
switch ($interval) {
case "one-day":
$from = CMbDT::date("-1 DAY", $to);
break;
case "one-week":
$from = CMbDT::date("-1 WEEK", $to);
break;
case "height-weeks":
$from = CMbDT::date("-8 WEEK", $to);
break;
case "one-year":
$from = CMbDT::date("-1 YEAR", $to);
break;
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:vw_user_logs.php
示例11: dirname
<?php
/*
** Zabbix
** Copyright (C) 2001-2013 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/gettextwrapper.inc.php';
require_once dirname(__FILE__) . '/include/func.inc.php';
require_once dirname(__FILE__) . '/include/defines.inc.php';
require_once dirname(__FILE__) . '/include/classes/class.cview.php';
$browserWarningForm = new CView('general.browserwarning');
$browserWarningForm->render();
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:26,代码来源:browserwarning.php
示例12: or
| 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. |
+-------------------------------------------------------------------------+
*/
session_start();
require_once "core/global.inc.php";
// Initialise model and view
$dbSql = null;
$view = new CView();
try {
$dbSql = new Bweb($view);
} catch (Exception $e) {
CErrorHandler::displayError($e);
}
// Installed PDO drivers
$pdo_drivers = PDO::getAvailableDrivers();
// Check result icon
//$icon_result = array( true => 'ok.png', false => 'error.png');
$icon_result = array(true => 'glyphicon-ok', false => 'glyphicon-remove');
// Checks list
$check_list = array(array('check_cmd' => 'php-gettext', 'check_label' => 'PHP - Gettext support', 'check_descr' => 'If you want Bacula-web in your language, please compile PHP with Gettext support'), array('check_cmd' => 'php-session', 'check_label' => 'PHP - Session support', 'check_descr' => 'PHP session support is required'), array('check_cmd' => 'php-gd', 'check_label' => 'PHP - GD support', 'check_descr' => 'This is required by phplot, please compile PHP with GD support'), array('check_cmd' => 'php-mysql', 'check_label' => 'PHP - MySQL support', 'check_descr' => 'PHP MySQL support must be installed in order to run bacula-web with MySQL bacula catalog'), array('check_cmd' => 'php-postgres', 'check_label' => 'PHP - PostgreSQL support', 'check_descr' => 'PHP PostgreSQL support must be installed in order to run bacula-web with PostgreSQL bacula catalog'), array('check_cmd' => 'php-sqlite', 'check_label' => 'PHP - SQLite support', 'check_descr' => 'PHP SQLite support musts be installed in order to run bacula-web with SQLite bacula catalog'), array('check_cmd' => 'php-pdo', 'check_label' => 'PHP - PDO support', 'check_descr' => 'PHP PDO support is required, please compile PHP with this option'), array('check_cmd' => 'db-connection', 'check_label' => 'Database connection status (MySQL and postgreSQL only)', 'check_descr' => 'Current status: ' . CDBUtils::getConnectionStatus($dbSql->db_link)), array('check_cmd' => 'smarty-cache', 'check_label' => 'Smarty cache folder write permission', 'check_descr' => realpath(VIEW_CACHE_DIR) . ' must be writable by Apache'), array('check_cmd' => 'php-version', 'check_label' => 'PHP version', 'check_descr' => 'PHP version must be at least 5.3 (current version = ' . PHP_VERSION . ')'), array('check_cmd' => 'php-timezone', 'check_label' => 'PHP timezone', 'check_descr' => 'Timezone must be configured in php.ini (current timezone = ' . ini_get('date.timezone') . ')'));
// Doing all checks
foreach ($check_list as &$check) {
switch ($check['check_cmd']) {
开发者ID:ektich,项目名称:bacula-web,代码行数:31,代码来源:test.php
示例13: show
/**
* Process screen with particular screen objects.
*
* @return CTable
*/
public function show()
{
if (empty($this->screen)) {
return new CTableInfo(_('No screens defined.'));
}
$skipedFields = array();
$screenitems = array();
$emptyScreenColumns = array();
// calculate table columns and rows
foreach ($this->screen['screenitems'] as $screenitem) {
$screenitems[] = $screenitem;
for ($i = 0; $i < $screenitem['rowspan'] || $i == 0; $i++) {
for ($j = 0; $j < $screenitem['colspan'] || $j == 0; $j++) {
if ($i != 0 || $j != 0) {
if (!isset($skipedFields[$screenitem['y'] + $i])) {
$skipedFields[$screenitem['y'] + $i] = array();
}
$skipedFields[$screenitem['y'] + $i][$screenitem['x'] + $j] = 1;
}
}
}
}
// create screen table
$screenTable = new CTable();
$screenTable->setAttribute('class', in_array($this->mode, array(SCREEN_MODE_PREVIEW, SCREEN_MODE_SLIDESHOW)) ? 'screen_view' : 'screen_edit');
$screenTable->setAttribute('id', 'iframe');
// action top row
if ($this->mode == SCREEN_MODE_EDIT) {
$newColumns = array(new CCol(new CImg('images/general/zero.png', 'zero', 1, 1)));
for ($i = 0, $size = $this->screen['hsize'] + 1; $i < $size; $i++) {
$icon = new CImg('images/general/plus.png', null, null, null, 'pointer');
$icon->addAction('onclick', 'javascript: location.href = "screenedit.php?config=1&screenid=' . $this->screen['screenid'] . '&add_col=' . $i . '";');
array_push($newColumns, new CCol($icon));
}
$screenTable->addRow($newColumns);
}
for ($r = 0; $r < $this->screen['vsize']; $r++) {
$newColumns = array();
$emptyScreenRow = true;
// action left cell
if ($this->mode == SCREEN_MODE_EDIT) {
$icon = new CImg('images/general/plus.png', null, null, null, 'pointer');
$icon->addAction('onclick', 'javascript: location.href = "screenedit.php?config=1&screenid=' . $this->screen['screenid'] . '&add_row=' . $r . '";');
array_push($newColumns, new CCol($icon));
}
for ($c = 0; $c < $this->screen['hsize']; $c++) {
if (isset($skipedFields[$r][$c])) {
continue;
}
// screen item
$isEditForm = false;
$screenitem = array();
foreach ($screenitems as $tmprow) {
if ($tmprow['x'] == $c && $tmprow['y'] == $r) {
$screenitem = $tmprow;
break;
}
}
if (empty($screenitem)) {
$screenitem = array('screenitemid' => 0, 'resourcetype' => 0, 'resourceid' => 0, 'width' => 0, 'height' => 0, 'colspan' => 1, 'rowspan' => 1, 'elements' => 0, 'valign' => VALIGN_DEFAULT, 'halign' => HALIGN_DEFAULT, 'style' => 0, 'url' => '', 'dynamic' => 0, 'sort_triggers' => SCREEN_SORT_TRIGGERS_DATE_DESC);
}
if (!empty($screenitem['screenitemid'])) {
$emptyScreenRow = false;
$emptyScreenColumns[$c] = 1;
}
// action
if ($this->mode == SCREEN_MODE_EDIT && $screenitem['screenitemid'] != 0) {
$action = 'screenedit.php?form=update' . url_param('screenid') . '&screenitemid=' . $screenitem['screenitemid'];
} elseif ($this->mode == SCREEN_MODE_EDIT && $screenitem['screenitemid'] == 0) {
$action = 'screenedit.php?form=update' . url_param('screenid') . '&x=' . $c . '&y=' . $r;
} else {
$action = null;
}
// edit form cell
if ($this->mode == SCREEN_MODE_EDIT && (isset($_REQUEST['form']) && $_REQUEST['form'] == 'update') && (isset($_REQUEST['x']) && $_REQUEST['x'] == $c && isset($_REQUEST['y']) && $_REQUEST['y'] == $r || isset($_REQUEST['screenitemid']) && bccomp($_REQUEST['screenitemid'], $screenitem['screenitemid']) == 0)) {
$screenView = new CView('configuration.screen.constructor.edit', array('screen' => $this->screen));
$item = $screenView->render();
$isEditForm = true;
} elseif (!empty($screenitem['screenitemid']) && isset($screenitem['resourcetype'])) {
$screenBase = CScreenBuilder::getScreen(array('isFlickerfree' => $this->isFlickerfree, 'pageFile' => $this->pageFile, 'mode' => $this->mode, 'timestamp' => $this->timestamp, 'hostid' => $this->hostid, 'profileIdx' => $this->profileIdx, 'profileIdx2' => $this->profileIdx2, 'updateProfile' => $this->updateProfile, 'timeline' => $this->timeline, 'resourcetype' => $screenitem['resourcetype'], 'screenitem' => $screenitem));
if (!empty($screenBase)) {
if ($this->mode == SCREEN_MODE_EDIT && !empty($screenitem['screenitemid'])) {
$screenBase->action = 'screenedit.php?form=update' . url_param('screenid') . '&screenitemid=' . $screenitem['screenitemid'];
} elseif ($this->mode == SCREEN_MODE_EDIT && empty($screenitem['screenitemid'])) {
$screenBase->action = 'screenedit.php?form=update' . url_param('screenid') . '&x=' . $c . '&y=' . $r;
}
$item = $screenBase->get();
} else {
$item = null;
}
} else {
$item = array(SPACE);
if ($this->mode == SCREEN_MODE_EDIT) {
array_push($item, BR(), new CLink(_('Change'), $action, 'empty_change_link'));
}
//.........这里部分代码省略.........
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:101,代码来源:CScreenBuilder.php
示例14: array
$options['groupids'] = $config['dropdown_first_entry'] ? null : array();
}
$data['maintenances'] = API::Maintenance()->get($options);
order_result($data['maintenances'], $sortfield, $sortorder);
$data['paging'] = getPagingLine($data['maintenances'], array('maintenanceid'));
// get list of maintenances
$data['maintenances'] = API::Maintenance()->get(array('maintenanceids' => zbx_objectValues($data['maintenances'], 'maintenanceid'), 'output' => API_OUTPUT_EXTEND));
foreach ($data['maintenances'] as $number => $maintenance) {
if ($maintenance['active_till'] < time()) {
$data['maintenances'][$number]['status'] = MAINTENANCE_STATUS_EXPIRED;
} elseif ($maintenance['active_since'] > time()) {
$data['maintenances'][$number]['status'] = MAINTENANCE_STATUS_APPROACH;
} else {
$data['maintenances'][$number]['status'] = MAINTENANCE_STATUS_ACTIVE;
}
}
order_result($data['maintenances'], $sortfield, $sortorder);
$data['pageFilter'] = $pageFilter;
// nodes
if ($data['displayNodes']) {
foreach ($data['maintenances'] as &$maintenance) {
$maintenance['nodename'] = get_node_name_by_elid($maintenance['maintenanceid'], true);
}
unset($maintenance);
}
// render view
$maintenanceView = new CView('configuration.maintenance.list', $data);
$maintenanceView->render();
$maintenanceView->show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:maintenance.php
示例15: CComboBox
$cmbConf = new CComboBox('configDropDown', 'adm.housekeeper.php', 'redirect(this.options[this.selectedIndex].value);');
$cmbConf->addItems(array('adm.gui.php' => _('GUI'), 'adm.housekeeper.php' => _('Housekeeping'), 'adm.images.php' => _('Images'), 'adm.iconmapping.php' => _('Icon mapping'), 'adm.regexps.php' => _('Regular expressions'), 'adm.macros.php' => _('Macros'), 'adm.valuemapping.php' => _('Value mapping'), 'adm.workingtime.php' => _('Working time'), 'adm.triggerseverities.php' => _('Trigger severities'), 'adm.triggerdisplayoptions.php' => _('Trigger displaying options'), 'adm.other.php' => _('Other')));
$form->addItem($cmbConf);
$cnf_wdgt = new CWidget(null, 'hk');
$cnf_wdgt->addPageHeader(_('CONFIGURATION OF HOUSEKEEPING'), $form);
$data['form_refresh'] = getRequest('form_refresh', 0);
if ($data['form_refresh']) {
$data['config']['hk_events_mode'] = getRequest('hk_events_mode');
$data['config']['hk_events_trigger'] = isset($_REQUEST['hk_events_trigger']) ? getRequest('hk_events_trigger') : $data['config']['hk_events_trigger'];
$data['config']['hk_events_internal'] = isset($_REQUEST['hk_events_internal']) ? getRequest('hk_events_internal') : $data['config']['hk_events_internal'];
$data['config']['hk_events_discovery'] = isset($_REQUEST['hk_events_discovery']) ? getRequest('hk_events_discovery') : $data['config']['hk_events_discovery'];
$data['config']['hk_events_autoreg'] = isset($_REQUEST['hk_events_autoreg']) ? getRequest('hk_events_autoreg') : $data['config']['hk_events_autoreg'];
$data['config']['hk_services_mode'] = getRequest('hk_services_mode');
$data['config']['hk_services'] = isset($_REQUEST['hk_services']) ? getRequest('hk_services') : $data['config']['hk_services'];
$data['config']['hk_audit_mode'] = getRequest('hk_audit_mode');
$data['config']['hk_audit'] = isset($_REQUEST['hk_audit']) ? getRequest('hk_audit') : $data['config']['hk_audit'];
$data['config']['hk_sessions_mode'] = getRequest('hk_sessions_mode');
$data['config']['hk_sessions'] = isset($_REQUEST['hk_sessions']) ? getRequest('hk_sessions') : $data['config']['hk_sessions'];
$data['config']['hk_history_mode'] = getRequest('hk_history_mode');
$data['config']['hk_history_global'] = getRequest('hk_history_global');
$data['config']['hk_history'] = isset($_REQUEST['hk_history']) ? getRequest('hk_history') : $data['config']['hk_history'];
$data['config']['hk_trends_mode'] = getRequest('hk_trends_mode');
$data['config']['hk_trends_global'] = getRequest('hk_trends_global');
$data['config']['hk_trends'] = isset($_REQUEST['hk_trends']) ? getRequest('hk_trends') : $data['config']['hk_trends'];
} else {
$data['config'] = select_config(false);
}
$houseKeeperForm = new CView('administration.general.housekeeper.edit', $data);
$cnf_wdgt->addItem($houseKeeperForm->render());
$cnf_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:adm.housekeeper.php
示例16: _
$messageFailed = _('Cannot change authentication method to HTTP');
DBstart();
$result = update_config($config);
if ($result) {
// reset all sessions
if ($isAuthenticationTypeChanged) {
$result &= DBexecute('UPDATE sessions SET status=' . ZBX_SESSION_PASSIVE . ' WHERE sessionid<>' . zbx_dbstr(CWebUser::$data['sessionid']));
}
$isAuthenticationTypeChanged = false;
add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_ZABBIX_CONFIG, $messageSuccess);
}
$result = DBend($result);
show_messages($result, $messageSuccess, $messageFailed);
}
}
show_messages();
/*
* Display
*/
$data = array('form_refresh' => getRequest('form_refresh'), 'config' => $config, 'is_authentication_type_changed' => $isAuthenticationTypeChanged, 'user' => getRequest('user', CWebUser::$data['alias']), 'user_password' => getRequest('user_password', ''), 'user_list' => null, 'change_bind_password' => getRequest('change_bind_password'));
// get tab title
$data['title'] = authentication2str($config['authentication_type']);
// get user list
if (getUserGuiAccess(CWebUser::$data['userid']) == GROUP_GUI_ACCESS_INTERNAL) {
$data['user_list'] = DBfetchArray(DBselect('SELECT u.alias,u.userid FROM users u ORDER BY u.alias'));
}
// render view
$authenticationView = new CView('administration.authentication.edit', $data);
$authenticationView->render();
$authenticationView->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:authentication.php
示例17: dirname
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
$page['title'] = _('Configuration of trigger displaying options');
$page['file'] = 'adm.triggerdisplayoptions.php';
require_once dirname(__FILE__) . '/include/page_header.php';
$fields = ['problem_unack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Unacknowledged PROBLEM events')], 'problem_ack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Acknowledged PROBLEM events')], 'ok_unack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Unacknowledged OK events')], 'ok_ack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Acknowledged OK events')], 'problem_unack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'problem_ack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_unack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_ack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_period' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 999999), 'isset({update})', _('Display OK triggers for')], 'blink_period' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 999999), 'isset({update})', _('On status change triggers blink for')], 'update' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'form_refresh' => [T_ZBX_INT, O_OPT, null, null, null]];
check_fields($fields);
/*
* Actions
*/
if (hasRequest('update')) {
DBstart();
$result = update_config(['problem_unack_color' => getRequest('problem_unack_color'), 'problem_ack_color' => getRequest('problem_ack_color'), 'ok_unack_color' => getRequest('ok_unack_color'), 'ok_ack_color' => getRequest('ok_ack_color'), 'problem_unack_style' => getRequest('problem_unack_style', 0), 'problem_ack_style' => getRequest('problem_ack_style', 0), 'ok_unack_style' => getRequest('ok_unack_style', 0), 'ok_ack_style' => getRequest('ok_ack_style', 0), 'ok_period' => getRequest('ok_period'), 'blink_period' => getRequest('blink_period')]);
$result = DBend($result);
show_messages($result, _('Configuration updated'), _('Cannot update configuration'));
}
/*
* Display
*/
$config = select_config();
// form has been submitted
if (hasRequest('form_refresh')) {
$data = ['problem_unack_color' => getRequest('problem_unack_color', $config['problem_unack_color']), 'problem_ack_color' => getRequest('problem_ack_color', $config['problem_ack_color']), 'ok_unack_color' => getRequest('ok_unack_color', $config['ok_unack_color']), 'ok_ack_color' => getRequest('ok_ack_color', $config['ok_ack_color']), 'problem_unack_style' => getRequest('problem_unack_style', 0), 'problem_ack_style' => getRequest('problem_ack_style', 0), 'ok_unack_style' => getRequest('ok_unack_style', 0), 'ok_ack_style' => getRequest('ok_ack_style', 0), 'ok_period' => getRequest('ok_period', $config['ok_period']), 'blink_period' => getRequest('blink_period', $config['blink_period'])];
} else {
$data = ['problem_unack_color' => $config['problem_unack_color'], 'problem_ack_color' => $config['problem_ack_color'], 'ok_unack_color' => $config['ok_unack_color'], 'ok_ack_color' => $config['ok_ack_color'], 'problem_unack_style' => $config['problem_unack_style'], 'problem_ack_style' => $config['problem_ack_style'], 'ok_unack_style' => $config['ok_unack_style'], 'ok_ack_style' => $config['ok_ack_style'], 'ok_period' => $config['ok_period'], 'blink_period' => $config['blink_period']];
}
$view = new CView('administration.general.trigger.options.edit', $data);
$view->render();
$view->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:adm.triggerdisplayoptions.php
示例18: showErrorsView
/**
* CMyFrame 默认错误呈现
*/
public static function showErrorsView()
{
//调试配置项
$debug = CConfig::getInstance()->load('DEBUG');
//调试模式
if (true == $debug) {
//获取视图对象
$view = CView::factory('smarty');
//克隆视图对象
$pluginView = clone $view;
$pluginView->template_dir = FRAME_PATH . '/exception/';
//错误记录
$categoryError = self::_categoryError();
if (empty($categoryError)) {
return false;
}
//加载文件
$includeFiles = get_included_files();
$pluginView->assign('errorloadfile', $includeFiles);
$pluginView->assign('error', $categoryError);
$pluginView->display('CErrorView.html');
}
}
开发者ID:seiven,项目名称:ACEAdminForMyframework,代码行数:26,代码来源:CException.php
示例19: dirname
require_once dirname(__FILE__) . '/include/forms.inc.php';
$page['title'] = _('Scripts');
$page['file'] = 'scripts_exec.php';
define('ZBX_PAGE_NO_MENU', 1);
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = array('hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({execute})'), 'scriptid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({execute})'), 'execute' => array(T_ZBX_INT, O_OPT, P_ACT, IN('0,1'), null));
check_fields($fields);
if (isset($_REQUEST['execute'])) {
$scriptid = get_request('scriptid');
$hostid = get_request('hostid');
$data = array('message' => '', 'info' => DBfetch(DBselect('SELECT s.name FROM scripts s WHERE s.scriptid=' . zbx_dbstr($scriptid))));
$result = API::Script()->execute(array('hostid' => $hostid, 'scriptid' => $scriptid));
$isErrorExist = false;
if (empty($result)) {
$isErrorExist = true;
} elseif ($result['response'] == 'failed') {
error($result['value']);
$isErrorExist = true;
} else {
$data['message'] = $result['value'];
}
if ($isErrorExist) {
show_error_message(_('Cannot connect to the trapper port of zabbix server daemon, but it should be available to run the script.'));
}
// render view
$scriptView = new CView('general.script.execute', $data);
$scriptView->render();
$scriptView->show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:scripts_exec.php
示例20: array
* Display
*/
if (isset($_REQUEST['form'])) {
$data = array('nodeid' => get_request('nodeid'), 'masterNode' => DBfetch(DBselect('SELECT n.name FROM nodes n WHERE n.masterid IS NULL AND n.nodetype=' . ZBX_NODE_MASTER)));
if (get_request('nodeid') && !isset($_REQUEST['form_refresh'])) {
$data['new_nodeid'] = $node['nodeid'];
$data['name'] = $node['name'];
$data['ip'] = $node['ip'];
$data['port'] = $node['port'];
$data['masterid'] = $node['masterid'];
$data['nodetype'] = $node['nodetype'];
} else {
$data['new_nodeid'] = get_request('new_nodeid');
$data['name'] = get_request('name', '');
$data['ip'] = get_request('ip', '127.0.0.1');
$data['port'] = get_request('port', 10051);
$data['nodetype'] = get_request('nodetype', ZBX_NODE_CHILD);
$data['masterid'] = get_request('masterid', get_current_nodeid(false));
}
$nodeView = new CView('administration.node.edit', $data);
} else {
validate_sort_and_sortorder();
$data = array();
if (ZBX_DISTRIBUTED) {
$data['nodes'] = DBselect('SELECT n.* FROM nodes n ' . order_by('n.nodeid,n.name,n.ip', 'n.masterid'));
}
$nodeView = new CView('administration.node.list', $data);
}
$nodeView->render();
$nodeView->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:nodes.php
注:本文中的CView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论