From 87e5252552650d181abeac1dfc4a9a7431743e7c Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 18 May 2026 10:53:23 -0400 Subject: [PATCH 1/3] fix: Attempt to keep the weathermap basepath the weathermap directory --- CHANGELOG.md | 1 + weathermap-cacti-plugin-editor.php | 4 +--- weathermap-cacti-plugin-mgmt.php | 3 +-- weathermap-cacti-plugin.php | 3 +-- weathermap-cacti-rebuild.php | 3 +-- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cedf88c..2212665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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" diff --git a/weathermap-cacti-plugin-editor.php b/weathermap-cacti-plugin-editor.php index 73c91a3..9a7e478 100644 --- a/weathermap-cacti-plugin-editor.php +++ b/weathermap-cacti-plugin-editor.php @@ -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'); diff --git a/weathermap-cacti-plugin-mgmt.php b/weathermap-cacti-plugin-mgmt.php index f751694..2225e12 100644 --- a/weathermap-cacti-plugin-mgmt.php +++ b/weathermap-cacti-plugin-mgmt.php @@ -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'); diff --git a/weathermap-cacti-plugin.php b/weathermap-cacti-plugin.php index f3f4faf..db1b840 100644 --- a/weathermap-cacti-plugin.php +++ b/weathermap-cacti-plugin.php @@ -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'); diff --git a/weathermap-cacti-rebuild.php b/weathermap-cacti-rebuild.php index 34cb60e..984c720 100644 --- a/weathermap-cacti-rebuild.php +++ b/weathermap-cacti-rebuild.php @@ -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'); From 4e99c7b2b750e3174350a4a888b33408f738c5b6 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 18 May 2026 11:39:12 -0400 Subject: [PATCH 2/3] fix: Formatting for Cacti develop release --- lib/editor.inc.php | 2 +- weathermap-cacti-plugin-mgmt.php | 34 ++++++++++++++++---------------- weathermap-cacti-plugin.php | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/editor.inc.php b/lib/editor.inc.php index f8f1df6..40313b3 100644 --- a/lib/editor.inc.php +++ b/lib/editor.inc.php @@ -262,7 +262,7 @@ function show_editor_startpage() { $errormessage .= $configerror . '

'; } - 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 ''; print ''; print '

' . __('NOTE: 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') . '
'; diff --git a/weathermap-cacti-plugin-mgmt.php b/weathermap-cacti-plugin-mgmt.php index 2225e12..b0306d2 100644 --- a/weathermap-cacti-plugin-mgmt.php +++ b/weathermap-cacti-plugin-mgmt.php @@ -478,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 @@ -565,7 +565,7 @@ function weathermap_footer_links() { print '
'; - html_start_box('' . __('Local Documentation', 'weathermap') . ' -- ' . __('Weathermap Website', 'weathermap') . ' -- ' . __('Weathermap Editor', 'weathermap') . ' -- ' . __('This is version %s', $weathermap_version), '100%', '', '3', 'center', ''); + html_start_box('' . __('Local Documentation', 'weathermap') . ' -- ' . __('Weathermap Website', 'weathermap') . ' -- ' . __('Weathermap Editor', 'weathermap') . ' -- ' . __('This is version %s', $weathermap_version), '100%', false, 3, 'center', ''); html_end_box(); } @@ -695,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'); ?> @@ -912,7 +912,7 @@ function maplist() { print $nav; - html_start_box('', '100%', '', '3', 'center', ''); + html_start_box('', '100%', false, 3, 'center', ''); $display_text = [ [ @@ -1181,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', ''); ?> @@ -1231,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', ''); ?> @@ -1437,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); @@ -1521,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 ''; print '
';
@@ -1814,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', '');
 	?>
 	
 		
@@ -2119,7 +2119,7 @@ function perms_list($id) {
 
 	print $nav;
 
-	html_start_box('', '100%', '', '3', 'center', '');
+	html_start_box('', '100%', false, 3, 'center', '');
 
 	$display_text = [
 		[
@@ -2274,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 '';
 
@@ -2304,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);
@@ -2376,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')]);
 
@@ -2479,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]);
 
@@ -2574,7 +2574,7 @@ function weathermap_chgroup($id) {
 	print "";
 	print "";
 
-	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();
@@ -2627,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 '';
 
@@ -2654,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);
 
diff --git a/weathermap-cacti-plugin.php b/weathermap-cacti-plugin.php
index db1b840..35fc2e4 100644
--- a/weathermap-cacti-plugin.php
+++ b/weathermap-cacti-plugin.php
@@ -766,7 +766,7 @@ function weathermap_footer_links() {
 
 	print '
'; - html_start_box("
Local Documentation -- Weathermap Website -- Weathermap Editor -- This is version $weathermap_version
", '100%', '', '3', 'center', ''); + html_start_box("
Local Documentation -- Weathermap Website -- Weathermap Editor -- This is version $weathermap_version
", '100%', false, 3, 'center', ''); html_end_box(); } @@ -793,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', ''); ?> From 606ae606ae14b77159ae545ac77c3fa7f86590b5 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 18 May 2026 11:43:04 -0400 Subject: [PATCH 3/3] fix: Dont run coding standards yet --- .github/workflows/plugin-ci-workflow.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index 7c0a007..e806000 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -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 @@ -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