Ejemplo n.º 1
0
        }
        if ((defined('ZBX_PAGE_DO_REFRESH') || defined('ZBX_PAGE_DO_JS_REFRESH')) && CWebUser::$data['refresh']) {
            $pageTitle .= ' [' . _s('refreshed every %1$s sec.', CWebUser::$data['refresh']) . ']';
        }
        break;
}
// construct menu
$main_menu = array();
$sub_menus = array();
$denied_page_requested = zbx_construct_menu($main_menu, $sub_menus, $page);
// render the "Deny access" page
if ($denied_page_requested) {
    access_deny(ACCESS_DENY_PAGE);
}
if ($page['type'] == PAGE_TYPE_HTML) {
    $pageHeader = new CPageHeader($pageTitle);
    $pageHeader->addCssInit();
    $css = ZBX_DEFAULT_THEME;
    if (!ZBX_PAGE_NO_THEME) {
        if (!empty($DB['DB'])) {
            $config = select_config();
            $css = getUserTheme(CWebUser::$data);
            $severityCss = <<<CSS
.disaster { background: #{$config['severity_color_5']} !important; }
.high { background: #{$config['severity_color_4']} !important; }
.average { background: #{$config['severity_color_3']} !important; }
.warning { background: #{$config['severity_color_2']} !important; }
.information { background: #{$config['severity_color_1']} !important; }
.not_classified { background: #{$config['severity_color_0']} !important; }
CSS;
            $pageHeader->addStyle($severityCss);
Ejemplo n.º 2
0
**
** 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.
**/
$pageHeader = new CPageHeader(_('Warning') . ' [' . _s('refreshed every %1$s sec.', 30) . ']');
$pageHeader->addCssInit();
$pageHeader->display();
?>
<body>
<?php 
// check if a CWarning object is passed
if (!($warning = $this->get('warning'))) {
    $message = $this->get('message');
    if (is_array($message) && isset($message['header'])) {
        $message = array(bold($message['header']), BR(), $message['text']);
    }
    // if not - render a standard warning with a message
    $warning = new CWarning('Zabbix ' . ZABBIX_VERSION, $message);
    $warning->setButtons(array(new CButton('login', _('Retry'), 'document.location.reload();', 'formlist')));
}
Ejemplo n.º 3
0
} elseif (hasRequest('cancel') || hasRequest('finish')) {
    zbx_unsetcookie('ZBX_CONFIG');
    redirect('index.php');
}
/*
 * Setup wizard
 */
$ZBX_SETUP_WIZARD = new CSetupWizard($ZBX_CONFIG);
zbx_setcookie('ZBX_CONFIG', serialize($ZBX_CONFIG));
// page title
$pageTitle = '';
if (isset($ZBX_SERVER_NAME) && !zbx_empty($ZBX_SERVER_NAME)) {
    $pageTitle = $ZBX_SERVER_NAME . NAME_DELIMITER;
}
$pageTitle .= _('Installation');
$pageHeader = new CPageHeader($pageTitle);
$pageHeader->addCssInit();
$pageHeader->addCssFile('styles/themes/originalblue/main.css');
$pageHeader->addJsFile('js/jquery/jquery.js');
$pageHeader->addJsFile('js/jquery/jquery-ui.js');
$pageHeader->addJsFile('js/functions.js');
// if init fails due to missing configuration, set user as guest with default en_GB language
if (!CWebUser::$data) {
    CWebUser::setDefault();
}
$path = 'jsLoader.php?ver=' . ZABBIX_VERSION . '&amp;lang=' . CWebUser::$data['lang'] . '&amp;files[]=common.js&amp;files[]=main.js';
$pageHeader->addJsFile($path);
$pageHeader->display();
?>
<body class="originalblue">
Ejemplo n.º 4
0
        $pageTitle .= isset($page['title']) ? $page['title'] : _('Zabbix');
        if ((defined('ZBX_PAGE_DO_REFRESH') || defined('ZBX_PAGE_DO_JS_REFRESH')) && CWebUser::$data['refresh']) {
            $pageTitle .= ' [' . _s('refreshed every %1$s sec.', CWebUser::$data['refresh']) . ']';
        }
        break;
}
// construct menu
$main_menu = [];
$sub_menus = [];
$denied_page_requested = zbx_construct_menu($main_menu, $sub_menus, $page);
// render the "Deny access" page
if ($denied_page_requested) {
    access_deny(ACCESS_DENY_PAGE);
}
if ($page['type'] == PAGE_TYPE_HTML) {
    $pageHeader = new CPageHeader($pageTitle);
    $theme = ZBX_DEFAULT_THEME;
    if (!ZBX_PAGE_NO_THEME) {
        global $DB;
        if (!empty($DB['DB'])) {
            $config = select_config();
            $theme = getUserTheme(CWebUser::$data);
            $pageHeader->addStyle(getTriggerSeverityCss($config));
            // perform Zabbix server check only for standard pages
            if ((!defined('ZBX_PAGE_NO_MENU') || defined('ZBX_PAGE_FULLSCREEN')) && $config['server_check_interval'] && !empty($ZBX_SERVER) && !empty($ZBX_SERVER_PORT)) {
                $page['scripts'][] = 'servercheck.js';
            }
        }
    }
    $pageHeader->addCssFile('styles/' . CHtml::encode($theme) . '.css');
    if ($page['file'] == 'sysmap.php') {
**
** 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.
**/
global $DB, $ZBX_SERVER, $ZBX_SERVER_NAME, $ZBX_SERVER_PORT;
$page_title = $data['page']['title'];
if (isset($ZBX_SERVER_NAME) && $ZBX_SERVER_NAME !== '') {
    $page_title = $ZBX_SERVER_NAME . NAME_DELIMITER . $page_title;
}
$pageHeader = new CPageHeader($page_title);
$scripts = [];
$theme = ZBX_DEFAULT_THEME;
if (!empty($DB['DB'])) {
    $config = select_config();
    $theme = getUserTheme($data['user']);
    $pageHeader->addStyle(getTriggerSeverityCss($config));
    // perform Zabbix server check only for standard pages
    if ($config['server_check_interval'] && !empty($ZBX_SERVER) && !empty($ZBX_SERVER_PORT)) {
        $scripts[] = 'servercheck.js';
    }
}
$pageHeader->addCssFile('styles/' . CHtml::encode($theme) . '.css');
$pageHeader->addJsFile('js/browsers.js');
$pageHeader->addJsBeforeScripts('var PHP_TZ_OFFSET = ' . date('Z') . ';');
// show GUI messages in pages with menus and in fullscreen mode