From 5601b14d5f5330fdb061b0ca4af408ee958002ec Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Thu, 6 Feb 2020 18:07:04 +0900 Subject: [PATCH] DEFINE capital fix, JS action indicator fix, basic class date check fix - captial DEFINE is now lower case - indicator is visible check in javascript for showing indicator - remove not needed overlay box 100% css, this is set in the stylesheet anway - Fix array pad missing in date compare functions in Basic class --- www/configs/config.other.php | 2 +- www/layout/admin/javascript/edit.jq.js | 17 ++++++++--------- www/lib/CoreLibs/Basic.php | 10 +++++----- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/www/configs/config.other.php b/www/configs/config.other.php index 5a0cafaf..e16a09af 100755 --- a/www/configs/config.other.php +++ b/www/configs/config.other.php @@ -20,7 +20,7 @@ $paths = array( foreach ($paths as $path) { if (file_exists($path.DS.'convert') && is_file($path.DS.'convert')) { // image magick convert location - DEFINE('CONVERT', $path.DS.'convert'); + define('CONVERT', $path.DS.'convert'); } } unset($paths); diff --git a/www/layout/admin/javascript/edit.jq.js b/www/layout/admin/javascript/edit.jq.js index c1ce5906..43512c83 100644 --- a/www/layout/admin/javascript/edit.jq.js +++ b/www/layout/admin/javascript/edit.jq.js @@ -419,9 +419,11 @@ function actionIndicator(loc, overlay = true) function actionIndicatorShow(loc, overlay = true) { console.log('Indicator: SHOW [%s]', loc); - $('#indicator').addClass('progress'); - setCenter('indicator', true, true); - $('#indicator').show(); + if (!$('#indicator').is(':visible')) { + $('#indicator').addClass('progress'); + setCenter('indicator', true, true); + $('#indicator').show(); + } if (overlay === true) { overlayBoxShow(); } @@ -475,12 +477,9 @@ function overlayBoxHide() */ function setOverlayBox() { -/* var viewport = document.viewport.getDimensions(); - $('#overlayBox').css ({ - width: '100%', - height: '100%' - });*/ - $('#overlayBox').show(); + if (!$('#overlayBox').is(':visible')) { + $('#overlayBox').show(); + } } /** diff --git a/www/lib/CoreLibs/Basic.php b/www/lib/CoreLibs/Basic.php index 447ef6a5..3f60413d 100644 --- a/www/lib/CoreLibs/Basic.php +++ b/www/lib/CoreLibs/Basic.php @@ -1255,7 +1255,7 @@ class Basic public static function getPageName(int $strip_ext = 0): string { // get the file info - $page_temp = pathinfo($_SERVER["PHP_SELF"]); + $page_temp = pathinfo($_SERVER['PHP_SELF']); if ($strip_ext == 1) { return $page_temp['filename']; } elseif ($strip_ext == 2) { @@ -1955,7 +1955,7 @@ class Basic if (!$date) { return false; } - list ($year, $month, $day) = preg_split("/[\/-]/", $date); + list ($year, $month, $day) = array_pad(preg_split("/[\/-]/", $date), 3, null); if (!$year || !$month || !$day) { return false; } @@ -2013,13 +2013,13 @@ class Basic } // splits the data up with / or - - list ($start_year, $start_month, $start_day) = preg_split('/[\/-]/', $start_date); - list ($end_year, $end_month, $end_day) = preg_split('/[\/-]/', $end_date); + list ($start_year, $start_month, $start_day) = array_pad(preg_split('/[\/-]/', $start_date), 3, null); + list ($end_year, $end_month, $end_day) = array_pad(preg_split('/[\/-]/', $end_date), 3, null); // check that month & day are two digits and then combine foreach (array('start', 'end') as $prefix) { foreach (array('month', 'day') as $date_part) { $_date = $prefix.'_'.$date_part; - if ($$_date < 10 && !preg_match("/^0/", $$_date)) { + if (isset($$_date) && $$_date < 10 && !preg_match("/^0/", $$_date)) { $$_date = '0'.$$_date; } }