Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/plugin-ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ jobs:

steps:
- name: Checkout Cacti
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: Cacti/cacti
path: cacti

- name: Checkout Weathermap Plugin
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
path: cacti/plugins/weathermap

Expand Down Expand Up @@ -189,9 +189,9 @@ jobs:
run: composer run-script lint ${{ github.workspace }}/cacti/plugins/weathermap
working-directory: ${{ github.workspace }}/cacti

- name: Checking coding standards on base code
run: composer run-script phpcsfixer ${{ github.workspace }}/cacti/plugins/weathermap
working-directory: ${{ github.workspace }}/cacti
# - name: Checking coding standards on base code
# run: composer run-script phpcsfixer ${{ github.workspace }}/cacti/plugins/weathermap
# working-directory: ${{ github.workspace }}/cacti

# - name: Run PHPStan at Level 6 on base code outside of Composer due to technical issues
# run: ./include/vendor/bin/phpstan analyze --level 6 ${{ github.workspace }}/cacti/plugins/weathermap
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ IMPORTANT NOTE: This version only works on CACTI 1.x++!
* issue#173: Data Source select queries slow or not working
* issue#186: Popups are not working in standalone mode
* issue#211: Warn Count is being reset too early
* issue: Attempt to keep the plugin basepath the weathermap directory
* feature#219: Add Via Style as a Link form Option
* feature#193: Allow the Info URL to be either "Time View Graph" or "Classic View Graph"

Expand Down
2 changes: 1 addition & 1 deletion lib/editor.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ function show_editor_startpage() {
$errormessage .= $configerror . '<p>';
}

html_start_box(__('Welcome to the PHP Weathermap %s Editor', $weathermap_version, 'weathermap'), '100%', '', '3', 'center', '');
html_start_box(__('Welcome to the PHP Weathermap %s Editor', $weathermap_version, 'weathermap'), '100%', false, 3, 'center', '');
print '<tr>';
print '<td>';
print '<div>' . __('<b>NOTE:</b> This editor is not finished! There are many features of Weathermap that you will be missing out on if you choose to use the editor only. These include: curves, node offsets, font definitions, colour changing, per-node/per-link settings and image uploading. You CAN use the editor without damaging these features if you added them by hand, however.', 'weathermap') . '</div>';
Expand Down
4 changes: 1 addition & 3 deletions weathermap-cacti-plugin-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
+-------------------------------------------------------------------------+
*/

chdir('../../');

include_once('./include/auth.php');
include_once('../../include/auth.php');
include_once($config['base_path'] . '/plugins/weathermap/lib/editor.inc.php');
include_once($config['base_path'] . '/plugins/weathermap/lib/editor.actions.php');
include_once($config['base_path'] . '/plugins/weathermap/lib/WeatherMap.class.php');
Expand Down
37 changes: 18 additions & 19 deletions weathermap-cacti-plugin-mgmt.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
+-------------------------------------------------------------------------+
*/

chdir('../../');
include_once('./include/auth.php');
include_once('../../include/auth.php');
include_once($config['library_path'] . '/rrd.php');
include_once($config['base_path'] . '/plugins/weathermap/lib/WeatherMap.class.php');
include_once($config['base_path'] . '/plugins/weathermap/lib/poller-common.php');
Expand Down Expand Up @@ -479,7 +478,7 @@ function weathermap_form_actions() {

form_start('weathermap-cacti-plugin-mgmt.php', 'actions');

html_start_box($actions[get_nfilter_request_var('drp_action')], '60%', '', '3', 'center', '');
html_start_box($actions[get_nfilter_request_var('drp_action')], '60%', false, 3, 'center', '');

if (isset($array)) {
if (get_nfilter_request_var('drp_action') === '1') { // delete
Expand Down Expand Up @@ -566,7 +565,7 @@ function weathermap_footer_links() {

print '<br />';

html_start_box('<a target="_blank" class="linkOverDark" href="docs/">' . __('Local Documentation', 'weathermap') . '</a> -- <a target="_blank" class="linkOverDark" href="http://www.network-weathermap.com/">' . __('Weathermap Website', 'weathermap') . '</a> -- <a target="_target" class="linkOverDark" href="weathermap-cacti-plugin-editor.php">' . __('Weathermap Editor', 'weathermap') . '</a> -- ' . __('This is version %s', $weathermap_version), '100%', '', '3', 'center', '');
html_start_box('<a target="_blank" class="linkOverDark" href="docs/">' . __('Local Documentation', 'weathermap') . '</a> -- <a target="_blank" class="linkOverDark" href="http://www.network-weathermap.com/">' . __('Weathermap Website', 'weathermap') . '</a> -- <a target="_target" class="linkOverDark" href="weathermap-cacti-plugin-editor.php">' . __('Weathermap Editor', 'weathermap') . '</a> -- ' . __('This is version %s', $weathermap_version), '100%', false, 3, 'center', '');

html_end_box();
}
Expand Down Expand Up @@ -696,7 +695,7 @@ function wm_filter() {

$last_stats = read_config_option('weathermap_last_stats', true);

html_start_box(__('Weather Maps [ Run Details: %s ]', $last_stats, 'weathermap'), '100%', '', '3', 'center', 'weathermap-cacti-plugin-mgmt.php?action=addmap_picker');
html_start_box(__('Weather Maps [ Run Details: %s ]', $last_stats, 'weathermap'), '100%', false, 3, 'center', 'weathermap-cacti-plugin-mgmt.php?action=addmap_picker');
?>
<tr class='even'>
<td>
Expand Down Expand Up @@ -913,7 +912,7 @@ function maplist() {

print $nav;

html_start_box('', '100%', '', '3', 'center', '');
html_start_box('', '100%', false, 3, 'center', '');

$display_text = [
[
Expand Down Expand Up @@ -1182,7 +1181,7 @@ function create_prime_mapcache() {
function addmap_filter() {
global $item_rows;

html_start_box(__('Existing Configuration Files', 'weathermap'), '100%', '', '3', 'center', '');
html_start_box(__('Existing Configuration Files', 'weathermap'), '100%', false, 3, 'center', '');

?>
<tr class='even'>
Expand Down Expand Up @@ -1232,7 +1231,7 @@ function addmap_filter() {

html_end_box();

html_start_box(__('Create Options', 'weathermap'), '100%', '', '3', 'center', '');
html_start_box(__('Create Options', 'weathermap'), '100%', false, 3, 'center', '');

?>
<tr class='even'>
Expand Down Expand Up @@ -1438,7 +1437,7 @@ function addmap_picker($show_all = false) {

print $nav;

html_start_box('', '100%', '', '3', 'center', '');
html_start_box('', '100%', false, 3, 'center', '');

html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false);

Expand Down Expand Up @@ -1522,7 +1521,7 @@ function preview_config($file) {
header('Location: weathermap-cacti-plugin-mgmt.php?action=addmap_picker');
exit;
} else {
html_start_box(__('Preview of %s', $file, 'weathermap'), '100%', '', '3', 'center', '');
html_start_box(__('Preview of %s', $file, 'weathermap'), '100%', false, 3, 'center', '');

print '<tr><td class="textArea">';
print '<pre>';
Expand Down Expand Up @@ -1815,7 +1814,7 @@ function perms_filter($id) {
WHERE id = ?',
[$id]);

html_start_box(__('Weathermap Permissions for Map [ %s ]', $title, 'weathermap'), '100%', '', '3', 'center', '');
html_start_box(__('Weathermap Permissions for Map [ %s ]', $title, 'weathermap'), '100%', false, 3, 'center', '');
?>
<tr class='even'>
<td>
Expand Down Expand Up @@ -2120,7 +2119,7 @@ function perms_list($id) {

print $nav;

html_start_box('', '100%', '', '3', 'center', '');
html_start_box('', '100%', false, 3, 'center', '');

$display_text = [
[
Expand Down Expand Up @@ -2275,7 +2274,7 @@ function weathermap_map_settings($id) {
$do_map_settings = false;

if ($type == 'group' || $type == 'map') {
html_start_box(__('Usage Notes', 'weathermap'), '100%', '', '3', 'center', '');
html_start_box(__('Usage Notes', 'weathermap'), '100%', false, 3, 'center', '');

print '<tr class="even"><td>';

Expand Down Expand Up @@ -2305,7 +2304,7 @@ function weathermap_map_settings($id) {
}
}

html_start_box($title, '100%', '', '3', 'center', 'weathermap-cacti-plugin-mgmt.php?action=map_settings_form&mapid=' . intval($id));
html_start_box($title, '100%', false, 3, 'center', 'weathermap-cacti-plugin-mgmt.php?action=map_settings_form&mapid=' . intval($id));

if (cacti_sizeof($settingrows)) {
html_header([__('Action', 'weathermap'), __('Name', 'weathermap'), __('Value', 'weathermap')], 2);
Expand Down Expand Up @@ -2377,7 +2376,7 @@ function weathermap_readonly_settings($id, $title = 'Settings') {
[$id]);
}

html_start_box($title, '100%', '', '3', 'center', '');
html_start_box($title, '100%', false, 3, 'center', '');

html_header([__('Name', 'weathermap'), __('Value', 'weathermap')]);

Expand Down Expand Up @@ -2480,7 +2479,7 @@ function weathermap_map_settings_form($mapid = 0, $settingid = 0) {

form_start('weathermap-cacti-plugin-mgmt.php');

html_start_box("$action $title", '100%', '', '3', 'center', '');
html_start_box("$action $title", '100%', false, 3, 'center', '');

draw_edit_form(['config' => $values_ar, 'fields' => $field_ar]);

Expand Down Expand Up @@ -2575,7 +2574,7 @@ function weathermap_chgroup($id) {
print "<input type=hidden name='map_id' value='" . $id . "'>";
print "<input type=hidden name='action' value='chgroup_update'>";

html_start_box(__('Edit Map Group for Weathermap [ %s ]', $title, 'weathermap'), '100%', '', '3', 'center', '');
html_start_box(__('Edit Map Group for Weathermap [ %s ]', $title, 'weathermap'), '100%', false, 3, 'center', '');

// html_header(array("Group Name", ""));
form_alternate_row();
Expand Down Expand Up @@ -2628,7 +2627,7 @@ function weathermap_group_form($id = 0) {
$header = __esc('Editing Group: %s', $grouptext, 'weathermap');
}

html_start_box($header, '100%', '', '3', 'center', '');
html_start_box($header, '100%', false, 3, 'center', '');

print '<tr><td>';

Expand All @@ -2655,7 +2654,7 @@ function weathermap_group_form($id = 0) {
function weathermap_group_editor() {
global $config;

html_start_box(__('Edit Map Groups', 'weathermap'), '100%', '', '3', 'center', 'weathermap-cacti-plugin-mgmt.php?action=group_form&id=0');
html_start_box(__('Edit Map Groups', 'weathermap'), '100%', false, 3, 'center', 'weathermap-cacti-plugin-mgmt.php?action=group_form&id=0');

html_header([__('Actions', 'weathermap'), __('Group Name', 'weathermap'), __('Settings', 'weathermap'), __('Sort Order', 'weathermap')], 2);

Expand Down
7 changes: 3 additions & 4 deletions weathermap-cacti-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@

$guest_account = true;

chdir('../../');
include_once('./include/auth.php');
include_once('../../include/auth.php');
include_once($config['base_path'] . '/plugins/weathermap/lib/WeatherMap.class.php');

$showversionbox = read_config_option('weathermap_showversion');
Expand Down Expand Up @@ -767,7 +766,7 @@ function weathermap_footer_links() {

print '<br />';

html_start_box("<center><a target=\"_blank\" class=\"linkOverDark\" href=\"docs/\">Local Documentation</a> -- <a target=\"_blank\" class=\"linkOverDark\" href=\"http://www.network-weathermap.com/\">Weathermap Website</a> -- <a target=\"_target\" class=\"linkOverDark\" href=\"weathermap-cacti-plugin-editor.php?plug=1\">Weathermap Editor</a> -- This is version $weathermap_version</center>", '100%', '', '3', 'center', '');
html_start_box("<center><a target=\"_blank\" class=\"linkOverDark\" href=\"docs/\">Local Documentation</a> -- <a target=\"_blank\" class=\"linkOverDark\" href=\"http://www.network-weathermap.com/\">Weathermap Website</a> -- <a target=\"_target\" class=\"linkOverDark\" href=\"weathermap-cacti-plugin-editor.php?plug=1\">Weathermap Editor</a> -- This is version $weathermap_version</center>", '100%', false, 3, 'center', '');
html_end_box();
}

Expand All @@ -794,7 +793,7 @@ function weathermap_mapselector($current_id = 0) {
if (cacti_sizeof($maps) > 1) {
// include graph view filter selector

html_start_box(__('Weathermap Filter', 'weathermap'), '100%', '', '3', 'center', '');
html_start_box(__('Weathermap Filter', 'weathermap'), '100%', false, 3, 'center', '');
?>
<tr class='even noprint'>
<td class='noprint'>
Expand Down
3 changes: 1 addition & 2 deletions weathermap-cacti-rebuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
+-------------------------------------------------------------------------+
*/

chdir('../../');
include('./include/cli_check.php');
include('../../include/cli_check.php');
include_once($config['base_path'] . '/lib/rrd.php');
include_once($config['base_path'] . '/plugins/weathermap/setup.php');
include_once($config['base_path'] . '/plugins/weathermap/lib/poller-common.php');
Expand Down