diff --git a/plugins/system/helixultimate/assets/js/admin/helix-ultimate.js b/plugins/system/helixultimate/assets/js/admin/helix-ultimate.js index 00a38fb8..41c63252 100644 --- a/plugins/system/helixultimate/assets/js/admin/helix-ultimate.js +++ b/plugins/system/helixultimate/assets/js/admin/helix-ultimate.js @@ -565,17 +565,25 @@ jQuery(function ($) { if (data.status) { let $previewFrame = document.getElementById('hu-template-preview'); $previewFrame.contentWindow.location.reload(true); + + Joomla.HelixToaster.success('Changes have been successfully saved!', 'Success'); + $('.hu-loading-msg').hide(); + $('.hu-done-msg').hide(); + $('.action-reset-drafts').hide(); + showSaveLoader(false); + } else { + Joomla.HelixToaster.error(data.message, 'Failed'); + $('.hu-loading-msg').hide(); + $('.hu-done-msg').hide(); + $('.action-reset-drafts').hide(); + showSaveLoader(false); } // Update the setvalues. updateSetvalue(); + }, complete() { - Joomla.HelixToaster.success('Changes have been successfully saved!', 'Success'); - $('.hu-loading-msg').hide(); - $('.hu-done-msg').hide(); - $('.action-reset-drafts').hide(); - showSaveLoader(false); }, error: function (err) { console.error('error', err); diff --git a/plugins/system/helixultimate/helixultimate.php b/plugins/system/helixultimate/helixultimate.php index fe5db16a..a73edb27 100644 --- a/plugins/system/helixultimate/helixultimate.php +++ b/plugins/system/helixultimate/helixultimate.php @@ -71,7 +71,9 @@ class PlgSystemHelixultimate extends CMSPlugin */ public function onAfterInitialise() { - + if (JVERSION < 4) { + $this->registerBootstrap(); + } } /** diff --git a/plugins/system/helixultimate/overrides/com_finder/search/default.php b/plugins/system/helixultimate/overrides/com_finder/search/default.php index d1429b67..8b8e910b 100644 --- a/plugins/system/helixultimate/overrides/com_finder/search/default.php +++ b/plugins/system/helixultimate/overrides/com_finder/search/default.php @@ -12,16 +12,16 @@ use Joomla\CMS\Language\Text; -if(JVERSION < 4) +if (JVERSION < 4) { HTMLHelper::_('behavior.core'); HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html'); - + HTMLHelper::_('stylesheet', 'com_finder/finder.css', array('version' => 'auto', 'relative' => true)); HTMLHelper::_('stylesheet', 'vendor/awesomplete/awesomplete.css', array('version' => 'auto', 'relative' => true)); - + Text::script('MOD_FINDER_SEARCH_VALUE', true); - + HTMLHelper::_('script', 'com_finder/finder.js', array('version' => 'auto', 'relative' => true)); } else diff --git a/plugins/system/helixultimate/overrides/com_finder/search/default_result.php b/plugins/system/helixultimate/overrides/com_finder/search/default_result.php index 4f644dbf..35defdb1 100644 --- a/plugins/system/helixultimate/overrides/com_finder/search/default_result.php +++ b/plugins/system/helixultimate/overrides/com_finder/search/default_result.php @@ -40,6 +40,14 @@ $route = $this->result->route; +$showImage = $this->params->get('show_image', 0); +$imageClass = $this->params->get('image_class', ''); +$extraAttr = []; + +if ($showImage && !empty($this->result->imageUrl) && $imageClass !== '') { + $extraAttr['class'] = $imageClass; +} + // Get the route with highlighting information. if (!empty($this->query->highlight) && empty($this->result->mime) @@ -51,6 +59,25 @@ ?>
  • + result->imageUrl)) : ?> + result->imageUrl; + $imageAlt = $this->result->imageAlt; + if (!empty($this->result->params->get('helix_ultimate_image'))) { + $imageUrl = $this->result->params->get('helix_ultimate_image'); + $imageAlt = $this->result->title; + } + ?> +
    + params->get('link_image') && $this->result->route) : ?> + + + + + + +
    +

    result->title; ?> diff --git a/plugins/system/helixultimate/src/Platform/Request.php b/plugins/system/helixultimate/src/Platform/Request.php index 52f6a6ca..338336d9 100644 --- a/plugins/system/helixultimate/src/Platform/Request.php +++ b/plugins/system/helixultimate/src/Platform/Request.php @@ -10,6 +10,8 @@ defined('_JEXEC') or die(); +use DateTime; +use Exception; use HelixUltimate\Framework\HttpResponse\Response; use HelixUltimate\Framework\Platform\Blog; use HelixUltimate\Framework\Platform\Helper; @@ -228,6 +230,17 @@ private function saveTemplateStyle() Session::checkToken() or die(json_encode($this->report)); $data = $_POST; + + $data['comingsoon_date'] = date('Y-m-d', strtotime($data['comingsoon_date'])); + $dateStatus = $this->validateDate($data['comingsoon_date']); + + if (!$dateStatus) { + $this->report['status'] = false; + $this->report['message'] = 'Coming Soon Date for Countdown is invalid'; + $this->report['isDrafted'] = Helper::isDrafted(); + return; + } + $inputs = $this->filterInputs($data); if (!$this->id || !is_int($this->id)) @@ -260,6 +273,13 @@ private function saveTemplateStyle() } } + private function validateDate($date, $format = 'Y-m-d') + { + $d = DateTime::createFromFormat($format, $date); + // The Y ( 4 digits year ) returns TRUE for any integer with any number of digits so changing the comparison from == to === fixes the issue. + return $d && $d->format($format) === $date; + } + private function draftTemplateStyle() { $this->report['status'] = false; diff --git a/templates/shaper_helixultimate/options.json b/templates/shaper_helixultimate/options.json index a3c0f1db..84ab2b77 100644 --- a/templates/shaper_helixultimate/options.json +++ b/templates/shaper_helixultimate/options.json @@ -51,7 +51,7 @@ "contact_time": "", "comingsoon_title": "Coming Soon Title", "comingsoon_content": "Coming soon content", - "comingsoon_date": "1-1-2025", + "comingsoon_date": "2025-01-01", "comingsoon_logo": "", "comingsoon_bg_image": "", "error_logo": "",