Skip to content

Commit ea1c2b4

Browse files
committed
all panels own refresh interval and settings
1 parent 8ed59ff commit ea1c2b4

File tree

3 files changed

+311
-342
lines changed

3 files changed

+311
-342
lines changed

include/actions.php

+25-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
}
3232

3333

34-
if (isset_request_var('intropage_rename')) {
34+
if (isset_request_var('intropage_settings')) {
35+
36+
// dashboard names
3537
$number_of_dashboards = read_user_setting('intropage_number_of_dashboards',1);
3638

3739
for ($f = 1; $f <= $number_of_dashboards; $f++) {
@@ -44,6 +46,28 @@
4446
VALUES (?, ?, ?)',
4547
array($_SESSION['sess_user_id'], $f, $name ));
4648
}
49+
50+
// panel refresh
51+
$panels = db_fetch_assoc_prepared('SELECT t1.panel_id AS panel_name,t1.id AS id FROM plugin_intropage_panel_data AS t1
52+
JOIN plugin_intropage_panel_dashboard AS t2
53+
ON t1.id=t2.panel_id WHERE t2.user_id= ?',
54+
array($_SESSION['sess_user_id']));
55+
56+
if (cacti_sizeof($panels)) {
57+
58+
foreach ($panels as $panel) {
59+
60+
$interval = get_filter_request_var('crefresh_' .$panel['id'], FILTER_VALIDATE_INT);
61+
if ($interval >= 60 && $interval <= 999999999) {
62+
db_execute_prepared('UPDATE plugin_intropage_panel_data
63+
SET refresh_interval= ?
64+
WHERE id= ?',
65+
array($interval, $panel['id']));
66+
}
67+
68+
}
69+
}
70+
4771
unset_request_var('intropage_configure');
4872
}
4973

0 commit comments

Comments
 (0)