From 1e815e7c23b416acb3b8e88acdb275416c0afa1a Mon Sep 17 00:00:00 2001
From: Pim van den Berg
Date: Sun, 29 Dec 2013 16:27:24 +0100
Subject: automatic page refresh support + config setting
Closes: https://github.com/pommi/CGP/pull/35
---
conf/config.php | 3 +++
inc/html.inc.php | 6 ++++++
2 files changed, 9 insertions(+)
diff --git a/conf/config.php b/conf/config.php
index 7107841..fc10a43 100644
--- a/conf/config.php
+++ b/conf/config.php
@@ -54,6 +54,9 @@ $CONFIG['graph_smooth'] = false;
# browser cache time for the graphs (in seconds)
$CONFIG['cache'] = 90;
+# page refresh (in seconds)
+$CONFIG['page_refresh'] = '';
+
# default width/height of the graphs
$CONFIG['width'] = 400;
$CONFIG['heigth'] = 175;
diff --git a/inc/html.inc.php b/inc/html.inc.php
index 9a5344b..478045c 100644
--- a/inc/html.inc.php
+++ b/inc/html.inc.php
@@ -22,6 +22,12 @@ function html_start() {
EOT;
+ if (isset($CONFIG['page_refresh']) && is_numeric($CONFIG['page_refresh'])) {
+ echo <<
+
+EOT;
+ }
if ($CONFIG['graph_type'] == 'canvas') {
echo <<