Add Creative Elements templates and update index files

- Introduced new templates for catalog, checkout, contact, and error pages.
- Implemented caching headers and redirection in index.php files across various directories.
- Enhanced product and layout templates for better integration with Creative Elements.
- Added backoffice header styles and scripts for improved UI/UX in the admin panel.
This commit is contained in:
2025-07-01 00:56:07 +02:00
parent f00cd5b992
commit 6cc26c0ed2
642 changed files with 213294 additions and 12 deletions

View File

@@ -0,0 +1,16 @@
<?php
/**
* Creative Elements - live Theme & Page Builder
*
* @author WebshopWorks
* @copyright 2019-2022 WebshopWorks.com
* @license One domain support license
*/
header('Expires: Thu, 28 Feb 2019 00:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../../../');
die;

View File

@@ -0,0 +1,51 @@
<?php
/**
* Creative Elements - live Theme & Page Builder
*
* @author WebshopWorks
* @copyright 2019-2022 WebshopWorks.com
* @license One domain support license
*/
defined('_PS_VERSION_') or die;
function upgrade_module_1_0_0($module)
{
require_once _CE_PATH_ . 'classes/CEDatabase.php';
require_once _CE_PATH_ . 'classes/CEMigrate.php';
Shop::isFeatureActive() && Shop::setContext(Shop::CONTEXT_ALL);
$res = $module->uninstallOverrides() && $module->installOverrides();
CEDatabase::initConfigs();
CEDatabase::createTables();
CEDatabase::updateTabs();
foreach (CEDatabase::getHooks(false) as $hook) {
$res = $res && $module->registerHook($hook);
}
CEMigrate::moveConfigs();
if ($res && CEMigrate::storeIds()) {
ob_start(function ($json) use ($module) {
$data = json_decode($json, true);
if (!empty($data[$module->name]['status'])) {
// Upgrade
$data[$module->name]['msg'] .= CEMigrate::renderJavaScripts();
$json = json_encode($data);
} elseif (!empty($data['status'])) {
// Upload
$data['msg'] .= CEMigrate::renderJavaScripts();
$data['status'] = false;
$json = json_encode($data);
}
return $json;
});
}
return $res;
}

View File

@@ -0,0 +1,45 @@
<?php
/**
* Creative Elements - live Theme & Page Builder
*
* @author WebshopWorks
* @copyright 2019-2022 WebshopWorks.com
* @license One domain support license
*/
defined('_PS_VERSION_') or die;
function upgrade_module_1_4_10($module)
{
Shop::isFeatureActive() && Shop::setContext(Shop::CONTEXT_ALL);
Configuration::updateValue('elementor_max_revisions', 10);
Configuration::updateValue('elementor_space_between_widgets', 20);
Configuration::updateValue('elementor_page_title_selector', 'header.page-header');
Configuration::updateValue('elementor_page_wrapper_selector', '#content, #wrapper, #wrapper .container');
$ce_revision = _DB_PREFIX_ . 'ce_revision';
$engine = _MYSQL_ENGINE_;
$result = Db::getInstance()->execute("
CREATE TABLE IF NOT EXISTS `$ce_revision` (
`id_ce_revision` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`parent` bigint(20) UNSIGNED NOT NULL,
`id_employee` int(10) UNSIGNED NOT NULL,
`title` varchar(255) NOT NULL,
`content` longtext NOT NULL,
`active` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_ce_revision`),
KEY `id` (`parent`),
KEY `date_add` (`date_upd`)
) ENGINE=$engine DEFAULT CHARSET=utf8;
");
$result &= $module->registerHook('actionObjectCERevisionDeleteAfter');
$result &= $module->registerHook('actionProductAdd');
$result &= $module->registerHook('CETemplate');
CE\Plugin::instance()->files_manager->clearCache();
Media::clearCache();
return $result;
}

View File

@@ -0,0 +1,45 @@
<?php
/**
* Creative Elements - live PageBuilder [in-stock]
*
* @author WebshopWorks
* @copyright 2019-2022 WebshopWorks.com
* @license In-stock license
*/
defined('_PS_VERSION_') or die;
function upgrade_module_2_5_0($module)
{
require_once _CE_PATH_ . 'classes/CEDatabase.php';
require_once _CE_PATH_ . 'upgrade/upgrade-2.5.5.php';
Shop::isFeatureActive() && Shop::setContext(Shop::CONTEXT_ALL);
Configuration::hasKey('elementor_viewport_lg') or Configuration::updateValue('elementor_viewport_lg', 1025);
Configuration::hasKey('elementor_viewport_md') or Configuration::updateValue('elementor_viewport_md', 768);
Configuration::hasKey('elementor_global_image_lightbox') or Configuration::updateValue('elementor_global_image_lightbox', 1);
Configuration::hasKey('elementor_edit_buttons') or Configuration::updateValue('elementor_edit_buttons', 'on');
try {
// Add `type` to ce_revision table
$db = Db::getInstance();
$ce_revision = _DB_PREFIX_ . 'ce_revision';
$db->execute("ALTER TABLE `$ce_revision` ADD `type` varchar(64) NOT NULL DEFAULT '' AFTER `title`");
} catch (Exception $ex) {
// Do nothing when `type` already exists
}
foreach (Tab::getCollectionFromModule($module->name) as $tab) {
$tab->delete();
}
CEDatabase::updateTabs();
// Clear caches
CE\Plugin::instance()->files_manager->clearCache();
Media::clearCache();
return $module->registerHook('actionObjectCEContentDeleteAfter') && (
version_compare($module->version, '2.5.5', '>=') || upgrade_module_2_5_5($module)
);
}

View File

@@ -0,0 +1,27 @@
<?php
/**
* Creative Elements - live Theme & Page Builder
*
* @author WebshopWorks
* @copyright 2019-2022 WebshopWorks.com
* @license One domain support license
*/
defined('_PS_VERSION_') or die;
function upgrade_module_2_5_10($module)
{
Shop::isFeatureActive() && Shop::setContext(Shop::CONTEXT_ALL);
require_once _CE_PATH_ . 'classes/CEDatabase.php';
$result = CEDatabase::updateTabs();
$result &= $module->registerHook('actionFrontControllerInitAfter', null, 1);
CEDatabase::initConfigs();
CE\Plugin::instance()->files_manager->clearCache();
Media::clearCache();
return $result;
}

View File

@@ -0,0 +1,21 @@
<?php
/**
* Creative Elements - live Theme & Page Builder
*
* @author WebshopWorks
* @copyright 2019-2022 WebshopWorks.com
* @license One domain support license
*/
defined('_PS_VERSION_') or die;
function upgrade_module_2_5_11($module)
{
Shop::isFeatureActive() && Shop::setContext(Shop::CONTEXT_ALL);
Media::clearCache();
copy(_CE_PATH_ . 'views/lib/filemanager/config.php', _PS_IMG_DIR_ . 'cms/config.php');
return $module->registerHook('actionFrontControllerAfterInit', null, 1);
}

View File

@@ -0,0 +1,84 @@
<?php
/**
* Creative Elements - live Theme & Page Builder
*
* @author WebshopWorks
* @copyright 2019-2022 WebshopWorks.com
* @license One domain support license
*/
defined('_PS_VERSION_') or die;
function upgrade_module_2_5_2($module)
{
require_once _CE_PATH_ . 'classes/CEDatabase.php';
Shop::isFeatureActive() && Shop::setContext(Shop::CONTEXT_ALL);
Configuration::updateValue('elementor_viewport_lg', 1025);
Configuration::updateValue('elementor_viewport_md', 768);
Configuration::updateValue('elementor_global_image_lightbox', 1);
Configuration::updateValue('elementor_edit_buttons', 'on');
$db = Db::getInstance();
$ce_theme = _DB_PREFIX_ . 'ce_theme';
$ce_revision = _DB_PREFIX_ . 'ce_revision';
$engine = _MYSQL_ENGINE_;
$result = $db->execute("
CREATE TABLE IF NOT EXISTS `$ce_theme` (
`id_ce_theme` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_employee` int(10) UNSIGNED NOT NULL,
`type` varchar(64) NOT NULL DEFAULT '',
`position` int(10) UNSIGNED NOT NULL DEFAULT 0,
`active` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_ce_theme`)
) ENGINE=$engine DEFAULT CHARSET=utf8;
") && $db->execute("
CREATE TABLE IF NOT EXISTS `{$ce_theme}_shop` (
`id_ce_theme` int(10) UNSIGNED NOT NULL,
`id_shop` int(10) UNSIGNED NOT NULL,
`position` int(10) UNSIGNED NOT NULL DEFAULT 0,
`active` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_ce_theme`,`id_shop`),
KEY `id_shop` (`id_shop`)
) ENGINE=$engine DEFAULT CHARSET=utf8;
") && $db->execute("
CREATE TABLE IF NOT EXISTS `{$ce_theme}_lang` (
`id_ce_theme` int(10) UNSIGNED NOT NULL,
`id_lang` int(10) UNSIGNED NOT NULL,
`id_shop` int(10) UNSIGNED NOT NULL DEFAULT 1,
`title` varchar(128) NOT NULL DEFAULT '',
`content` text,
PRIMARY KEY (`id_ce_theme`,`id_shop`,`id_lang`)
) ENGINE=$engine DEFAULT CHARSET=utf8;
");
try {
// Add `type` to ce_revision table
$db->execute("
ALTER TABLE `$ce_revision`
ADD `type` varchar(64) NOT NULL DEFAULT '' AFTER `title`
");
} catch (Exception $ex) {
// Do nothing when `type` already exists
}
foreach (Tab::getCollectionFromModule($module->name) as $tab) {
$tab->delete();
}
CEDatabase::updateTabs();
$result &= $module->registerHook('actionObjectCEContentDeleteAfter');
// Clear caches
foreach (glob(_CE_PATH_ . 'views/css/ce/global-*.css') as $css_file) {
Tools::deleteFile($css_file);
}
CE\Plugin::instance()->files_manager->clearCache();
Media::clearCache();
return $result;
}

View File

@@ -0,0 +1,73 @@
<?php
/**
* Creative Elements - live Theme & Page Builder
*
* @author WebshopWorks
* @copyright 2019-2022 WebshopWorks.com
* @license One domain support license
*/
defined('_PS_VERSION_') or die;
function upgrade_module_2_5_5($module)
{
$table = _DB_PREFIX_ . 'ce_meta';
$rows = Db::getInstance()->executeS("
SELECT `id`, `value` FROM `$table`
WHERE `name` = '_elementor_data' AND `value` LIKE '%\"widgetType\":\"video\"%'
");
if ($rows) {
foreach ($rows as &$row) {
$do_update = false;
$data = json_decode($row['value'], true);
if (empty($data)) {
continue;
}
$data = CE\Plugin::instance()->db->iterateData($data, function ($element) use (&$do_update) {
if (empty($element['widgetType']) || 'video' !== $element['widgetType']) {
return $element;
}
$replacements = [];
if (empty($element['settings']['video_type']) || 'youtube' === $element['settings']['video_type']) {
$replacements = [
'yt_autoplay' => 'autoplay',
'yt_controls' => 'controls',
'yt_mute' => 'mute',
'yt_rel' => 'rel',
'link' => 'youtube_url',
];
} elseif ('vimeo' === $element['settings']['video_type']) {
$replacements = [
'vimeo_autoplay' => 'autoplay',
'vimeo_loop' => 'loop',
'vimeo_color' => 'color',
'vimeo_link' => 'vimeo_url',
];
}
// cleanup old unused settings.
unset($element['settings']['yt_rel_videos']);
foreach ($replacements as $old => $new) {
if (!empty($element['settings'][$old])) {
$element['settings'][$new] = $element['settings'][$old];
$do_update = true;
}
}
return $element;
});
if ($do_update) {
CE\update_post_meta($row['id'], '_elementor_data', $data);
}
}
}
return true;
}

View File

@@ -0,0 +1,40 @@
<?php
/**
* Creative Elements - live Theme & Page Builder
*
* @author WebshopWorks
* @copyright 2019-2022 WebshopWorks.com
* @license One domain support license
*/
defined('_PS_VERSION_') or die;
function upgrade_module_2_5_7($module)
{
require_once _CE_PATH_ . 'classes/CEDatabase.php';
// Add Custom Fonts tab
$result = CEDatabase::updateTabs();
// Create table for Custom Fonts
$ce_font = _DB_PREFIX_ . 'ce_font';
$engine = _MYSQL_ENGINE_;
$result &= Db::getInstance()->execute("
CREATE TABLE IF NOT EXISTS `$ce_font` (
`id_ce_font` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`family` varchar(128) NOT NULL DEFAULT '',
`files` text,
PRIMARY KEY (`id_ce_font`)
) ENGINE=$engine DEFAULT CHARSET=utf8;
");
// Register delete action for ThemeVolty Blog post
$result &= $module->registerHook('actionObjectTvcmsBlogPostsClassDeleteAfter');
// Clear caches
CE\Plugin::instance()->files_manager->clearCache();
Media::clearCache();
return $result;
}

View File

@@ -0,0 +1,20 @@
<?php
/**
* Creative Elements - live Theme & Page Builder
*
* @author WebshopWorks
* @copyright 2019-2022 WebshopWorks.com
* @license One domain support license
*/
defined('_PS_VERSION_') or die;
function upgrade_module_2_5_8($module)
{
Shop::isFeatureActive() && Shop::setContext(Shop::CONTEXT_ALL);
CE\Plugin::instance()->files_manager->clearCache();
Media::clearCache();
return true;
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* Creative Elements - live Theme & Page Builder
*
* @author WebshopWorks
* @copyright 2019-2022 WebshopWorks.com
* @license One domain support license
*/
defined('_PS_VERSION_') or die;
function upgrade_module_2_5_9($module)
{
Shop::isFeatureActive() && Shop::setContext(Shop::CONTEXT_ALL);
if (isset($module->context->cookie->ceViewedProducts)) {
$products = explode(',', $module->context->cookie->ceViewedProducts);
$products = array_slice($products, 0, CreativeElements::VIEWED_PRODUCTS_LIMIT);
$module->context->cookie->ceViewedProducts = implode(',', $products);
$module->context->cookie->write();
}
CE\Plugin::instance()->files_manager->clearCache();
Media::clearCache();
return true;
}