histogram: Make histograms crash less
[ninja.git] / application / views / template_head.php
blobed4f21b66e058d91b48eb19a5ee432789a97d749
1 <head>
3 <?php
4 if (!empty($base_href)) {
5 echo (!empty($base_href)) ? '<base href="'.$base_href.'" />' : '';
7 ?>
9 <meta http-equiv="X-UA-Compatible" content="IE=8" /> <!-- Please remove me -->
10 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
12 <title><?php echo (isset($title)) ? Kohana::config('config.product_name').' ยป '.html::specialchars($title) : Kohana::config('config.product_name') ?></title>
14 <?php
15 echo html::link('application/views/icons/16x16/favicon.ico','icon','image/icon');
16 echo html::link('application/media/css/jquery.fancybox.css', 'stylesheet', 'text/css', false, 'screen');
17 echo html::link('application/media/css/jquery.notify.css', 'stylesheet', 'text/css', false, 'screen');
18 echo html::link('application/media/js/jquery.qtip.custom/jquery.qtip.css', 'stylesheet', 'text/css', false, 'screen');
21 <link href="<?php echo ninja::add_path('css/'.$current_skin.'common.css'); ?>" type="text/css" rel="stylesheet" media="all" />
22 <link href="<?php echo ninja::add_path('css/'.$current_skin.'print.css'); ?>" type="text/css" rel="stylesheet" media="print" />
23 <link type="text/css" rel="stylesheet" href="<?php echo ninja::add_path('css/'.$current_skin.'jquery-ui-custom.css') ?>" media="screen" />
24 <script type="text/javascript">
25 /* Hack for lack of console.log() in ie7 */
26 if (!window.console) console = {log: function() {}, error: function() {}, dir: function() {}};
27 </script>
29 <?php
30 echo html::script('application/media/js/jquery.js');
31 echo html::script('application/media/js/jquery-ui.min.js');
32 echo html::script('application/media/js/jquery.fancybox.js');
33 echo html::script('application/media/js/jquery.field.js');
34 echo html::script('application/media/js/jquery.form.js');
35 echo html::script('application/media/js/jquery.easywidgets.min.js');
36 echo html::script('application/media/js/jquery.autocomplete.min');
37 echo html::script('application/media/js/jquery.selectboxes.min.js');
38 echo html::script('application/media/js/jquery.jeditable.min');
39 echo html::script('application/media/js/jquery.query.js');
40 echo html::script('application/media/js/jquery.jgrowl.js');
41 echo html::script('application/media/js/jquery.qtip.custom/jquery.qtip.js');
42 echo html::script('application/media/js/jquery.hotkeys.min.js');
43 echo html::script('application/media/js/jquery.contextMenu.js');
44 echo html::script('application/media/js/date.js');
45 echo html::script('application/views/js/global_search.js');
46 echo html::script('application/media/js/jquery.notify.js');
47 echo html::script('application/media/js/ajax.commands.js');
49 <script type="text/javascript">
50 //<!--
51 <?php
52 $cgi_esc_html_tags = config::get_cgi_cfg_key('escape_html_tags');
53 if (empty($cgi_esc_html_tags)) {
54 $cgi_esc_html_tags = 0;
56 if (Auth::instance()->logged_in()) { ?>
58 var _site_domain = '<?php echo Kohana::config('config.site_domain') ?>';
59 var _csrf_token = '<?php echo csrf::token() ?>';
60 var _index_page = '<?php echo Kohana::config('config.index_page') ?>';
61 var _current_uri = '<?php echo Router::$controller.'/'.Router::$method ?>';
62 var _controller_name = '<?php echo str_replace("op5", null, Router::$controller) ?>';
63 var _logo_path = '<?php echo Kohana::config('config.logos_path').(substr(Kohana::config('config.logos_path'), -1) == '/' ? '' : '/'); ?>';
64 var _escape_html_tags = <?php echo $cgi_esc_html_tags ?>;
65 var _widget_refresh_msg = '<?php echo _('Refresh rate for all widgets has been updated to %s sec'); ?>';
66 var _widget_refresh_error = '<?php echo _('Unable to update refresh rate for all widgets.'); ?>';
67 var _widget_global_refresh_error = '<?php echo _('An error was encountered when trying to update refresh rate for all widgets.'); ?>';
68 var _widget_order_error = '<?php echo _('Unable to fetch widget order from database.'); ?>';
69 var _widget_settings_msg = '<?php echo _('Settings for widget %s was updated'); ?>';
70 var _widget_settings_error = '<?php echo _('Unable to fetch setting for widget %s'); ?>';
71 var _widget_notfound_error = '<?php echo _('Unable to find widget %s'); ?>';
72 var _page_refresh_msg = '<?php echo _('Updated page refresh rate to %s seconds'); ?>';
73 var _listview_refresh_msg = '<?php echo _('Updated list view refresh rate to %s seconds'); ?>';
74 var _settings_msg = '<?php echo _('The settings were updated'); ?>';
75 var _success_header = '<?php echo _('Success'); ?>';
76 var _error_header = '<?php echo _('ERROR'); ?>';
77 var _form_error_header = '<?php echo _("The form couldn\'t be processed since it contains one or more errors.%sPlease correct the following error(s) and try again:%s"); ?>';
78 var _command_empty_field = '<?php echo _("Field \'%s\' is required but empty"); ?>';
79 var _loading_str = '<?php echo _("Loading..."); ?>';
80 var _wait_str='<?php echo _('Please wait') ?>';
81 var _refresh_paused_msg='<?php echo _('Page refresh has been paused.') ?>';
82 var _refresh_unpaused_msg='<?php echo _('Page refresh has been restored.') ?>';
83 var _listview_refresh_paused_msg='<?php echo _('List view refresh has been paused.') ?>';
84 var _listview_refresh_unpaused_msg='<?php echo _('List view refresh has been restored.') ?>';
85 var _search_save_error = '<?php echo _("Length of \'%s\' must be between %s and %s characters.") ?>';
86 var _search_string_field = '<?php echo _('Search string') ?>';
87 var _search_remove_confirm = '<?php echo _('Are you sure that you wish to remove this saved search?') ?>';
88 var _search_name_field = '<?php echo _('Name') ?>';
89 var _search_save_ok = '<?php echo _('OK') ?>';
90 var _search_save_error = '<?php echo _('ERROR') ?>';
91 var _search_saved_ok = '<?php echo _('Your search was successfully saved.') ?>';
92 var _search_saved_error = '<?php echo _('An error occured when trying to save your search.') ?>';
93 var _nothing_selected_error = '<?php echo _('Please select at least one item.') ?>';
94 var _no_action_error = '<?php echo _('Please select an action.') ?>';
95 var _date_format = <?php echo json_encode(nagstat::date_format()); ?>;
96 var _server_utc_offset = <?php echo date::utc_offset(date_default_timezone_get()); ?>;
97 var _notes_url_target = "<?php echo config::get('nagdefault.notes_url_target', '*'); ?>";
98 var _action_url_target = "<?php echo config::get('nagdefault.action_url_target', '*'); ?>";
100 <?php if ($keycommands_active === 1) { ?>
102 var _keycommands_active='<?php echo config::get('keycommands.activated', '*', true); ?>';
103 var _keycommand_search='<?php echo config::get('keycommands.search', '*', true); ?>';
104 var _keycommand_pause='<?php echo config::get('keycommands.pause', '*', true); ?>';
105 var _keycommand_forward='<?php echo config::get('keycommands.forward', '*', true); ?>';
106 var _keycommand_back='<?php echo config::get('keycommands.back', '*', true); ?>';
107 <?php } else { ?>
108 var _keycommands_active='0';
109 <?php } ?>
111 var _popup_delay='<?php echo config::get('config.popup_delay', '*', true); ?>';
113 var loading_img = '/application/media/images/loading.gif';
114 // Usage: $(your_element).qtip($.extend(true, {}, qtip_default, {your_qtip_options: 'here'}))
115 var qtip_default = {
116 position: {
117 viewport: $(window), // requires a plugin
118 at: 'bottom center',
119 my: 'top left',
120 adjust: {
121 x: 10,
122 y: 5
125 show: {
126 solo: true,
127 delay: _popup_delay
129 hide: {
130 delay: 2000
132 style: {
133 classes: 'qtip-light qtip-pnp'
136 <?php
137 if (!empty($js_strings)) {
138 echo $js_strings;
141 if (!empty($inline_js)) {
142 echo '$(document).ready(function() {';
143 echo $inline_js;
144 echo "});";
146 //-->
147 </script>
149 <?php
150 echo new View('css_header', array('css' => isset($css)?$css:array()));
151 refresh::lv_control();
152 $basepath = 'modules/lsfilter/';
153 echo html::script($basepath.'media/js/lib.js');
154 echo html::script($basepath.'media/js/LSFilterSaved.js');
156 if (!isset($disable_refresh) || $disable_refresh === false) {
157 refresh::control();
161 <!--[If IE]>
162 <link type="text/css" rel="stylesheet" href="<?php echo ninja::add_path('css/default/ie7.css') ?>" />
163 <![endif]-->
165 <?php echo html::script('application/views/js/common.js'); ?>
166 <?php echo new View('js_header', array('js' => isset($js)?$js:array())); ?>
168 </head>