Example #1
0
    $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);
            // 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';
            }
        }
    }
    $css = CHtml::encode($css);
    $pageHeader->addCssFile('styles/themes/' . $css . '/main.css');
    if ($page['file'] == 'sysmap.php') {
        $pageHeader->addCssFile('imgstore.php?css=1&output=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
    $showGuiMessaging = !defined('ZBX_PAGE_NO_MENU') || $_REQUEST['fullscreen'] == 1 ? 1 : 0;
Example #2
0
$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') {
        $pageHeader->addCssFile('imgstore.php?css=1&output=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
    $showGuiMessaging = !defined('ZBX_PAGE_NO_MENU') || $_REQUEST['fullscreen'] == 1 ? 1 : 0;
    $path = 'jsLoader.php?ver=' . ZABBIX_VERSION . '&amp;lang=' . CWebUser::$data['lang'] . '&showGuiMessaging=' . $showGuiMessaging;