diff --git a/admin/controller/module/promo_top_bar_nat.php b/admin/controller/module/promo_top_bar_nat.php index 14f64c3..cf4469c 100644 --- a/admin/controller/module/promo_top_bar_nat.php +++ b/admin/controller/module/promo_top_bar_nat.php @@ -205,6 +205,8 @@ class PromoTopBarNat extends \Opencart\System\Engine\Controller { 'module_promo_top_bar_nat_show_desktop' => '1', 'module_promo_top_bar_nat_show_mobile' => '1', 'module_promo_top_bar_nat_height' => '45px', + 'module_promo_top_bar_nat_padding_top' => '0', + 'module_promo_top_bar_nat_padding_bottom' => '0', 'module_promo_top_bar_nat_border_radius' => '0px', 'module_promo_top_bar_nat_shadow' => 'none', 'module_promo_top_bar_nat_shadow_custom' => '', @@ -294,14 +296,26 @@ class PromoTopBarNat extends \Opencart\System\Engine\Controller { $this->load->model('localisation/language'); if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { - if (isset($this->request->post['module_promo_top_bar_nat_slides_json'])) { - $slides = json_decode(html_entity_decode($this->request->post['module_promo_top_bar_nat_slides_json'], ENT_QUOTES, 'UTF-8'), true); - if (is_array($slides)) { - $this->request->post['module_promo_top_bar_nat_slides'] = $this->encodeSlides($slides); + $is_full_save = isset($this->request->post['module_promo_top_bar_nat_status']); + + if ($is_full_save) { + $this->request->post['module_promo_top_bar_nat_show_desktop'] = isset($this->request->post['module_promo_top_bar_nat_show_desktop']) ? 1 : 0; + $this->request->post['module_promo_top_bar_nat_show_mobile'] = isset($this->request->post['module_promo_top_bar_nat_show_mobile']) ? 1 : 0; + + if (isset($this->request->post['module_promo_top_bar_nat_slides_json'])) { + $slides = json_decode(html_entity_decode($this->request->post['module_promo_top_bar_nat_slides_json'], ENT_QUOTES, 'UTF-8'), true); + if (is_array($slides)) { + $this->request->post['module_promo_top_bar_nat_slides'] = $this->encodeSlides($slides); + } + unset($this->request->post['module_promo_top_bar_nat_slides_json']); + } elseif (isset($this->request->post['module_promo_top_bar_nat_slides']) && is_array($this->request->post['module_promo_top_bar_nat_slides'])) { + $this->request->post['module_promo_top_bar_nat_slides'] = $this->encodeSlides($this->request->post['module_promo_top_bar_nat_slides']); } + } else { + $existing_settings = $this->model_setting_setting->getSetting('module_promo_top_bar_nat'); unset($this->request->post['module_promo_top_bar_nat_slides_json']); - } elseif (isset($this->request->post['module_promo_top_bar_nat_slides']) && is_array($this->request->post['module_promo_top_bar_nat_slides'])) { - $this->request->post['module_promo_top_bar_nat_slides'] = $this->encodeSlides($this->request->post['module_promo_top_bar_nat_slides']); + unset($this->request->post['module_promo_top_bar_nat_slides']); + $this->request->post = array_merge($existing_settings, $this->request->post); } $posted_lic = isset($this->request->post['module_promo_top_bar_nat_license']) ? trim((string)$this->request->post['module_promo_top_bar_nat_license']) : ''; @@ -431,6 +445,8 @@ class PromoTopBarNat extends \Opencart\System\Engine\Controller { 'module_promo_top_bar_nat_show_desktop', 'module_promo_top_bar_nat_show_mobile', 'module_promo_top_bar_nat_height', + 'module_promo_top_bar_nat_padding_top', + 'module_promo_top_bar_nat_padding_bottom', 'module_promo_top_bar_nat_border_radius', 'module_promo_top_bar_nat_shadow', 'module_promo_top_bar_nat_shadow_custom', @@ -574,17 +590,28 @@ class PromoTopBarNat extends \Opencart\System\Engine\Controller { } if (!$json) { - if (isset($this->request->post['module_promo_top_bar_nat_slides_json'])) { - $slides = json_decode(html_entity_decode($this->request->post['module_promo_top_bar_nat_slides_json'], ENT_QUOTES, 'UTF-8'), true); - if (is_array($slides)) { - $this->request->post['module_promo_top_bar_nat_slides'] = $this->encodeSlides($slides); - } - unset($this->request->post['module_promo_top_bar_nat_slides_json']); - } elseif (isset($this->request->post['module_promo_top_bar_nat_slides']) && is_array($this->request->post['module_promo_top_bar_nat_slides'])) { - $this->request->post['module_promo_top_bar_nat_slides'] = $this->encodeSlides($this->request->post['module_promo_top_bar_nat_slides']); - } - $this->load->model('setting/setting'); + $is_full_save = isset($this->request->post['module_promo_top_bar_nat_status']); + + if ($is_full_save) { + $this->request->post['module_promo_top_bar_nat_show_desktop'] = isset($this->request->post['module_promo_top_bar_nat_show_desktop']) ? 1 : 0; + $this->request->post['module_promo_top_bar_nat_show_mobile'] = isset($this->request->post['module_promo_top_bar_nat_show_mobile']) ? 1 : 0; + + if (isset($this->request->post['module_promo_top_bar_nat_slides_json'])) { + $slides = json_decode(html_entity_decode($this->request->post['module_promo_top_bar_nat_slides_json'], ENT_QUOTES, 'UTF-8'), true); + if (is_array($slides)) { + $this->request->post['module_promo_top_bar_nat_slides'] = $this->encodeSlides($slides); + } + unset($this->request->post['module_promo_top_bar_nat_slides_json']); + } elseif (isset($this->request->post['module_promo_top_bar_nat_slides']) && is_array($this->request->post['module_promo_top_bar_nat_slides'])) { + $this->request->post['module_promo_top_bar_nat_slides'] = $this->encodeSlides($this->request->post['module_promo_top_bar_nat_slides']); + } + } else { + $existing_settings = $this->model_setting_setting->getSetting('module_promo_top_bar_nat'); + unset($this->request->post['module_promo_top_bar_nat_slides_json']); + unset($this->request->post['module_promo_top_bar_nat_slides']); + $this->request->post = array_merge($existing_settings, $this->request->post); + } $posted_lic = isset($this->request->post['module_promo_top_bar_nat_license']) ? trim((string)$this->request->post['module_promo_top_bar_nat_license']) : ''; $this->request->post['module_promo_top_bar_nat_license'] = $posted_lic; diff --git a/admin/language/en-gb/module/promo_top_bar_nat.php b/admin/language/en-gb/module/promo_top_bar_nat.php index c2de85e..ebc6f91 100644 --- a/admin/language/en-gb/module/promo_top_bar_nat.php +++ b/admin/language/en-gb/module/promo_top_bar_nat.php @@ -134,7 +134,7 @@ $_['text_info_title_database_optimizer'] = 'Database Optimizer [NAT]'; $_['text_info_desc_database_optimizer'] = 'Intelligent database garbage collection, system log management, and adding critical indexes for site speedup.'; $_['text_info_title_image_optimizer'] = 'Image Optimizer [NAT]'; $_['text_info_desc_image_optimizer'] = 'Original image compression to WebP + Mass cleanup of unused images on the server.'; -$_['text_info_title_domain_scanner'] = 'Domain Scanner [NAT] Current module'; +$_['text_info_title_domain_scanner'] = 'Domain Scanner [NAT]'; $_['text_info_desc_domain_scanner'] = 'Search and clean external links and HTTP images in DB and theme files. Perfect for HTTPS migration or parsing cleanup.'; $_['text_info_title_new_arrivals'] = 'New Arrivals [NAT]: True Sort by Date'; $_['text_info_desc_new_arrivals'] = 'Automatic SEO page for new arrivals. Displays items strictly by actual added date. Sliders, grids, and smart date archive sidebar.'; diff --git a/admin/language/ru-ru/module/promo_top_bar_nat.php b/admin/language/ru-ru/module/promo_top_bar_nat.php index 8771bc2..8012e99 100644 --- a/admin/language/ru-ru/module/promo_top_bar_nat.php +++ b/admin/language/ru-ru/module/promo_top_bar_nat.php @@ -134,7 +134,7 @@ $_['text_info_title_database_optimizer'] = 'Database Optimizer [NAT]'; $_['text_info_desc_database_optimizer'] = 'Интеллектуальная очистка мусора в БД, управление системными логами и добавление критических индексов для ускорения сайта.'; $_['text_info_title_image_optimizer'] = 'Image Optimizer [NAT]'; $_['text_info_desc_image_optimizer'] = 'Сжатие оригинальных изображений в WebP + массовая очистка неиспользуемых картинок на сервере.'; -$_['text_info_title_domain_scanner'] = 'Domain Scanner [NAT] Текущий модуль'; +$_['text_info_title_domain_scanner'] = 'Domain Scanner [NAT]'; $_['text_info_desc_domain_scanner'] = 'Поиск и очистка внешних ссылок и картинок по HTTP в БД и файлах темы. Идеально для перехода на HTTPS или очистки после парсинга.'; $_['text_info_title_new_arrivals'] = 'New Arrivals [NAT]: True Sort by Date'; $_['text_info_desc_new_arrivals'] = 'Автоматическая SEO страница для новинок. Выводит товары строго по реальной дате добавления. Слайдеры, сетки и умный сайдбар архива дат.'; diff --git a/admin/language/uk-ua/module/promo_top_bar_nat.php b/admin/language/uk-ua/module/promo_top_bar_nat.php index 33649e0..e9879f4 100644 --- a/admin/language/uk-ua/module/promo_top_bar_nat.php +++ b/admin/language/uk-ua/module/promo_top_bar_nat.php @@ -134,7 +134,7 @@ $_['text_info_title_database_optimizer'] = 'Database Optimizer [NAT]'; $_['text_info_desc_database_optimizer'] = 'Інтелектуальне очищення сміття в БД, управління системними логами та додавання критичних індексів для прискорення сайту.'; $_['text_info_title_image_optimizer'] = 'Image Optimizer [NAT]'; $_['text_info_desc_image_optimizer'] = 'Стиснення оригінальних зображень у WebP + масове очищення невикористовуваних картинок на сервері.'; -$_['text_info_title_domain_scanner'] = 'Domain Scanner [NAT] Поточний модуль'; +$_['text_info_title_domain_scanner'] = 'Domain Scanner [NAT]'; $_['text_info_desc_domain_scanner'] = 'Пошук та очищення зовнішніх посилань та зображень по HTTP в БД та файлах теми. Ідеально для переходу на HTTPS або очищення після парсингу.'; $_['text_info_title_new_arrivals'] = 'New Arrivals [NAT]: True Sort by Date'; $_['text_info_desc_new_arrivals'] = 'Автоматична SEO-сторінка для новинок. Виводить товари строго за датою додавання. Слайдери, сітки та розумний сайдбар архіву дат.'; diff --git a/admin/view/template/module/promo_top_bar_nat.twig b/admin/view/template/module/promo_top_bar_nat.twig index 0e3df61..09dc98e 100644 --- a/admin/view/template/module/promo_top_bar_nat.twig +++ b/admin/view/template/module/promo_top_bar_nat.twig @@ -566,6 +566,9 @@ body.nat-dark-mode .nat-settings-license-row { {% endif %} {% if is_licensed %} + +
+