From a97e2743d6f46a200ce2ac1c5ff5553a35b4ef1b Mon Sep 17 00:00:00 2001 From: PipoCanaja Date: Tue, 17 Jul 2018 18:23:14 +0200 Subject: [PATCH 1/4] A few more consequences of the Namespace --- Weathermap.inc.php | 2 +- Weathermap.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Weathermap.inc.php b/Weathermap.inc.php index c0087da2..e466de1e 100644 --- a/Weathermap.inc.php +++ b/Weathermap.inc.php @@ -2,7 +2,7 @@ // Assume that this should only be printed if it's not setup correctly. if(! is_writable('plugins/Weathermap/configs')) { - print_error("The map config directory is not writable by the web server user. You will not be able to edit any files until this is corrected."); + echo("The map config directory is not writable by the web server user. You will not be able to edit any files until this is corrected."); $readme = @file_get_contents('plugins/Weathermap/INSTALL.md'); $readme = nl2br($readme); echo('

Please ensure you follow the installation instructions below.

'); diff --git a/Weathermap.php b/Weathermap.php index 688a5d79..92ad5f53 100644 --- a/Weathermap.php +++ b/Weathermap.php @@ -16,21 +16,29 @@ public static function menu() { //Create submenu $submenu = ' '; //Display it if not empty if ($count > 0) { - echo(''); } else { //Create menu without submenu - echo('
  • Weathermap
  • '); + echo('
  • '.$short.'
  • '); } } } From 14dd5c414eadf8237b246a67e5e7e478f586a8fa Mon Sep 17 00:00:00 2001 From: PipoCanaja Date: Tue, 17 Jul 2018 18:36:31 +0200 Subject: [PATCH 2/4] A few more consequences of the Namespace --- Weathermap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Weathermap.php b/Weathermap.php index 92ad5f53..5b3ab519 100644 --- a/Weathermap.php +++ b/Weathermap.php @@ -33,7 +33,7 @@ public static function menu() { //Display it if not empty if ($count > 0) { - echo(''); } else { From bdf891cd285f45f1985d233f2a6d6e228d90ec78 Mon Sep 17 00:00:00 2001 From: PipoCanaja Date: Wed, 18 Jul 2018 08:57:06 +0200 Subject: [PATCH 3/4] Cleaning after Plugin FIX --- Weathermap.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Weathermap.php b/Weathermap.php index 5b3ab519..20b10516 100644 --- a/Weathermap.php +++ b/Weathermap.php @@ -1,7 +1,5 @@ '; $count = 0; - //getShortName - might make sense to include this ShortName code into Plugin class somewhere ? - if ($pos = strrpos(get_class(), '\\')) { - $short= substr(get_class(), $pos + 1); - } else { - $short = $pos; - }; + $short = __CLASS__; foreach ($files as $file=>$data) { $nicefile = htmlspecialchars($file); From 4c7ada149a10098e79a34332476a6e51fc288586 Mon Sep 17 00:00:00 2001 From: PipoCanaja Date: Wed, 18 Jul 2018 08:59:25 +0200 Subject: [PATCH 4/4] Cleaning after Plugin FIX --- Weathermap.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Weathermap.inc.php b/Weathermap.inc.php index e466de1e..c0087da2 100644 --- a/Weathermap.inc.php +++ b/Weathermap.inc.php @@ -2,7 +2,7 @@ // Assume that this should only be printed if it's not setup correctly. if(! is_writable('plugins/Weathermap/configs')) { - echo("The map config directory is not writable by the web server user. You will not be able to edit any files until this is corrected."); + print_error("The map config directory is not writable by the web server user. You will not be able to edit any files until this is corrected."); $readme = @file_get_contents('plugins/Weathermap/INSTALL.md'); $readme = nl2br($readme); echo('

    Please ensure you follow the installation instructions below.

    ');