diff options
author | onefang | 2020-01-04 18:23:59 +1000 |
---|---|---|
committer | onefang | 2020-01-04 18:23:59 +1000 |
commit | 31ba7c5981bf137fa1ddec5cb78e3938944da347 (patch) | |
tree | 872e870d02c28437a8006934d021964e874a9189 /inc | |
parent | Work with CGI PHP. (diff) | |
download | apt-panopticon_cgp-31ba7c5981bf137fa1ddec5cb78e3938944da347.zip apt-panopticon_cgp-31ba7c5981bf137fa1ddec5cb78e3938944da347.tar.gz apt-panopticon_cgp-31ba7c5981bf137fa1ddec5cb78e3938944da347.tar.bz2 apt-panopticon_cgp-31ba7c5981bf137fa1ddec5cb78e3938944da347.tar.xz |
Fix up static URLs that got broken going through php.cgi.
Diffstat (limited to 'inc')
-rw-r--r-- | inc/html.inc.php | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/inc/html.inc.php b/inc/html.inc.php index bc38b24..b9cae9c 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php | |||
@@ -12,6 +12,7 @@ function html_start() { | |||
12 | 12 | ||
13 | $path = htmlentities(breadcrumbs()); | 13 | $path = htmlentities(breadcrumbs()); |
14 | $html_weburl = htmlentities($CONFIG['weburl']); | 14 | $html_weburl = htmlentities($CONFIG['weburl']); |
15 | $html_staticurl = htmlentities($CONFIG['staticurl']); | ||
15 | 16 | ||
16 | echo <<<EOT | 17 | echo <<<EOT |
17 | <!DOCTYPE html> | 18 | <!DOCTYPE html> |
@@ -20,10 +21,10 @@ function html_start() { | |||
20 | <meta charset="utf-8"> | 21 | <meta charset="utf-8"> |
21 | <title>CGP{$path}</title> | 22 | <title>CGP{$path}</title> |
22 | <meta name="viewport" content="width=device-width"> | 23 | <meta name="viewport" content="width=device-width"> |
23 | <link rel="stylesheet" href="{$html_weburl}layout/style.css" type="text/css"> | 24 | <link rel="stylesheet" href="{$html_staticurl}layout/style.css" type="text/css"> |
24 | <link rel="stylesheet" href="{$html_weburl}layout/style-b.css" type="text/css" media="(max-width: 1000px),(max-device-width: 1000px) and (orientation: portrait),(max-device-width: 767px) and (orientation: landscape)"> | 25 | <link rel="stylesheet" href="{$html_staticurl}layout/style-b.css" type="text/css" media="(max-width: 1000px),(max-device-width: 1000px) and (orientation: portrait),(max-device-width: 767px) and (orientation: landscape)"> |
25 | <link rel="stylesheet" href="{$html_weburl}layout/style-c.css" type="text/css" media="(max-width: 767px),(max-device-width: 767px) and (orientation: portrait),(max-device-width: 499px) and (orientation: landscape)"> | 26 | <link rel="stylesheet" href="{$html_staticurl}layout/style-c.css" type="text/css" media="(max-width: 767px),(max-device-width: 767px) and (orientation: portrait),(max-device-width: 499px) and (orientation: landscape)"> |
26 | <link rel="stylesheet" href="{$html_weburl}layout/style-d.css" type="text/css" media="(max-width: 499px),(max-device-width: 499px) and (orientation: portrait)"> | 27 | <link rel="stylesheet" href="{$html_staticurl}layout/style-d.css" type="text/css" media="(max-width: 499px),(max-device-width: 499px) and (orientation: portrait)"> |
27 | 28 | ||
28 | EOT; | 29 | EOT; |
29 | if (isset($CONFIG['page_refresh']) && is_numeric($CONFIG['page_refresh'])) { | 30 | if (isset($CONFIG['page_refresh']) && is_numeric($CONFIG['page_refresh'])) { |
@@ -35,24 +36,24 @@ EOT; | |||
35 | 36 | ||
36 | if ($CONFIG['graph_type'] == 'canvas') { | 37 | if ($CONFIG['graph_type'] == 'canvas') { |
37 | echo <<<EOT | 38 | echo <<<EOT |
38 | <script type="text/javascript" src="{$html_weburl}js/sprintf.js"></script> | 39 | <script type="text/javascript" src="{$html_staticurl}js/sprintf.js"></script> |
39 | <script type="text/javascript" src="{$html_weburl}js/strftime.js"></script> | 40 | <script type="text/javascript" src="{$html_staticurl}js/strftime.js"></script> |
40 | <script type="text/javascript" src="{$html_weburl}js/RrdRpn.js"></script> | 41 | <script type="text/javascript" src="{$html_staticurl}js/RrdRpn.js"></script> |
41 | <script type="text/javascript" src="{$html_weburl}js/RrdTime.js"></script> | 42 | <script type="text/javascript" src="{$html_staticurl}js/RrdTime.js"></script> |
42 | <script type="text/javascript" src="{$html_weburl}js/RrdGraph.js"></script> | 43 | <script type="text/javascript" src="{$html_staticurl}js/RrdGraph.js"></script> |
43 | <script type="text/javascript" src="{$html_weburl}js/RrdGfxCanvas.js"></script> | 44 | <script type="text/javascript" src="{$html_staticurl}js/RrdGfxCanvas.js"></script> |
44 | <script type="text/javascript" src="{$html_weburl}js/binaryXHR.js"></script> | 45 | <script type="text/javascript" src="{$html_staticurl}js/binaryXHR.js"></script> |
45 | <script type="text/javascript" src="{$html_weburl}js/rrdFile.js"></script> | 46 | <script type="text/javascript" src="{$html_staticurl}js/rrdFile.js"></script> |
46 | <script type="text/javascript" src="{$html_weburl}js/RrdDataFile.js"></script> | 47 | <script type="text/javascript" src="{$html_staticurl}js/RrdDataFile.js"></script> |
47 | <script type="text/javascript" src="{$html_weburl}js/RrdCmdLine.js"></script> | 48 | <script type="text/javascript" src="{$html_staticurl}js/RrdCmdLine.js"></script> |
48 | 49 | ||
49 | EOT; | 50 | EOT; |
50 | } | 51 | } |
51 | 52 | ||
52 | if ($CONFIG['showtime']) { | 53 | if ($CONFIG['showtime']) { |
53 | echo <<<EOT | 54 | echo <<<EOT |
54 | <script type="text/javascript" src="{$html_weburl}js/jquery-2.1.1.min.js"></script> | 55 | <script type="text/javascript" src="{$html_staticurl}js/jquery-2.1.1.min.js"></script> |
55 | <script type="text/javascript" src="{$html_weburl}js/jquery.timeago.js"></script> | 56 | <script type="text/javascript" src="{$html_staticurl}js/jquery.timeago.js"></script> |
56 | 57 | ||
57 | EOT; | 58 | EOT; |
58 | } | 59 | } |
@@ -62,7 +63,7 @@ echo <<<EOT | |||
62 | <body> | 63 | <body> |
63 | 64 | ||
64 | <div id="header"> | 65 | <div id="header"> |
65 | <h1><a href="{$html_weburl}">Collectd Graph Panel</a></h1> | 66 | <h1><a href="index.php">Collectd Graph Panel</a></h1> |
66 | </div> | 67 | </div> |
67 | 68 | ||
68 | EOT; | 69 | EOT; |
@@ -97,6 +98,7 @@ EOT; | |||
97 | function html_end($footer = false) { | 98 | function html_end($footer = false) { |
98 | global $CONFIG; | 99 | global $CONFIG; |
99 | $html_weburl = htmlentities($CONFIG['weburl']); | 100 | $html_weburl = htmlentities($CONFIG['weburl']); |
101 | $html_staticurl = htmlentities($CONFIG['staticurl']); | ||
100 | 102 | ||
101 | if ($footer) { | 103 | if ($footer) { |
102 | $git = '/usr/bin/git'; | 104 | $git = '/usr/bin/git'; |
@@ -115,7 +117,7 @@ function html_end($footer = false) { | |||
115 | echo <<<EOT | 117 | echo <<<EOT |
116 | </div> | 118 | </div> |
117 | <div id="footer"> | 119 | <div id="footer"> |
118 | <hr><span class="small"><a href="http://pommi.nethuis.nl/category/cgp/" rel="external">Collectd Graph Panel</a> ({$version}) is distributed under the <a href="{$html_weburl}LICENSE" rel="license">GNU General Public License (GPLv3)</a></span> | 120 | <hr><span class="small"><a href="http://pommi.nethuis.nl/category/cgp/" rel="external">Collectd Graph Panel</a> ({$version}) is distributed under the <a href="{$html_staticurl}LICENSE" rel="license">GNU General Public License (GPLv3)</a></span> |
119 | </div> | 121 | </div> |
120 | 122 | ||
121 | EOT; | 123 | EOT; |
@@ -127,7 +129,7 @@ EOT; | |||
127 | $js_async = 'false'; | 129 | $js_async = 'false'; |
128 | } | 130 | } |
129 | echo <<<EOT | 131 | echo <<<EOT |
130 | <script src="{$html_weburl}js/CGP.js"></script> | 132 | <script src="{$html_staticurl}js/CGP.js"></script> |
131 | <script> | 133 | <script> |
132 | CGP.drawAll($js_async); | 134 | CGP.drawAll($js_async); |
133 | </script> | 135 | </script> |