diff --git a/Weathermap.php b/Weathermap.php index 430c390d..bd87d231 100644 --- a/Weathermap.php +++ b/Weathermap.php @@ -1,35 +1,39 @@ '; - $count = 0; - foreach ($files as $file=>$data) { - $nicefile = htmlspecialchars($file); - $submenu .= '
'; print 'If it\'s a major issue for you, please feel free to complain. It\'s mainly laziness as I said, and there could be a fallback (not so smooth) mode for non-javascript browsers if it was seen to be worthwhile (I would take a bit of convincing, because I don\'t see a benefit, personally).
'; } - + if ( !$librenms_found && !$ignore_librenms) { //$errormessage .= '$cacti_base is not set correctly. Cacti integration will be disabled in the editor.'; //$errormessage .= "$librenms_found and $ignore_librenms"; - //if ($config_loaded != 1) { - //$errormessage .= " You might need to copy editor-config.php-dist to editor-config.php and edit it."; + //if ($config_loaded != 1) { + //$errormessage .= " You might need to copy editor-config.php-dist to editor-config.php and edit it."; //} } - + if ($errormessage != '') { print '
'; - + print 'Do you want to:
'; print 'Create A New Map:'; if($action == 'newmap') { @@ -243,7 +242,7 @@ function show_editor_startpage() while (false !== ($file = readdir($dh))) { $realfile=$mapdir . DIRECTORY_SEPARATOR . $file; $note = ""; - + // skip directories, unreadable files, .files and anything that doesn't come through the sanitiser unchanged if ( (is_file($realfile)) && (is_readable($realfile)) && (!preg_match("/^\./",$file) ) && ( wm_editor_sanitize_conffile($file) == $file ) ) { if (!is_writable($realfile)) { @@ -254,12 +253,12 @@ function show_editor_startpage() if ($fd) { while (!feof($fd)) { $buffer=fgets($fd, 4096); - - if (preg_match("/^\s*TITLE\s+(.*)/i", $buffer, $matches)) { - $title= wm_editor_sanitize_string($matches[1]); + + if (preg_match("/^\s*TITLE\s+(.*)/i", $buffer, $matches)) { + $title= wm_editor_sanitize_string($matches[1]); } } - + fclose ($fd); $titles[$file] = $title; $notes[$file] = $note; @@ -269,17 +268,17 @@ function show_editor_startpage() } closedir ($dh); - } else { - $errorstring = "Can't open mapdir to read."; + } else { + $errorstring = "Can't open mapdir to read."; } - + ksort($titles); - - if ($n == 0) { - $errorstring = "No files in mapdir"; + + if ($n == 0) { + $errorstring = "No files in mapdir"; } - } else { - $errorstring = "NO DIRECTORY named $mapdir"; + } else { + $errorstring = "NO DIRECTORY named $mapdir"; } print 'ORCreate A New Map as a copy of an existing map:'; @@ -289,7 +288,7 @@ function show_editor_startpage() print ''; print ''; print ''; - + if ($errorstring == '') { foreach ($titles as $file=>$title) { $nicefile = htmlspecialchars($file); @@ -298,7 +297,7 @@ function show_editor_startpage() } else { print ''.htmlspecialchars($errorstring).''; } - + print ''; print ''; print '