histogram: Make histograms crash less
[ninja.git] / application / views / external_widget.php
blob5bb78b8f31ae56607248d9e7b25f8730b8c5672a
1 <?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
2 <!DOCTYPE html>
4 <html lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7 <title><?php echo (isset($title)) ? Kohana::config('config.product_name').' ยป '.html::specialchars($title) : Kohana::config('config.product_name') ?></title>
8 <?php echo html::link('application/media/js/jquery.qtip.custom/jquery.qtip.css', 'stylesheet', 'text/css', false, 'screen'); ?>
9 <link type="text/css" rel="stylesheet" href="<?php echo ninja::add_path('css/'.$current_skin.'common.css'); ?>" media="all" />
10 <link type="text/css" rel="stylesheet" href="<?php echo ninja::add_path('css/'.$current_skin.'print.css'); ?>" media="print" />
11 <link type="text/css" rel="stylesheet" href="<?php echo ninja::add_path('css/default/jquery-ui-custom.css') ?>" />
12 <?php echo html::link($this->add_path('icons/16x16/favicon.ico'),'icon','image/icon') ?>
13 <!--[If IE]>
14 <link type="text/css" rel="stylesheet" href="<?php echo ninja::add_path('css/default/ie7.css') ?>" />
15 <?php echo (Router::$controller.'/'.Router::$method == 'histogram/generate') ? html::script('application/media/js/excanvas.compiled.js') : ''; ?>
16 <![endif]-->
17 <?php
18 echo new View('css_header', array('css' => $css));
19 echo html::script('application/media/js/jquery.js');
20 echo html::script('application/media/js/jquery-ui.min.js');
21 echo html::script('application/media/js/jquery.form.js');
22 echo html::script('application/media/js/jquery.easywidgets.min.js');
23 echo html::script('application/media/js/jquery.autocomplete.min');
24 echo html::script('application/media/js/jquery.selectboxes.min.js');
25 echo html::script('application/media/js/jquery.jeditable.min');
26 echo html::script('application/media/js/jquery.query.js');
27 echo html::script('application/media/js/jquery.jgrowl.js');
28 echo html::script('application/media/js/jquery.qtip.custom/jquery.qtip.js');
29 echo html::script('application/media/js/jquery.hotkeys.min.js');
30 echo html::script('application/media/js/jquery.field.js');
31 echo html::script('application/media/js/date.js');
32 echo html::script('application/views/js/global_search.js');
33 echo html::script('application/views/js/pagination.js');
34 if (!isset($disable_refresh) || $disable_refresh === false) {
35 refresh::control();
39 <script type="text/javascript">
40 //<!--
41 <?php
42 $cgi_esc_html_tags = config::get_cgi_cfg_key('escape_html_tags');
43 if (empty($cgi_esc_html_tags)) {
44 $cgi_esc_html_tags = 0;
46 if (Auth::instance()->logged_in()) { ?>
48 var _site_domain = '<?php echo Kohana::config('config.site_domain') ?>';
49 var _index_page = '<?php echo Kohana::config('config.index_page') ?>';
50 var _current_uri = '<?php echo Router::$controller.'/'.Router::$method ?>';
51 var _controller_name = '<?php echo Router::$controller ?>';
52 var _logo_path = '<?php echo Kohana::config('config.logos_path').(substr(Kohana::config('config.logos_path'), -1) == '/' ? '' : '/'); ?>';
53 var _escape_html_tags = <?php echo $cgi_esc_html_tags ?>;
54 var _widget_refresh_msg = '<?php echo _('Refresh rate for all widgets has been updated to %s sec'); ?>';
55 var _widget_refresh_error = '<?php echo _('Unable to update refresh rate for all widgets.'); ?>';
56 var _widget_global_refresh_error = '<?php echo _('An error was encountered when trying to update refresh rate for all widgets.'); ?>';
57 var _widget_order_error = '<?php echo _('Unable to fetch widget order from database.'); ?>';
58 var _widget_settings_msg = '<?php echo _('Settings for widget %s was updated'); ?>';
59 var _widget_settings_error = '<?php echo _('Unable to fetch setting for widget %s'); ?>';
60 var _widget_notfound_error = '<?php echo _('Unable to find widget %s'); ?>';
61 var _page_refresh_msg = '<?php echo _('Updated page refresh rate to %s seconds'); ?>';
62 var _settings_msg = '<?php echo _('The settings were updated'); ?>';
63 var _success_header = '<?php echo _('Success'); ?>';
64 var _error_header = '<?php echo _('ERROR'); ?>';
65 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"); ?>';
66 var _command_empty_field = '<?php echo _("Field \'%s\' is required but empty"); ?>';
67 var _loading_str = '<?php echo _("Loading..."); ?>';
68 var _wait_str='<?php echo _('Please wait') ?>';
69 var _refresh_paused_msg='<?php echo _('Page refresh has been paused.') ?>';
70 var _refresh_unpaused_msg='<?php echo _('Page refresh has been restored.') ?>';
71 var _search_save_error = '<?php echo _("Length of \'%s\' must be between %s and %s characters.") ?>';
72 var _search_string_field = '<?php echo _('Search string') ?>';
73 var _search_remove_confirm = '<?php echo _('Are you sure that you wish to remove this saved search?') ?>';
74 var _search_name_field = '<?php echo _('Name') ?>';
75 var _search_save_ok = '<?php echo _('OK') ?>';
76 var _search_save_error = '<?php echo _('ERROR') ?>';
77 var _search_saved_ok = '<?php echo _('Your search was successfully saved.') ?>';
78 var _search_saved_error = '<?php echo _('An error occured when trying to save your search.') ?>';
79 var _date_format = <?php echo json_encode(nagstat::date_format()); ?>;
80 var _server_utc_offset = <?php echo date::utc_offset(date_default_timezone_get()); ?>;
82 <?php if (config::get('keycommands.activated', '*', true)) { ?>
84 var _keycommands_active='<?php echo config::get('keycommands.activated', '*', true); ?>';
85 var _keycommand_search='<?php echo config::get('keycommands.search', '*', true); ?>';
86 var _keycommand_pause='<?php echo config::get('keycommands.pause', '*', true); ?>';
87 var _keycommand_forward='<?php echo config::get('keycommands.forward', '*', true); ?>';
88 var _keycommand_back='<?php echo config::get('keycommands.back', '*', true); ?>';
89 <?php } else { ?>
90 var _keycommands_active='0';
91 <?php } ?>
93 var _popup_delay='<?php echo config::get('config.popup_delay', '*', true); ?>';
94 <?php
95 if (!empty($js_strings)) {
96 echo $js_strings;
99 if (!empty($inline_js)) {
100 echo "$(document).ready(function() {";
101 echo $inline_js;
102 echo "});";
104 //-->
105 </script>
106 <?php echo html::script('application/views/js/common.js'); ?>
107 <?php echo new View('js_header', array('js' => $js)); ?>
109 </head>
112 <body>
113 <div align="center">
114 <?php if (isset($content)) { echo $content; } else { return url::redirect(Kohana::config('routes.logged_in_default')); } ?>
115 <!--<p>Rendered in {execution_time} seconds, using {memory_usage} of memory</p> -->
116 </div>
117 </body>
118 </html>