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:
8
modules/creativeelements/core/settings/general/index.php
Normal file
8
modules/creativeelements/core/settings/general/index.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
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;
|
||||
223
modules/creativeelements/core/settings/general/manager.php
Normal file
223
modules/creativeelements/core/settings/general/manager.php
Normal file
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
/**
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
*
|
||||
* @author WebshopWorks, Elementor
|
||||
* @copyright 2019-2022 WebshopWorks.com & Elementor.com
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html
|
||||
*/
|
||||
|
||||
namespace CE;
|
||||
|
||||
defined('_PS_VERSION_') or die;
|
||||
|
||||
use CE\CoreXFilesXCSSXBase as Base;
|
||||
use CE\CoreXFilesXCSSXGlobalCSS as GlobalCSS;
|
||||
use CE\CoreXSettingsXBaseXManager as BaseManager;
|
||||
use CE\CoreXSettingsXBaseXModel as BaseModel;
|
||||
use CE\CoreXSettingsXGeneralXModel as Model;
|
||||
|
||||
/**
|
||||
* Elementor general settings manager.
|
||||
*
|
||||
* Elementor general settings manager handler class is responsible for registering
|
||||
* and managing Elementor general settings managers.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*/
|
||||
class CoreXSettingsXGeneralXManager extends BaseManager
|
||||
{
|
||||
/**
|
||||
* Lightbox panel tab.
|
||||
*/
|
||||
const PANEL_TAB_LIGHTBOX = 'lightbox';
|
||||
|
||||
/**
|
||||
* Meta key for the general settings.
|
||||
*/
|
||||
const META_KEY = '_elementor_general_settings';
|
||||
|
||||
/**
|
||||
* General settings manager constructor.
|
||||
*
|
||||
* Initializing Elementor general settings manager.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access public
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->addPanelTabs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get manager name.
|
||||
*
|
||||
* Retrieve general settings manager name.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access public
|
||||
*
|
||||
* @return string Manager name.
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'general';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get model for config.
|
||||
*
|
||||
* Retrieve the model for settings configuration.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access public
|
||||
*
|
||||
* @return BaseModel The model object.
|
||||
*/
|
||||
public function getModelForConfig()
|
||||
{
|
||||
return $this->getModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get saved settings.
|
||||
*
|
||||
* Retrieve the saved settings from the site options.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access protected
|
||||
*
|
||||
* @param int $id Post ID.
|
||||
*
|
||||
* @return array Saved settings.
|
||||
*/
|
||||
protected function getSavedSettings($id)
|
||||
{
|
||||
$model_controls = Model::getControlsList();
|
||||
|
||||
$settings = [];
|
||||
|
||||
foreach ($model_controls as $tab_name => $sections) {
|
||||
foreach ($sections as $section_name => $section_data) {
|
||||
foreach ($section_data['controls'] as $control_name => $control_data) {
|
||||
$saved_setting = get_option($control_name, null);
|
||||
|
||||
if (null !== $saved_setting) {
|
||||
$settings[$control_name] = get_option($control_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get CSS file name.
|
||||
*
|
||||
* Retrieve CSS file name for the general settings manager.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access protected
|
||||
* @return string
|
||||
*
|
||||
* @return string CSS file name.
|
||||
*/
|
||||
protected function getCssFileName()
|
||||
{
|
||||
return 'global';
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings to DB.
|
||||
*
|
||||
* Save general settings to the database, as site options.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $settings Settings.
|
||||
* @param int $id Post ID.
|
||||
*/
|
||||
protected function saveSettingsToDb(array $settings, $id)
|
||||
{
|
||||
$model_controls = Model::getControlsList();
|
||||
|
||||
$one_list_settings = [];
|
||||
|
||||
foreach ($model_controls as $tab_name => $sections) {
|
||||
foreach ($sections as $section_name => $section_data) {
|
||||
foreach ($section_data['controls'] as $control_name => $control_data) {
|
||||
if (isset($settings[$control_name])) {
|
||||
$one_list_control_name = str_replace('elementor_', '', $control_name);
|
||||
|
||||
$one_list_settings[$one_list_control_name] = $settings[$control_name];
|
||||
|
||||
update_option($control_name, $settings[$control_name]);
|
||||
} else {
|
||||
delete_option($control_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Save all settings in one list for a future usage
|
||||
if (!empty($one_list_settings)) {
|
||||
update_option(self::META_KEY, $one_list_settings);
|
||||
} else {
|
||||
delete_option(self::META_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get model for CSS file.
|
||||
*
|
||||
* Retrieve the model for the CSS file.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access protected
|
||||
*
|
||||
* @param Base $css_file The requested CSS file.
|
||||
*
|
||||
* @return BaseModel The model object.
|
||||
*/
|
||||
protected function getModelForCssFile(Base $css_file)
|
||||
{
|
||||
return $this->getModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get CSS file for update.
|
||||
*
|
||||
* Retrieve the CSS file before updating the it.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access protected
|
||||
*
|
||||
* @param int $id Post ID.
|
||||
*
|
||||
* @return GlobalCSS The global CSS file object.
|
||||
*/
|
||||
protected function getCssFileForUpdate($id)
|
||||
{
|
||||
$id_shop = (int) \Context::getContext()->shop->id;
|
||||
|
||||
return new GlobalCSS("$id_shop-global.css");
|
||||
}
|
||||
|
||||
/**
|
||||
* Add panel tabs.
|
||||
*
|
||||
* Register new panel tab for the lightbox settings.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access private
|
||||
*/
|
||||
private function addPanelTabs()
|
||||
{
|
||||
ControlsManager::addTab(self::PANEL_TAB_LIGHTBOX, __('Lightbox'));
|
||||
}
|
||||
}
|
||||
337
modules/creativeelements/core/settings/general/model.php
Normal file
337
modules/creativeelements/core/settings/general/model.php
Normal file
@@ -0,0 +1,337 @@
|
||||
<?php
|
||||
/**
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
*
|
||||
* @author WebshopWorks, Elementor
|
||||
* @copyright 2019-2022 WebshopWorks.com & Elementor.com
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html
|
||||
*/
|
||||
|
||||
namespace CE;
|
||||
|
||||
defined('_PS_VERSION_') or die;
|
||||
|
||||
use CE\CoreXSettingsXBaseXModel as BaseModel;
|
||||
use CE\CoreXSettingsXGeneralXManager as Manager;
|
||||
|
||||
/**
|
||||
* Elementor global settings model.
|
||||
*
|
||||
* Elementor global settings model handler class is responsible for registering
|
||||
* and managing Elementor global settings models.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*/
|
||||
class CoreXSettingsXGeneralXModel extends BaseModel
|
||||
{
|
||||
/**
|
||||
* Get model name.
|
||||
*
|
||||
* Retrieve global settings model name.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access public
|
||||
*
|
||||
* @return string Model name.
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'global-settings';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get CSS wrapper selector.
|
||||
*
|
||||
* Retrieve the wrapper selector for the global settings model.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access public
|
||||
*
|
||||
* @return string CSS wrapper selector.
|
||||
*/
|
||||
|
||||
public function getCssWrapperSelector()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get panel page settings.
|
||||
*
|
||||
* Retrieve the panel setting for the global settings model.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access public
|
||||
*
|
||||
* @return array {
|
||||
* Panel settings.
|
||||
*
|
||||
* @type string $title The panel title.
|
||||
* @type array $menu The panel menu.
|
||||
* }
|
||||
*/
|
||||
public function getPanelPageSettings()
|
||||
{
|
||||
return [
|
||||
'title' => __('Global Settings'),
|
||||
'menu' => [
|
||||
'icon' => 'fa fa-cogs',
|
||||
'beforeItem' => 'elementor-settings',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get controls list.
|
||||
*
|
||||
* Retrieve the global settings model controls list.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access public
|
||||
* @static
|
||||
*
|
||||
* @return array Controls list.
|
||||
*/
|
||||
public static function getControlsList()
|
||||
{
|
||||
return [
|
||||
ControlsManager::TAB_STYLE => [
|
||||
'style' => [
|
||||
'label' => __('Style'),
|
||||
'controls' => [
|
||||
'elementor_default_generic_fonts' => [
|
||||
'label' => __('Default Generic Fonts'),
|
||||
'type' => ControlsManager::TEXT,
|
||||
'default' => 'Sans-serif',
|
||||
'description' => __('The list of fonts used if the chosen font is not available.'),
|
||||
'label_block' => true,
|
||||
],
|
||||
'elementor_container_width' => [
|
||||
'label' => __('Content Width') . ' (px)',
|
||||
'type' => ControlsManager::NUMBER,
|
||||
'min' => 300,
|
||||
'description' => __('Sets the default width of the content area (Default: 1140)'),
|
||||
'selectors' => [
|
||||
'.elementor-section.elementor-section-boxed > .elementor-container' => 'max-width: {{VALUE}}px',
|
||||
],
|
||||
],
|
||||
'elementor_space_between_widgets' => [
|
||||
'label' => __('Widgets Space') . ' (px)',
|
||||
'type' => ControlsManager::NUMBER,
|
||||
'min' => 0,
|
||||
'placeholder' => '20',
|
||||
'description' => __('Sets the default space between widgets (Default: 20)'),
|
||||
'selectors' => [
|
||||
'.elementor-widget:not(:last-child)' => 'margin-bottom: {{VALUE}}px',
|
||||
],
|
||||
],
|
||||
'elementor_stretched_section_container' => [
|
||||
'label' => __('Stretched Section Fit To'),
|
||||
'type' => ControlsManager::TEXT,
|
||||
'placeholder' => 'body',
|
||||
'description' => __('Enter parent element selector to which stretched sections will fit to (e.g. #primary / .wrapper / main etc). Leave blank to fit to page width.'),
|
||||
'label_block' => true,
|
||||
'frontend_available' => true,
|
||||
],
|
||||
'elementor_page_title_selector' => [
|
||||
'label' => __('Page Title Selector'),
|
||||
'type' => ControlsManager::TEXTAREA,
|
||||
'rows' => 1,
|
||||
'placeholder' => 'header.page-header',
|
||||
'description' => sprintf(
|
||||
__("You can hide the title at document settings. This works for themes that have ”%s” selector. If your theme's selector is different, please enter it above."),
|
||||
'header.page-header'
|
||||
),
|
||||
'label_block' => true,
|
||||
],
|
||||
'elementor_page_wrapper_selector' => [
|
||||
'label' => __('Content Wrapper Selector'),
|
||||
'type' => ControlsManager::TEXTAREA,
|
||||
'rows' => 3,
|
||||
'placeholder' => '#content, #wrapper, #wrapper .container',
|
||||
'description' => sprintf(
|
||||
__("You can clear margin, padding, max-width from content wrapper at document settings. This works for themes that have ”%s” selector. If your theme's selector is different, please enter it above."),
|
||||
'#content, #wrapper, #wrapper .container'
|
||||
),
|
||||
'label_block' => true,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
Manager::PANEL_TAB_LIGHTBOX => [
|
||||
'lightbox' => [
|
||||
'label' => __('Lightbox'),
|
||||
'controls' => [
|
||||
'elementor_global_image_lightbox' => [
|
||||
'label' => __('Image Lightbox'),
|
||||
'type' => ControlsManager::SWITCHER,
|
||||
'return_value' => '1',
|
||||
'description' => __('Open all image links in a lightbox popup window. The lightbox will automatically work on any link that leads to an image file.'),
|
||||
'frontend_available' => true,
|
||||
],
|
||||
'elementor_enable_lightbox_in_editor' => [
|
||||
'label' => __('Enable In Editor'),
|
||||
'type' => ControlsManager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'frontend_available' => true,
|
||||
],
|
||||
'elementor_lightbox_enable_counter' => [
|
||||
'label' => __('Counter'),
|
||||
'type' => ControlsManager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'frontend_available' => true,
|
||||
],
|
||||
'elementor_lightbox_enable_zoom' => [
|
||||
'label' => __('Zoom'),
|
||||
'type' => ControlsManager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'frontend_available' => true,
|
||||
],
|
||||
'elementor_lightbox_title_src' => [
|
||||
'label' => __('Title'),
|
||||
'type' => ControlsManager::SELECT,
|
||||
'options' => [
|
||||
'' => __('None'),
|
||||
'title' => __('Title'),
|
||||
'caption' => __('Caption'),
|
||||
'alt' => __('Alt'),
|
||||
// 'description' => __('Description'),
|
||||
],
|
||||
'default' => 'title',
|
||||
'frontend_available' => true,
|
||||
],
|
||||
'elementor_lightbox_description_src' => [
|
||||
'label' => __('Description'),
|
||||
'type' => ControlsManager::SELECT,
|
||||
'options' => [
|
||||
'' => __('None'),
|
||||
'title' => __('Title'),
|
||||
'caption' => __('Caption'),
|
||||
'alt' => __('Alt'),
|
||||
// 'description' => __('Description'),
|
||||
],
|
||||
'default' => 'caption',
|
||||
'frontend_available' => true,
|
||||
],
|
||||
'elementor_lightbox_color' => [
|
||||
'label' => __('Background Color'),
|
||||
'type' => ControlsManager::COLOR,
|
||||
'selectors' => [
|
||||
'.elementor-lightbox' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
],
|
||||
'elementor_lightbox_ui_color' => [
|
||||
'label' => __('UI Color'),
|
||||
'type' => ControlsManager::COLOR,
|
||||
'selectors' => [
|
||||
'.elementor-lightbox' => '--lightbox-ui-color: {{VALUE}}',
|
||||
],
|
||||
],
|
||||
'elementor_lightbox_ui_color_hover' => [
|
||||
'label' => __('UI Hover Color'),
|
||||
'type' => ControlsManager::COLOR,
|
||||
'selectors' => [
|
||||
'.elementor-lightbox' => '--lightbox-ui-color-hover: {{VALUE}}',
|
||||
],
|
||||
],
|
||||
'elementor_lightbox_text_color' => [
|
||||
'label' => __('Text Color'),
|
||||
'type' => ControlsManager::COLOR,
|
||||
'selectors' => [
|
||||
'.elementor-lightbox' => '--lightbox-text-color: {{VALUE}}',
|
||||
],
|
||||
],
|
||||
'lightbox_box_shadow_type' => [
|
||||
'label' => _x('Box Shadow', 'Box Shadow Control'),
|
||||
'type' => ControlsManager::POPOVER_TOGGLE,
|
||||
'return_value' => 'yes',
|
||||
'render_type' => 'ui',
|
||||
],
|
||||
'lightbox_box_shadow' => [
|
||||
'label' => _x('Box Shadow', 'Box Shadow Control'),
|
||||
'type' => ControlsManager::BOX_SHADOW,
|
||||
'default' => [
|
||||
'horizontal' => 0,
|
||||
'vertical' => 0,
|
||||
'blur' => 10,
|
||||
'spread' => 0,
|
||||
'color' => 'rgba(0,0,0,0.5)',
|
||||
],
|
||||
'selectors' => [
|
||||
'.elementor-lightbox .elementor-lightbox-image' => 'box-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{SPREAD}}px {{COLOR}} {{lightbox_box_shadow_position.VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'lightbox_box_shadow_type!' => '',
|
||||
],
|
||||
'popover' => [
|
||||
'start' => true,
|
||||
],
|
||||
],
|
||||
'lightbox_box_shadow_position' => [
|
||||
'label' => 'Position',
|
||||
'type' => ControlsManager::SELECT,
|
||||
'options' => [
|
||||
' ' => 'Outline',
|
||||
'inset' => 'Inset',
|
||||
],
|
||||
'default' => ' ',
|
||||
'render_type' => 'ui',
|
||||
'condition' => [
|
||||
'lightbox_box_shadow_type!' => '',
|
||||
],
|
||||
'popover' => [
|
||||
'end' => true,
|
||||
],
|
||||
],
|
||||
'lightbox_icons_size' => [
|
||||
'label' => __('Toolbar Icons Size'),
|
||||
'type' => ControlsManager::SLIDER,
|
||||
'selectors' => [
|
||||
'.elementor-lightbox' => '--lightbox-header-icons-size: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
'separator' => 'before',
|
||||
],
|
||||
'lightbox_slider_icons_size' => [
|
||||
'label' => __('Navigation Icons Size'),
|
||||
'type' => ControlsManager::SLIDER,
|
||||
'selectors' => [
|
||||
'.elementor-lightbox' => '--lightbox-navigation-icons-size: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Register model controls.
|
||||
*
|
||||
* Used to add new controls to the global settings model.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @access protected
|
||||
*/
|
||||
protected function _registerControls()
|
||||
{
|
||||
$controls_list = self::getControlsList();
|
||||
|
||||
foreach ($controls_list as $tab_name => $sections) {
|
||||
foreach ($sections as $section_name => $section_data) {
|
||||
$this->startControlsSection(
|
||||
$section_name,
|
||||
[
|
||||
'label' => $section_data['label'],
|
||||
'tab' => $tab_name,
|
||||
]
|
||||
);
|
||||
|
||||
foreach ($section_data['controls'] as $control_name => $control_data) {
|
||||
$this->addControl($control_name, $control_data);
|
||||
}
|
||||
|
||||
$this->endControlsSection();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user