File manager - Edit - /home/monara/public_html/test.athavaneng.com/documents.tar
Back
tabs/global-colors.php 0000644 00000005372 15073240362 0010756 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Controls_Manager; use Elementor\Core\Kits\Controls\Repeater as Global_Style_Repeater; use Elementor\Repeater; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Global_Colors extends Tab_Base { const COLOR_PRIMARY = 'globals/colors?id=primary'; const COLOR_SECONDARY = 'globals/colors?id=secondary'; const COLOR_TEXT = 'globals/colors?id=text'; const COLOR_ACCENT = 'globals/colors?id=accent'; public function get_id() { return 'global-colors'; } public function get_title() { return esc_html__( 'Global Colors', 'elementor' ); } public function get_group() { return 'global'; } public function get_icon() { return 'eicon-global-colors'; } public function get_help_url() { return 'https://go.elementor.com/global-colors/'; } protected function register_tab_controls() { $this->start_controls_section( 'section_global_colors', [ 'label' => esc_html__( 'Global Colors', 'elementor' ), 'tab' => $this->get_id(), ] ); $repeater = new Repeater(); $repeater->add_control( 'title', [ 'type' => Controls_Manager::TEXT, 'label_block' => true, 'required' => true, ] ); // Color Value $repeater->add_control( 'color', [ 'type' => Controls_Manager::COLOR, 'label_block' => true, 'selectors' => [ '{{WRAPPER}}' => '--e-global-color-{{_id.VALUE}}: {{VALUE}}', ], 'global' => [ 'active' => false, ], ] ); $default_colors = [ [ '_id' => 'primary', 'title' => esc_html__( 'Primary', 'elementor' ), 'color' => '#6EC1E4', ], [ '_id' => 'secondary', 'title' => esc_html__( 'Secondary', 'elementor' ), 'color' => '#54595F', ], [ '_id' => 'text', 'title' => esc_html__( 'Text', 'elementor' ), 'color' => '#7A7A7A', ], [ '_id' => 'accent', 'title' => esc_html__( 'Accent', 'elementor' ), 'color' => '#61CE70', ], ]; $this->add_control( 'heading_system_colors', [ 'type' => Controls_Manager::HEADING, 'label' => esc_html__( 'System Colors', 'elementor' ), ] ); $this->add_control( 'system_colors', [ 'type' => Global_Style_Repeater::CONTROL_TYPE, 'fields' => $repeater->get_controls(), 'default' => $default_colors, 'item_actions' => [ 'add' => false, 'remove' => false, ], 'separator' => 'after', ] ); $this->add_control( 'heading_custom_colors', [ 'type' => Controls_Manager::HEADING, 'label' => esc_html__( 'Custom Colors', 'elementor' ), ] ); $this->add_control( 'custom_colors', [ 'type' => Global_Style_Repeater::CONTROL_TYPE, 'fields' => $repeater->get_controls(), ] ); $this->end_controls_section(); } } tabs/theme-style-images.php 0000644 00000011020 15073240362 0011705 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Controls_Manager; use Elementor\Group_Control_Border; use Elementor\Group_Control_Box_Shadow; use Elementor\Group_Control_Css_Filter; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Theme_Style_Images extends Tab_Base { public function get_id() { return 'theme-style-images'; } public function get_title() { return esc_html__( 'Images', 'elementor' ); } public function get_group() { return 'theme-style'; } public function get_icon() { return 'eicon-image'; } public function get_help_url() { return 'https://go.elementor.com/global-theme-style-images/'; } protected function register_tab_controls() { $image_selectors = [ '{{WRAPPER}} img', ]; $image_hover_selectors = [ '{{WRAPPER}} img:hover', ]; $image_selectors = implode( ',', $image_selectors ); $image_hover_selectors = implode( ',', $image_hover_selectors ); $this->start_controls_section( 'section_images', [ 'label' => esc_html__( 'Images', 'elementor' ), 'tab' => $this->get_id(), ] ); $this->add_default_globals_notice(); $this->start_controls_tabs( 'tabs_image_style' ); $this->start_controls_tab( 'tab_image_normal', [ 'label' => esc_html__( 'Normal', 'elementor' ), ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'image_border', 'selector' => $image_selectors, 'fields_options' => [ 'color' => [ 'dynamic' => [], ], ], ] ); $this->add_responsive_control( 'image_border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ $image_selectors => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'image_opacity', [ 'label' => esc_html__( 'Opacity', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 1, 'min' => 0.10, 'step' => 0.01, ], ], 'selectors' => [ $image_selectors => 'opacity: {{SIZE}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'image_box_shadow', 'exclude' => [ 'box_shadow_position', ], 'selector' => $image_selectors, ] ); $this->add_group_control( Group_Control_Css_Filter::get_type(), [ 'name' => 'image_css_filters', 'selector' => '{{WRAPPER}} img', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_image_hover', [ 'label' => esc_html__( 'Hover', 'elementor' ), ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'image_hover_border', 'selector' => '{{WRAPPER}} img:hover', 'fields_options' => [ 'color' => [ 'dynamic' => [], ], ], ] ); $this->add_responsive_control( 'image_hover_border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ $image_hover_selectors => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'image_hover_opacity', [ 'label' => esc_html__( 'Opacity', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 1, 'min' => 0.10, 'step' => 0.01, ], ], 'selectors' => [ $image_hover_selectors => 'opacity: {{SIZE}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'image_hover_box_shadow', 'exclude' => [ 'box_shadow_position', ], 'selector' => $image_hover_selectors, ] ); $this->add_group_control( Group_Control_Css_Filter::get_type(), [ 'name' => 'image_hover_css_filters', 'selector' => $image_hover_selectors, ] ); $this->add_control( 'image_hover_transition', [ 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)', 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 3, 'step' => 0.1, ], ], 'selectors' => [ $image_selectors => 'transition-duration: {{SIZE}}s', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } } tabs/theme-style-buttons.php 0000644 00000013122 15073240362 0012143 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Controls_Manager; use Elementor\Group_Control_Background; use Elementor\Group_Control_Border; use Elementor\Group_Control_Box_Shadow; use Elementor\Group_Control_Text_Shadow; use Elementor\Group_Control_Typography; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Theme_Style_Buttons extends Tab_Base { public function get_id() { return 'theme-style-buttons'; } public function get_title() { return esc_html__( 'Buttons', 'elementor' ); } public function get_group() { return 'theme-style'; } public function get_icon() { return 'eicon-button'; } public function get_help_url() { return 'https://go.elementor.com/global-theme-style-buttons/'; } protected function register_tab_controls() { $button_selectors = [ '{{WRAPPER}} button', '{{WRAPPER}} input[type="button"]', '{{WRAPPER}} input[type="submit"]', '{{WRAPPER}} .elementor-button', ]; $button_hover_selectors = [ '{{WRAPPER}} button:hover', '{{WRAPPER}} button:focus', '{{WRAPPER}} input[type="button"]:hover', '{{WRAPPER}} input[type="button"]:focus', '{{WRAPPER}} input[type="submit"]:hover', '{{WRAPPER}} input[type="submit"]:focus', '{{WRAPPER}} .elementor-button:hover', '{{WRAPPER}} .elementor-button:focus', ]; $button_selector = implode( ',', $button_selectors ); $button_hover_selector = implode( ',', $button_hover_selectors ); $this->start_controls_section( 'section_buttons', [ 'label' => esc_html__( 'Buttons', 'elementor' ), 'tab' => $this->get_id(), ] ); $this->add_default_globals_notice(); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'button_typography', 'selector' => $button_selector, ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'button_text_shadow', 'selector' => $button_selector, ] ); $this->start_controls_tabs( 'tabs_button_style' ); $this->start_controls_tab( 'tab_button_normal', [ 'label' => esc_html__( 'Normal', 'elementor' ), ] ); $this->add_control( 'button_text_color', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'dynamic' => [], 'selectors' => [ $button_selector => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'button_background', 'types' => [ 'classic', 'gradient' ], 'exclude' => [ 'image' ], 'selector' => $button_selector, 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'dynamic' => [], ], 'color_b' => [ 'dynamic' => [], ], ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'button_box_shadow', 'selector' => $button_selector, ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'button_border', 'selector' => $button_selector, 'fields_options' => [ 'color' => [ 'dynamic' => [], ], ], ] ); $this->add_control( 'button_border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ $button_selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_button_hover', [ 'label' => esc_html__( 'Hover', 'elementor' ), ] ); $this->add_control( 'button_hover_text_color', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'dynamic' => [], 'selectors' => [ $button_hover_selector => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'button_hover_background', 'types' => [ 'classic', 'gradient' ], 'exclude' => [ 'image' ], 'selector' => $button_hover_selector, 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'dynamic' => [], ], 'color_b' => [ 'dynamic' => [], ], ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'button_hover_box_shadow', 'selector' => $button_hover_selector, ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'button_hover_border', 'selector' => $button_hover_selector, 'fields_options' => [ 'color' => [ 'dynamic' => [], ], ], ] ); $this->add_control( 'button_hover_border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ $button_hover_selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'button_padding', [ 'label' => esc_html__( 'Padding', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ $button_selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->end_controls_section(); } } tabs/tab-base.php 0000644 00000004225 15073240362 0007671 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Controls_Manager; use Elementor\Core\Kits\Documents\Kit; use Elementor\Core\Kits\Manager; use Elementor\Plugin; use Elementor\Settings; use Elementor\Sub_Controls_Stack; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } abstract class Tab_Base extends Sub_Controls_Stack { /** * @var Kit */ protected $parent; abstract protected function register_tab_controls(); public function get_group() { return 'settings'; } public function get_icon() { return ''; } public function get_help_url() { return ''; } public function get_additional_tab_content() { return ''; } public function register_controls() { $this->register_tab(); $this->register_tab_controls(); } public function on_save( $data ) {} /** * Before Save * * Allows for modifying the kit data before it is saved to the database. * * @param array $data * @return array */ public function before_save( array $data ) { return $data; } protected function register_tab() { Controls_Manager::add_tab( $this->get_id(), $this->get_title() ); } protected function add_default_globals_notice() { // Get the current section config (array - section id and tab) to use for creating a unique control ID and name $current_section = $this->parent->get_current_section(); /** @var Manager $module */ $kits_manager = Plugin::$instance->kits_manager; if ( $kits_manager->is_custom_colors_enabled() || $kits_manager->is_custom_typography_enabled() ) { $this->add_control( $current_section['section'] . '_schemes_notice', [ 'name' => $current_section['section'] . '_schemes_notice', 'type' => Controls_Manager::ALERT, 'alert_type' => 'warning', 'content' => sprintf( /* translators: 1: Link open tag, 2: Link close tag. */ esc_html__( 'In order for Theme Style to affect all relevant Elementor elements, please disable Default Colors and Fonts from the %1$sSettings Page%2$s.', 'elementor' ), '<a href="' . Settings::get_settings_tab_url( 'general' ) . '" target="_blank">', '</a>' ), 'render_type' => 'ui', ] ); } } } tabs/settings-site-identity.php 0000644 00000010563 15073240362 0012646 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Controls_Manager; use Elementor\Core\Base\Document; use Elementor\Core\Files\Uploads_Manager; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Settings_Site_Identity extends Tab_Base { public function get_id() { return 'settings-site-identity'; } public function get_title() { return esc_html__( 'Site Identity', 'elementor' ); } public function get_group() { return 'settings'; } public function get_icon() { return 'eicon-site-identity'; } public function get_help_url() { return 'https://go.elementor.com/global-site-identity/'; } protected function register_tab_controls() { $custom_logo_id = get_theme_mod( 'custom_logo' ); $custom_logo_src = wp_get_attachment_image_src( $custom_logo_id, 'full' ); $site_icon_id = get_option( 'site_icon' ); $site_icon_src = wp_get_attachment_image_src( $site_icon_id, 'full' ); // If CANNOT upload svg normally, it will add a custom inline option to force svg upload if requested. (in logo and favicon) $should_include_svg_inline_option = ! Uploads_Manager::are_unfiltered_uploads_enabled(); $this->start_controls_section( 'section_' . $this->get_id(), [ 'label' => $this->get_title(), 'tab' => $this->get_id(), ] ); $this->add_control( $this->get_id() . '_refresh_notice', [ 'type' => Controls_Manager::ALERT, 'alert_type' => 'info', 'content' => sprintf( /* translators: 1: Link open tag, 2: Link open tag, 3: Link close tag. */ esc_html__( 'Changes will be reflected only after %1$s saving %3$s and %2$s reloading %3$s preview.', 'elementor' ), '<a href="javascript: $e.run( \'document/save/default\' )">', '<a href="javascript: $e.run( \'preview/reload\' )">', '</a>' ), ] ); $this->add_control( 'site_name', [ 'label' => esc_html__( 'Site Name', 'elementor' ), 'default' => get_option( 'blogname' ), 'placeholder' => esc_html__( 'Choose name', 'elementor' ), 'label_block' => true, 'export' => false, ] ); $this->add_control( 'site_description', [ 'label' => esc_html__( 'Site Description', 'elementor' ), 'default' => get_option( 'blogdescription' ), 'placeholder' => esc_html__( 'Choose description', 'elementor' ), 'label_block' => true, 'export' => false, ] ); $this->add_control( 'site_logo', [ 'label' => esc_html__( 'Site Logo', 'elementor' ), 'type' => Controls_Manager::MEDIA, 'should_include_svg_inline_option' => $should_include_svg_inline_option, 'default' => [ 'id' => $custom_logo_id, 'url' => $custom_logo_src ? $custom_logo_src[0] : '', ], 'description' => sprintf( /* translators: 1: Width number pixel, 2: Height number pixel. */ esc_html__( 'Suggested image dimensions: %1$s × %2$s pixels.', 'elementor' ), '350', '100' ), 'export' => false, 'ai' => [ 'active' => true, 'type' => 'media', 'category' => 'vector', ], ] ); $this->add_control( 'site_favicon', [ 'label' => esc_html__( 'Site Favicon', 'elementor' ), 'type' => Controls_Manager::MEDIA, 'should_include_svg_inline_option' => $should_include_svg_inline_option, 'default' => [ 'id' => $site_icon_id, 'url' => $site_icon_src ? $site_icon_src[0] : '', ], 'description' => esc_html__( 'Suggested favicon dimensions: 512 × 512 pixels.', 'elementor' ), 'export' => false, ] ); $this->end_controls_section(); } public function on_save( $data ) { if ( ! isset( $data['settings']['post_status'] ) || Document::STATUS_PUBLISH !== $data['settings']['post_status'] || // Should check for the current action to avoid infinite loop // when updating options like: "blogname" and "blogdescription". strpos( current_action(), 'update_option_' ) === 0 ) { return; } if ( isset( $data['settings']['site_name'] ) ) { update_option( 'blogname', $data['settings']['site_name'] ); } if ( isset( $data['settings']['site_description'] ) ) { update_option( 'blogdescription', $data['settings']['site_description'] ); } if ( isset( $data['settings']['site_logo'] ) ) { set_theme_mod( 'custom_logo', $data['settings']['site_logo']['id'] ); } if ( isset( $data['settings']['site_favicon'] ) ) { update_option( 'site_icon', $data['settings']['site_favicon']['id'] ); } } } tabs/settings-page-transitions.php 0000644 00000001374 15073240362 0013342 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Plugin; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Settings_Page_Transitions extends Tab_Base { const TAB_ID = 'settings-page-transitions'; public function get_id() { return self::TAB_ID; } public function get_title() { return esc_html__( 'Page Transitions', 'elementor' ); } public function get_group() { return 'settings'; } public function get_icon() { return 'eicon-page-transition'; } public function get_help_url() { return 'https://go.elementor.com/page-transitions/'; } protected function register_tab_controls() { Plugin::$instance->controls_manager->add_page_transitions_controls( $this->parent, $this->get_id() ); } } tabs/theme-style-form-fields.php 0000644 00000012471 15073240362 0012662 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Controls_Manager; use Elementor\Group_Control_Border; use Elementor\Group_Control_Box_Shadow; use Elementor\Group_Control_Typography; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Theme_Style_Form_Fields extends Tab_Base { public function get_id() { return 'theme-style-form-fields'; } public function get_title() { return esc_html__( 'Form Fields', 'elementor' ); } public function get_group() { return 'theme-style'; } public function get_icon() { return 'eicon-form-horizontal'; } public function get_help_url() { return 'https://go.elementor.com/global-theme-style-form-fields/'; } protected function register_tab_controls() { $label_selectors = [ '{{WRAPPER}} label', ]; $input_selectors = [ '{{WRAPPER}} input:not([type="button"]):not([type="submit"])', '{{WRAPPER}} textarea', '{{WRAPPER}} .elementor-field-textual', ]; $input_focus_selectors = [ '{{WRAPPER}} input:focus:not([type="button"]):not([type="submit"])', '{{WRAPPER}} textarea:focus', '{{WRAPPER}} .elementor-field-textual:focus', ]; $label_selector = implode( ',', $label_selectors ); $input_selector = implode( ',', $input_selectors ); $input_focus_selector = implode( ',', $input_focus_selectors ); $this->start_controls_section( 'section_form_fields', [ 'label' => esc_html__( 'Form Fields', 'elementor' ), 'tab' => $this->get_id(), ] ); $this->add_default_globals_notice(); $this->add_control( 'form_label_heading', [ 'type' => Controls_Manager::HEADING, 'label' => esc_html__( 'Label', 'elementor' ), ] ); $this->add_control( 'form_label_color', [ 'label' => esc_html__( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'dynamic' => [], 'selectors' => [ $label_selector => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'form_label_typography', 'selector' => $label_selector, ] ); $this->add_control( 'form_field_heading', [ 'type' => Controls_Manager::HEADING, 'label' => esc_html__( 'Field', 'elementor' ), 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'form_field_typography', 'selector' => $input_selector, ] ); $this->start_controls_tabs( 'tabs_form_field_style' ); $this->start_controls_tab( 'tab_form_field_normal', [ 'label' => esc_html__( 'Normal', 'elementor' ), ] ); $this->add_form_field_state_tab_controls( 'form_field', $input_selector ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_form_field_focus', [ 'label' => esc_html__( 'Focus', 'elementor' ), ] ); $this->add_form_field_state_tab_controls( 'form_field_focus', $input_focus_selector ); $this->add_control( 'form_field_focus_transition_duration', [ 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (ms)', 'type' => Controls_Manager::SLIDER, 'selectors' => [ $input_selector => 'transition: {{SIZE}}ms', ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 3000, 'step' => 100, ], ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'form_field_padding', [ 'label' => esc_html__( 'Padding', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ $input_selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->end_controls_section(); } private function add_form_field_state_tab_controls( $prefix, $selector ) { $this->add_control( $prefix . '_text_color', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'dynamic' => [], 'selectors' => [ $selector => 'color: {{VALUE}};', ], ] ); $this->add_control( $prefix . '_accent_color', [ 'label' => esc_html__( 'Accent Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'dynamic' => [], 'selectors' => [ $selector => 'accent-color: {{VALUE}};', ], ] ); $this->add_control( $prefix . '_background_color', [ 'label' => esc_html__( 'Background Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'dynamic' => [], 'selectors' => [ $selector => 'background-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => $prefix . '_box_shadow', 'selector' => $selector, ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => $prefix . '_border', 'selector' => $selector, 'fields_options' => [ 'color' => [ 'dynamic' => [], ], ], ] ); $this->add_control( $prefix . '_border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ $selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); } } tabs/theme-style-typography.php 0000644 00000010702 15073240362 0012654 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Theme_Style_Typography extends Tab_Base { public function get_id() { return 'theme-style-typography'; } public function get_title() { return esc_html__( 'Typography', 'elementor' ); } public function get_group() { return 'theme-style'; } public function get_icon() { return 'eicon-typography-1'; } public function get_help_url() { return 'https://go.elementor.com/global-theme-style-typography/'; } public function register_tab_controls() { $this->start_controls_section( 'section_typography', [ 'label' => esc_html__( 'Typography', 'elementor' ), 'tab' => $this->get_id(), ] ); $this->add_default_globals_notice(); $this->add_control( 'body_heading', [ 'type' => Controls_Manager::HEADING, 'label' => esc_html__( 'Body', 'elementor' ), ] ); $this->add_control( 'body_color', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'dynamic' => [], 'selectors' => [ '{{WRAPPER}}' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'body_typography', 'selector' => '{{WRAPPER}}', ] ); $this->add_responsive_control( 'paragraph_spacing', [ 'label' => esc_html__( 'Paragraph Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}} p' => 'margin-block-end: {{SIZE}}{{UNIT}}', ], 'range' => [ 'px' => [ 'max' => 100, ], 'em' => [ 'min' => 0.1, 'max' => 20, ], ], 'size_units' => [ 'px', 'em', 'rem', 'vh', 'custom' ], ] ); // Link Selectors $link_selectors = [ '{{WRAPPER}} a', ]; $link_hover_selectors = [ '{{WRAPPER}} a:hover', ]; $link_selectors = implode( ',', $link_selectors ); $link_hover_selectors = implode( ',', $link_hover_selectors ); $this->add_control( 'link_heading', [ 'type' => Controls_Manager::HEADING, 'label' => esc_html__( 'Link', 'elementor' ), 'separator' => 'before', ] ); $this->start_controls_tabs( 'tabs_link_style' ); $this->start_controls_tab( 'tab_link_normal', [ 'label' => esc_html__( 'Normal', 'elementor' ), ] ); $this->add_control( 'link_normal_color', [ 'label' => esc_html__( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'dynamic' => [], 'selectors' => [ $link_selectors => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'link_normal_typography', 'selector' => $link_selectors, ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_link_hover', [ 'label' => esc_html__( 'Hover', 'elementor' ), ] ); $this->add_control( 'link_hover_color', [ 'label' => esc_html__( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'dynamic' => [], 'selectors' => [ $link_hover_selectors => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'link_hover_typography', 'selector' => $link_hover_selectors, ] ); $this->end_controls_tab(); $this->end_controls_tabs(); // Headings. $this->add_element_controls( 'H1', 'h1', '{{WRAPPER}} h1' ); $this->add_element_controls( 'H2', 'h2', '{{WRAPPER}} h2' ); $this->add_element_controls( 'H3', 'h3', '{{WRAPPER}} h3' ); $this->add_element_controls( 'H4', 'h4', '{{WRAPPER}} h4' ); $this->add_element_controls( 'H5', 'h5', '{{WRAPPER}} h5' ); $this->add_element_controls( 'H6', 'h6', '{{WRAPPER}} h6' ); $this->end_controls_section(); } private function add_element_controls( $label, $prefix, $selector ) { $this->add_control( $prefix . '_heading', [ 'type' => Controls_Manager::HEADING, 'label' => $label, 'separator' => 'before', ] ); $this->add_control( $prefix . '_color', [ 'label' => esc_html__( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'dynamic' => [], 'selectors' => [ $selector => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => $prefix . '_typography', 'selector' => $selector, ] ); } } tabs/settings-layout.php 0000644 00000030376 15073240362 0011374 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Core\Breakpoints\Breakpoint; use Elementor\Core\Breakpoints\Manager as Breakpoints_Manager; use Elementor\Plugin; use Elementor\Controls_Manager; use Elementor\Core\Base\Document; use Elementor\Modules\PageTemplates\Module as PageTemplatesModule; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Settings_Layout extends Tab_Base { const ACTIVE_BREAKPOINTS_CONTROL_ID = 'active_breakpoints'; public function get_id() { return 'settings-layout'; } public function get_title() { return esc_html__( 'Layout', 'elementor' ); } public function get_group() { return 'settings'; } public function get_icon() { return 'eicon-layout-settings'; } public function get_help_url() { return 'https://go.elementor.com/global-layout/'; } protected function register_tab_controls() { $breakpoints_default_config = Breakpoints_Manager::get_default_config(); $breakpoint_key_mobile = Breakpoints_Manager::BREAKPOINT_KEY_MOBILE; $breakpoint_key_tablet = Breakpoints_Manager::BREAKPOINT_KEY_TABLET; $this->start_controls_section( 'section_' . $this->get_id(), [ 'label' => esc_html__( 'Layout Settings', 'elementor' ), 'tab' => $this->get_id(), ] ); $this->add_responsive_control( 'container_width', [ 'label' => esc_html__( 'Content Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'default' => [ 'size' => 1140, ], 'tablet_default' => [ 'size' => $breakpoints_default_config[ $breakpoint_key_tablet ]['default_value'], ], 'mobile_default' => [ 'size' => $breakpoints_default_config[ $breakpoint_key_mobile ]['default_value'], ], 'range' => [ 'px' => [ 'min' => 300, 'max' => 1500, 'step' => 10, ], ], 'description' => esc_html__( 'Sets the default width of the content area (Default: 1140px)', 'elementor' ), 'selectors' => [ '.elementor-section.elementor-section-boxed > .elementor-container' => 'max-width: {{SIZE}}{{UNIT}}', '.e-con' => '--container-max-width: {{SIZE}}{{UNIT}}', ], ] ); $is_container_active = Plugin::instance()->experiments->is_feature_active( 'container' ); if ( $is_container_active ) { $this->add_responsive_control( 'container_padding', [ 'label' => esc_html__( 'Container Padding', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'description' => esc_html__( 'Sets the default space inside the container (Default is 10px)', 'elementor' ), 'selectors' => [ '.e-con' => '--container-default-padding-top: {{TOP}}{{UNIT}}; --container-default-padding-right: {{RIGHT}}{{UNIT}}; --container-default-padding-bottom: {{BOTTOM}}{{UNIT}}; --container-default-padding-left: {{LEFT}}{{UNIT}};', ], ] ); } $widgets_space_label = $is_container_active ? esc_html__( 'Gaps', 'elementor' ) : esc_html__( 'Widgets Space', 'elementor' ); $this->add_control( 'space_between_widgets', [ 'label' => $widgets_space_label, 'type' => Controls_Manager::GAPS, 'default' => [ 'row' => '20', 'column' => '20', 'unit' => 'px', ], 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'placeholder' => [ 'row' => '20', 'column' => '20', ], 'description' => esc_html__( 'Sets the default space between widgets (Default: 20px)', 'elementor' ), 'selectors' => $this->get_spacing_selectors(), 'conversion_map' => [ 'old_key' => 'size', 'new_key' => 'column', ], 'upgrade_conversion_map' => [ 'old_key' => 'size', 'new_keys' => [ 'column', 'row' ], ], 'validators' => [ 'Number' => [ 'min' => 0, ], ], ] ); $this->add_control( 'page_title_selector', [ 'label' => esc_html__( 'Page Title Selector', 'elementor' ), 'type' => Controls_Manager::TEXT, 'default' => 'h1.entry-title', 'placeholder' => 'h1.entry-title', 'description' => esc_html__( 'Elementor lets you hide the page title. This works for themes that have "h1.entry-title" selector. If your theme\'s selector is different, please enter it above.', 'elementor' ), 'label_block' => true, 'ai' => [ 'active' => false, ], 'selectors' => [ // Hack to convert the value into a CSS selector. '' => '}{{VALUE}}{display: var(--page-title-display)', ], ] ); $this->add_control( 'stretched_section_container', [ 'label' => esc_html__( 'Stretched Section Fit To', 'elementor' ), 'type' => Controls_Manager::TEXT, 'placeholder' => 'body', 'description' => esc_html__( 'Enter parent element selector to which stretched sections will fit to (e.g. #primary / .wrapper / main etc). Leave blank to fit to page width.', 'elementor' ), 'label_block' => true, 'frontend_available' => true, 'ai' => [ 'active' => false, ], ] ); /** * @var PageTemplatesModule $page_templates_module */ $page_templates_module = Plugin::$instance->modules_manager->get_modules( 'page-templates' ); $page_templates = $page_templates_module->add_page_templates( [], null, null ); // Removes the Theme option from the templates because 'default' is already handled. unset( $page_templates[ PageTemplatesModule::TEMPLATE_THEME ] ); $page_template_control_options = [ 'label' => esc_html__( 'Default Page Layout', 'elementor' ), 'options' => [ // This is here because the "Theme" string is different than the default option's string. 'default' => esc_html__( 'Theme', 'elementor' ), ] + $page_templates, ]; $page_templates_module->add_template_controls( $this->parent, 'default_page_template', $page_template_control_options ); $this->end_controls_section(); $this->start_controls_section( 'section_breakpoints', [ 'label' => esc_html__( 'Breakpoints', 'elementor' ), 'tab' => $this->get_id(), ] ); $prefix = Breakpoints_Manager::BREAKPOINT_SETTING_PREFIX; $options = []; foreach ( $breakpoints_default_config as $breakpoint_key => $breakpoint ) { $options[ $prefix . $breakpoint_key ] = $breakpoint['label']; } if ( Plugin::$instance->experiments->is_feature_active( 'additional_custom_breakpoints' ) ) { $active_breakpoints_control_type = Controls_Manager::SELECT2; } else { $active_breakpoints_control_type = Controls_Manager::HIDDEN; } $this->add_control( self::ACTIVE_BREAKPOINTS_CONTROL_ID, [ 'label' => esc_html__( 'Active Breakpoints', 'elementor' ), 'type' => $active_breakpoints_control_type, 'description' => esc_html__( 'Mobile and Tablet options cannot be deleted.', 'elementor' ), 'options' => $options, 'default' => [ $prefix . $breakpoint_key_mobile, $prefix . $breakpoint_key_tablet, ], 'select2options' => [ 'allowClear' => false, ], 'lockedOptions' => [ $prefix . $breakpoint_key_mobile, $prefix . $breakpoint_key_tablet, ], 'label_block' => true, 'render_type' => 'none', 'frontend_available' => true, 'multiple' => true, ] ); $this->add_breakpoints_controls(); // Include the old mobile and tablet breakpoint controls as hidden for backwards compatibility. $this->add_control( 'viewport_md', [ 'type' => Controls_Manager::HIDDEN ] ); $this->add_control( 'viewport_lg', [ 'type' => Controls_Manager::HIDDEN ] ); $this->end_controls_section(); } private function get_spacing_selectors(): array { $optimized_markup = Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); $sections_widget_spacing = $optimized_markup ? '--kit-widget-spacing: {{ROW}}{{UNIT}}' : 'margin-block-end: {{ROW}}{{UNIT}}'; return [ '.elementor-widget:not(:last-child)' => $sections_widget_spacing, '.elementor-element' => '--widgets-spacing: {{ROW}}{{UNIT}} {{COLUMN}}{{UNIT}};--widgets-spacing-row: {{ROW}}{{UNIT}};--widgets-spacing-column: {{COLUMN}}{{UNIT}};', ]; } /** * Before Save * * Runs Before the Kit document is saved. * * For backwards compatibility, when the mobile and tablet breakpoints are updated, we also update the * old breakpoint settings ('viewport_md', 'viewport_lg' ) with the saved values + 1px. The reason 1px * is added is because the old breakpoints system was min-width based, and the new system introduced in * Elementor v3.2.0 is max-width based. * * @since 3.2.0 * * @param array $data * @return array $data */ public function before_save( array $data ) { // When creating a default kit, $data['settings'] is empty and should remain empty, so settings. if ( empty( $data['settings'] ) ) { return $data; } $prefix = Breakpoints_Manager::BREAKPOINT_SETTING_PREFIX; $mobile_breakpoint_key = $prefix . Breakpoints_Manager::BREAKPOINT_KEY_MOBILE; $tablet_breakpoint_key = $prefix . Breakpoints_Manager::BREAKPOINT_KEY_TABLET; $default_breakpoint_config = Breakpoints_Manager::get_default_config(); // Update the old mobile breakpoint. If the setting is empty, use the default value. $data['settings'][ $prefix . 'md' ] = empty( $data['settings'][ $mobile_breakpoint_key ] ) ? $default_breakpoint_config[ Breakpoints_Manager::BREAKPOINT_KEY_MOBILE ]['default_value'] + 1 : $data['settings'][ $mobile_breakpoint_key ] + 1; // Update the old tablet breakpoint. If the setting is empty, use the default value. $data['settings'][ $prefix . 'lg' ] = empty( $data['settings'][ $tablet_breakpoint_key ] ) ? $default_breakpoint_config[ Breakpoints_Manager::BREAKPOINT_KEY_TABLET ]['default_value'] + 1 : $data['settings'][ $tablet_breakpoint_key ] + 1; return $data; } public function on_save( $data ) { if ( ! isset( $data['settings'] ) || ( isset( $data['settings']['post_status'] ) && Document::STATUS_PUBLISH !== $data['settings']['post_status'] ) ) { return; } $should_compile_css = false; $breakpoints_default_config = Breakpoints_Manager::get_default_config(); foreach ( $breakpoints_default_config as $breakpoint_key => $default_config ) { $breakpoint_setting_key = Breakpoints_Manager::BREAKPOINT_SETTING_PREFIX . $breakpoint_key; if ( isset( $data['settings'][ $breakpoint_setting_key ] ) ) { $should_compile_css = true; } } if ( $should_compile_css ) { Breakpoints_Manager::compile_stylesheet_templates(); } } private function add_breakpoints_controls() { $default_breakpoints_config = Breakpoints_Manager::get_default_config(); $prefix = Breakpoints_Manager::BREAKPOINT_SETTING_PREFIX; // If the ACB experiment is inactive, only add the mobile and tablet controls. if ( ! Plugin::$instance->experiments->is_feature_active( 'additional_custom_breakpoints' ) ) { $default_breakpoints_config = array_intersect_key( $default_breakpoints_config, array_flip( [ Breakpoints_Manager::BREAKPOINT_KEY_MOBILE, Breakpoints_Manager::BREAKPOINT_KEY_TABLET ] ) ); } // Add a control for each of the **default** breakpoints. foreach ( $default_breakpoints_config as $breakpoint_key => $default_breakpoint_config ) { $this->add_control( 'breakpoint_' . $breakpoint_key . '_heading', [ 'label' => $default_breakpoint_config['label'], 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'conditions' => [ 'terms' => [ [ 'name' => 'active_breakpoints', 'operator' => 'contains', 'value' => $prefix . $breakpoint_key, ], ], ], ] ); $control_config = [ 'label' => esc_html__( 'Breakpoint', 'elementor' ) . ' (px)', 'type' => Controls_Manager::NUMBER, 'placeholder' => $default_breakpoint_config['default_value'], 'frontend_available' => true, 'validators' => [ 'Breakpoint' => [ 'breakpointName' => $breakpoint_key, ], ], 'conditions' => [ 'terms' => [ [ 'name' => 'active_breakpoints', 'operator' => 'contains', 'value' => $prefix . $breakpoint_key, ], ], ], ]; if ( Breakpoints_Manager::BREAKPOINT_KEY_WIDESCREEN === $breakpoint_key ) { $control_config['description'] = esc_html__( 'Widescreen breakpoint settings will apply from the selected value and up.', 'elementor' ); } // Add the breakpoint Control itself. $this->add_control( $prefix . $breakpoint_key, $control_config ); } } } tabs/settings-lightbox.php 0000644 00000011401 15073240362 0011663 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Controls_Manager; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Settings_Lightbox extends Tab_Base { public function get_id() { return 'settings-lightbox'; } public function get_title() { return esc_html__( 'Lightbox', 'elementor' ); } public function get_group() { return 'settings'; } public function get_icon() { return 'eicon-lightbox-expand'; } public function get_help_url() { return 'https://go.elementor.com/global-lightbox/'; } protected function register_tab_controls() { $this->start_controls_section( 'section_' . $this->get_id(), [ 'label' => $this->get_title(), 'tab' => $this->get_id(), ] ); $this->add_control( 'global_image_lightbox', [ 'label' => esc_html__( 'Image Lightbox', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'description' => esc_html__( 'Open all image links in a lightbox popup window. The lightbox will automatically work on any link that leads to an image file.', 'elementor' ), 'frontend_available' => true, ] ); $this->add_control( 'lightbox_enable_counter', [ 'label' => esc_html__( 'Counter', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'frontend_available' => true, ] ); $this->add_control( 'lightbox_enable_fullscreen', [ 'label' => esc_html__( 'Fullscreen', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'frontend_available' => true, ] ); $this->add_control( 'lightbox_enable_zoom', [ 'label' => esc_html__( 'Zoom', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'frontend_available' => true, ] ); $this->add_control( 'lightbox_enable_share', [ 'label' => esc_html__( 'Share', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'frontend_available' => true, ] ); $this->add_control( 'lightbox_title_src', [ 'label' => esc_html__( 'Title', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__( 'None', 'elementor' ), 'title' => esc_html__( 'Title', 'elementor' ), 'caption' => esc_html__( 'Caption', 'elementor' ), 'alt' => esc_html__( 'Alt', 'elementor' ), 'description' => esc_html__( 'Description', 'elementor' ), ], 'default' => 'title', 'frontend_available' => true, ] ); $this->add_control( 'lightbox_description_src', [ 'label' => esc_html__( 'Description', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__( 'None', 'elementor' ), 'title' => esc_html__( 'Title', 'elementor' ), 'caption' => esc_html__( 'Caption', 'elementor' ), 'alt' => esc_html__( 'Alt', 'elementor' ), 'description' => esc_html__( 'Description', 'elementor' ), ], 'default' => 'description', 'frontend_available' => true, ] ); $this->add_control( 'lightbox_color', [ 'label' => esc_html__( 'Background Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '.elementor-lightbox' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'lightbox_ui_color', [ 'label' => esc_html__( 'UI Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '.elementor-lightbox' => '--lightbox-ui-color: {{VALUE}}', ], ] ); $this->add_control( 'lightbox_ui_color_hover', [ 'label' => esc_html__( 'UI Hover Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '.elementor-lightbox' => '--lightbox-ui-color-hover: {{VALUE}}', ], ] ); $this->add_control( 'lightbox_text_color', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '.elementor-lightbox' => '--lightbox-text-color: {{VALUE}}', ], ] ); $this->add_control( 'lightbox_icons_size', [ 'label' => esc_html__( 'Toolbar Icons Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ '.elementor-lightbox' => '--lightbox-header-icons-size: {{SIZE}}{{UNIT}}', ], 'separator' => 'before', ] ); $this->add_control( 'lightbox_slider_icons_size', [ 'label' => esc_html__( 'Navigation Icons Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ '.elementor-lightbox' => '--lightbox-navigation-icons-size: {{SIZE}}{{UNIT}}', ], 'separator' => 'before', ] ); $this->end_controls_section(); } } tabs/settings-custom-css.php 0000644 00000001301 15073240362 0012141 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Plugin; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Settings_Custom_CSS extends Tab_Base { public function get_id() { return 'settings-custom-css'; } public function get_title() { return esc_html__( 'Custom CSS', 'elementor' ); } public function get_group() { return 'settings'; } public function get_icon() { return 'eicon-custom-css'; } public function get_help_url() { return 'https://go.elementor.com/global-custom-css/'; } protected function register_tab_controls() { Plugin::$instance->controls_manager->add_custom_css_controls( $this->parent, $this->get_id() ); } } tabs/global-typography.php 0000644 00000012344 15073240362 0011660 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Controls_Manager; use Elementor\Core\Kits\Controls\Repeater as Global_Style_Repeater; use Elementor\Group_Control_Typography; use Elementor\Repeater; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Global_Typography extends Tab_Base { const TYPOGRAPHY_PRIMARY = 'globals/typography?id=primary'; const TYPOGRAPHY_SECONDARY = 'globals/typography?id=secondary'; const TYPOGRAPHY_TEXT = 'globals/typography?id=text'; const TYPOGRAPHY_ACCENT = 'globals/typography?id=accent'; const TYPOGRAPHY_NAME = 'typography'; const TYPOGRAPHY_GROUP_PREFIX = self::TYPOGRAPHY_NAME . '_'; public function get_id() { return 'global-typography'; } public function get_title() { return esc_html__( 'Global Fonts', 'elementor' ); } public function get_group() { return 'global'; } public function get_icon() { return 'eicon-t-letter'; } public function get_help_url() { return 'https://go.elementor.com/global-fonts/'; } protected function register_tab_controls() { $this->start_controls_section( 'section_text_style', [ 'label' => esc_html__( 'Global Fonts', 'elementor' ), 'tab' => $this->get_id(), ] ); $repeater = new Repeater(); $repeater->add_control( 'title', [ 'type' => Controls_Manager::TEXT, 'label_block' => true, 'required' => true, ] ); $repeater->add_group_control( Group_Control_Typography::get_type(), [ 'name' => self::TYPOGRAPHY_NAME, 'label' => '', 'global' => [ 'active' => false, ], 'fields_options' => [ 'font_family' => [ 'selectors' => [ '{{SELECTOR}}' => '--e-global-typography-{{external._id.VALUE}}-font-family: "{{VALUE}}"', ], ], 'font_size' => [ 'selectors' => [ '{{SELECTOR}}' => '--e-global-typography-{{external._id.VALUE}}-font-size: {{SIZE}}{{UNIT}}', ], ], 'font_weight' => [ 'selectors' => [ '{{SELECTOR}}' => '--e-global-typography-{{external._id.VALUE}}-font-weight: {{VALUE}}', ], ], 'text_transform' => [ 'selectors' => [ '{{SELECTOR}}' => '--e-global-typography-{{external._id.VALUE}}-text-transform: {{VALUE}}', ], ], 'font_style' => [ 'selectors' => [ '{{SELECTOR}}' => '--e-global-typography-{{external._id.VALUE}}-font-style: {{VALUE}}', ], ], 'text_decoration' => [ 'selectors' => [ '{{SELECTOR}}' => '--e-global-typography-{{external._id.VALUE}}-text-decoration: {{VALUE}}', ], ], 'line_height' => [ 'selectors' => [ '{{SELECTOR}}' => '--e-global-typography-{{external._id.VALUE}}-line-height: {{SIZE}}{{UNIT}}', ], ], 'letter_spacing' => [ 'selectors' => [ '{{SELECTOR}}' => '--e-global-typography-{{external._id.VALUE}}-letter-spacing: {{SIZE}}{{UNIT}}', ], ], 'word_spacing' => [ 'selectors' => [ '{{SELECTOR}}' => '--e-global-typography-{{external._id.VALUE}}-word-spacing: {{SIZE}}{{UNIT}}', ], ], ], ] ); $typography_key = self::TYPOGRAPHY_GROUP_PREFIX . 'typography'; $font_family_key = self::TYPOGRAPHY_GROUP_PREFIX . 'font_family'; $font_weight_key = self::TYPOGRAPHY_GROUP_PREFIX . 'font_weight'; $default_typography = [ [ '_id' => 'primary', 'title' => esc_html__( 'Primary', 'elementor' ), $typography_key => 'custom', $font_family_key => 'Roboto', $font_weight_key => '600', ], [ '_id' => 'secondary', 'title' => esc_html__( 'Secondary', 'elementor' ), $typography_key => 'custom', $font_family_key => 'Roboto Slab', $font_weight_key => '400', ], [ '_id' => 'text', 'title' => esc_html__( 'Text', 'elementor' ), $typography_key => 'custom', $font_family_key => 'Roboto', $font_weight_key => '400', ], [ '_id' => 'accent', 'title' => esc_html__( 'Accent', 'elementor' ), $typography_key => 'custom', $font_family_key => 'Roboto', $font_weight_key => '500', ], ]; $this->add_control( 'heading_system_typography', [ 'type' => Controls_Manager::HEADING, 'label' => esc_html__( 'System Fonts', 'elementor' ), ] ); $this->add_control( 'system_typography', [ 'type' => Global_Style_Repeater::CONTROL_TYPE, 'fields' => $repeater->get_controls(), 'default' => $default_typography, 'item_actions' => [ 'add' => false, 'remove' => false, ], 'separator' => 'after', ] ); $this->add_control( 'heading_custom_typography', [ 'type' => Controls_Manager::HEADING, 'label' => esc_html__( 'Custom Fonts', 'elementor' ), ] ); $this->add_control( 'custom_typography', [ 'type' => Global_Style_Repeater::CONTROL_TYPE, 'fields' => $repeater->get_controls(), ] ); $this->add_control( 'default_generic_fonts', [ 'label' => esc_html__( 'Fallback Font Family', 'elementor' ), 'type' => Controls_Manager::TEXT, 'default' => 'Sans-serif', 'description' => esc_html__( 'The list of fonts used if the chosen font is not available.', 'elementor' ), 'label_block' => true, 'separator' => 'before', 'ai' => [ 'active' => false, ], ] ); $this->end_controls_section(); } } tabs/settings-background.php 0000644 00000004046 15073240362 0012171 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents\Tabs; use Elementor\Controls_Manager; use Elementor\Group_Control_Background; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Settings_Background extends Tab_Base { public function get_id() { return 'settings-background'; } public function get_title() { return esc_html__( 'Background', 'elementor' ); } public function get_group() { return 'settings'; } public function get_icon() { return 'eicon-background'; } public function get_help_url() { return 'https://go.elementor.com/global-background/'; } protected function register_tab_controls() { $this->start_controls_section( 'section_background', [ 'label' => $this->get_title(), 'tab' => $this->get_id(), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'body_background', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}}', 'fields_options' => [ 'background' => [ 'frontend_available' => true, ], 'color' => [ 'dynamic' => [], ], 'color_b' => [ 'dynamic' => [], ], ], ] ); $this->add_control( 'mobile_browser_background', [ 'label' => esc_html__( 'Mobile Browser Background', 'elementor' ), 'type' => Controls_Manager::COLOR, 'description' => esc_html__( 'The `theme-color` meta tag will only be available in supported browsers and devices.', 'elementor' ), 'separator' => 'before', ] ); $this->add_control( 'body_overscroll_behavior', [ 'label' => esc_html__( 'Overscroll Behavior', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__( 'Default', 'elementor' ), 'none' => esc_html__( 'None', 'elementor' ), 'auto' => esc_html__( 'Auto', 'elementor' ), 'contain' => esc_html__( 'Contain', 'elementor' ), ], 'separator' => 'before', 'selectors' => [ '{{WRAPPER}}' => 'overscroll-behavior: {{VALUE}};', ], ] ); $this->end_controls_section(); } } kit.php 0000644 00000012562 15073240362 0006054 0 ustar 00 <?php namespace Elementor\Core\Kits\Documents; use Elementor\Core\DocumentTypes\PageBase; use Elementor\Core\Files\CSS\Post as Post_CSS; use Elementor\Core\Settings\Manager as SettingsManager; use Elementor\Core\Settings\Page\Manager as PageManager; use Elementor\Plugin; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Kit extends PageBase { /** * @var Tabs\Tab_Base[] */ private $tabs; public function __construct( array $data = [] ) { parent::__construct( $data ); $this->register_tabs(); } public static function get_properties() { $properties = parent::get_properties(); $properties['has_elements'] = false; $properties['show_in_finder'] = false; $properties['show_on_admin_bar'] = false; $properties['edit_capability'] = 'edit_theme_options'; $properties['support_kit'] = true; return $properties; } public static function get_type() { return 'kit'; } public static function get_title() { return esc_html__( 'Kit', 'elementor' ); } /** * @return Tabs\Tab_Base[] */ public function get_tabs() { return $this->tabs; } /** * Retrieve a tab by ID. * * @param $id * * @return Tabs\Tab_Base */ public function get_tab( $id ) { return self::get_items( $this->get_tabs(), $id ); } protected function get_have_a_look_url() { return ''; } public static function get_editor_panel_config() { $config = parent::get_editor_panel_config(); $config['default_route'] = 'panel/global/menu'; $config['needHelpUrl'] = 'https://go.elementor.com/global-settings/'; return $config; } public function get_css_wrapper_selector() { return '.elementor-kit-' . $this->get_main_id(); } public function save( $data ) { foreach ( $this->tabs as $tab ) { $data = $tab->before_save( $data ); } $saved = parent::save( $data ); if ( ! $saved ) { return false; } // Should set is_saving to true, to avoid infinite loop when updating // settings like: 'site_name" or "site_description". $this->set_is_saving( true ); foreach ( $this->tabs as $tab ) { $tab->on_save( $data ); } $this->set_is_saving( false ); // When deleting a global color or typo, the css variable still exists in the frontend // but without any value and it makes the element to be un styled even if there is a default style for the base element, // for that reason this method removes css files of the entire site. Plugin::instance()->files_manager->clear_cache(); return $saved; } /** * Register a kit settings menu. * * @param $id * @param $class_name */ public function register_tab( $id, $class_name ) { $this->tabs[ $id ] = new $class_name( $this ); } /** * @inheritDoc */ protected function get_initial_config() { $config = parent::get_initial_config(); foreach ( $this->tabs as $id => $tab ) { $config['tabs'][ $id ] = [ 'id' => $id, 'title' => $tab->get_title(), 'icon' => $tab->get_icon(), 'group' => $tab->get_group(), 'helpUrl' => $tab->get_help_url(), 'additionalContent' => $tab->get_additional_tab_content(), ]; } return $config; } /** * @since 3.1.0 * @access protected */ protected function register_controls() { $this->register_document_controls(); foreach ( $this->tabs as $tab ) { $tab->register_controls(); } } protected function get_post_statuses() { return [ 'draft' => sprintf( '%s (%s)', esc_html__( 'Disabled', 'elementor' ), esc_html__( 'Draft', 'elementor' ) ), 'publish' => esc_html__( 'Published', 'elementor' ), ]; } public function add_repeater_row( $control_id, $item ) { $meta_key = PageManager::META_KEY; $document_settings = $this->get_meta( $meta_key ); if ( ! $document_settings ) { $document_settings = []; } if ( ! isset( $document_settings[ $control_id ] ) ) { $document_settings[ $control_id ] = []; } $document_settings[ $control_id ][] = $item; $page_settings_manager = SettingsManager::get_settings_managers( 'page' ); $page_settings_manager->save_settings( $document_settings, $this->get_id() ); /** @var Kit $autosave */ $autosave = $this->get_autosave(); if ( $autosave ) { $autosave->add_repeater_row( $control_id, $item ); } // Remove Post CSS. $post_css = Post_CSS::create( $this->post->ID ); $post_css->delete(); // Refresh Cache. Plugin::$instance->documents->get( $this->post->ID, false ); $post_css = Post_CSS::create( $this->post->ID ); $post_css->enqueue(); } /** * Register default tabs (menu pages) for site settings. */ private function register_tabs() { $tabs = [ 'global-colors' => Tabs\Global_Colors::class, 'global-typography' => Tabs\Global_Typography::class, 'theme-style-typography' => Tabs\Theme_Style_Typography::class, 'theme-style-buttons' => Tabs\Theme_Style_Buttons::class, 'theme-style-images' => Tabs\Theme_Style_Images::class, 'theme-style-form-fields' => Tabs\Theme_Style_Form_Fields::class, 'settings-site-identity' => Tabs\Settings_Site_Identity::class, 'settings-background' => Tabs\Settings_Background::class, 'settings-layout' => Tabs\Settings_Layout::class, 'settings-lightbox' => Tabs\Settings_Lightbox::class, 'settings-page-transitions' => Tabs\Settings_Page_Transitions::class, 'settings-custom-css' => Tabs\Settings_Custom_CSS::class, ]; foreach ( $tabs as $id => $class ) { $this->register_tab( $id, $class ); } do_action( 'elementor/kit/register_tabs', $this ); } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings