forked from Cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangelog.php
More file actions
145 lines (120 loc) · 4.45 KB
/
changelog.php
File metadata and controls
145 lines (120 loc) · 4.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2020 The Cacti Group |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDtool-based Graphing Solution |
+-------------------------------------------------------------------------+
| This code is designed, written, and maintained by the Cacti Group. See |
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/
include('./include/auth.php');
include_once('./lib/api_data_source.php');
include_once('./lib/boost.php');
include_once('./lib/rrd.php');
include_once('./lib/clog_webapi.php');
include_once('./lib/poller.php');
include_once('./lib/utility.php');
/* set default action */
set_default_action();
switch (get_request_var('action')) {
default:
if (!api_plugin_hook_function('changelog_action', get_request_var('action'))) {
top_header();
changelog_view();
bottom_footer();
}
break;
}
/* -----------------------
Functions
----------------------- */
function changelog_view() {
global $database_default, $config, $rrdtool_versions, $poller_options, $input_types, $local_db_cnn_id;
/* ================= input validation ================= */
get_filter_request_var('tab', FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => '/^([a-z_A-Z]+)$/')));
/* ==================================================== */
top_header();
/* present a tabbed interface */
$tabs = array(
'highlights' => __('Highlights'),
'full' => __('Full'),
);
/* set the default tab */
load_current_session_value('tab', 'sess_cl_tabs', 'summary');
$current_tab = get_nfilter_request_var('tab');
$page = 'changelog.php?tab=' . $current_tab;
$refresh = array(
'seconds' => 999999,
'page' => $page,
'logout' => 'false'
);
set_page_refresh($refresh);
$i = 0;
/* draw the tabs */
print "<div class='tabs'><nav><ul role='tablist'>";
foreach (array_keys($tabs) as $tab_short_name) {
print "<li class='subTab'><a class='tab" . (($tab_short_name == $current_tab) ? " selected'" : "'") .
" href='" . html_escape($config['url_path'] .
'changelog.php?tab=' . $tab_short_name) .
"'>" . $tabs[$tab_short_name] . "</a></li>";
$i++;
}
api_plugin_hook('changelog_tab');
print "</ul></nav></div>";
$header_label = __esc('Change Log [%s]', $tabs[get_request_var('tab')]);
/* Display tech information */
html_start_box($header_label, '100%', '', '3', 'center', '');
$changelog = file($config['base_path'] . '/CHANGELOG');
$full = $current_tab == 'full';
foreach($changelog as $s) {
if (strlen(trim($s))) {
$l = strtoupper($s);
if (strpos($l, 'CHANGELOG') === false) {
if (strpos($l, '-') === false) {
if (!$full) {
break;
}
html_section_header(__('Version %s', $s), 2);
} else {
$is_wanted = ($current_tab == 'full' || strpos($l, '-FEATURE') === 0 || strpos($l, '-SECURITY') === 0);
if ($is_wanted) {
form_alternate_row();
print '<td>' . $s . '</td>';
form_end_row();
}
}
}
}
}
html_end_box();
?>
<script type='text/javascript'>
$(function() {
$('#tables').tablesorter({
widgets: ['zebra'],
widgetZebra: { css: ['even', 'odd'] },
headerTemplate: '<div class="textSubHeaderDark">{content} {icon}</div>',
cssIconAsc: 'fa-sort-up',
cssIconDesc: 'fa-sort-down',
cssIconNone: 'fa-sort',
cssIcon: 'fa'
});
});
</script>
<?php
bottom_footer();
}