Файловый менеджер - Редактировать - /home/infrafs/INFRABIKEIT/wp-content/plugins/kits.zip
Назад
PK -d2\,+;0�- �- manager.phpnu �[��� <?php namespace Elementor\Core\Kits; use Elementor\Core\Base\Document; use Elementor\Core\Kits\Controls\Repeater; use Elementor\Core\Kits\Documents\Tabs\Global_Colors; use Elementor\Core\Kits\Documents\Tabs\Global_Typography; use Elementor\Plugin; use Elementor\Core\Files\CSS\Post as Post_CSS; use Elementor\Core\Files\CSS\Post_Preview as Post_Preview; use Elementor\Core\Documents_Manager; use Elementor\Core\Kits\Documents\Kit; use Elementor\TemplateLibrary\Source_Local; use Elementor\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Manager { const OPTION_ACTIVE = 'elementor_active_kit'; const E_HASH_COMMAND_OPEN_SITE_SETTINGS = 'e:run:panel/global/open'; public function get_active_id() { return get_option( self::OPTION_ACTIVE ); } public function get_active_kit() { $kit = Plugin::$instance->documents->get( $this->get_active_id() ); if ( ! $this->is_valid_kit( $kit ) ) { return $this->get_empty_kit_instance(); } return $kit; } public function get_active_kit_for_frontend() { $kit = Plugin::$instance->documents->get_doc_for_frontend( $this->get_active_id() ); if ( ! $this->is_valid_kit( $kit ) ) { return $this->get_empty_kit_instance(); } return $kit; } /** * @param $kit * * @return bool */ private function is_valid_kit( $kit ) { return $kit && $kit instanceof Kit && 'trash' !== $kit->get_main_post()->post_status; } /** * Returns an empty kit for situation when there is no kit in the site. * * @return Kit * @throws \Exception */ private function get_empty_kit_instance() { return new Kit( [ 'settings' => [], 'post_id' => 0, ] ); } /** * Checks if specific post is a kit. * * @param $post_id * * @return bool */ public function is_kit( $post_id ) { $document = Plugin::$instance->documents->get( $post_id ); return $document && $document instanceof Kit && ! $document->is_revision(); } /** * Init kit controls. * * A temp solution in order to avoid init kit group control from within another group control. * * After moving the `default_font` to the kit, the Typography group control cause initialize the kit controls at: https://github.com/elementor/elementor/blob/e6e1db9eddef7e3c1a5b2ba0c2338e2af2a3bfe3/includes/controls/groups/typography.php#L91 * and because the group control is a singleton, its args are changed to the last kit group control. */ public function init_kit_controls() { $this->get_active_kit_for_frontend()->get_settings(); } public function get_current_settings( $setting = null ) { $kit = $this->get_active_kit_for_frontend(); if ( ! $kit ) { return ''; } return $kit->get_settings( $setting ); } public function create( array $kit_data = [], array $kit_meta_data = [] ) { $default_kit_data = [ 'post_status' => 'publish', ]; $kit_data = array_merge( $default_kit_data, $kit_data ); $kit_data['post_type'] = Source_Local::CPT; $kit = Plugin::$instance->documents->create( 'kit', $kit_data, $kit_meta_data ); return $kit->get_id(); } public function create_default() { return $this->create( [ 'post_title' => esc_html__( 'Default Kit', 'elementor' ), ] ); } /** * Create a default kit if needed. * * This action runs on activation hook, all the Plugin components do not exists and * the Document manager and Kits manager instances cannot be used. * * @return int|void|\WP_Error */ public static function create_default_kit() { if ( get_option( self::OPTION_ACTIVE ) ) { return; } $id = wp_insert_post( [ 'post_title' => __( 'Default Kit', 'elementor' ), 'post_type' => Source_Local::CPT, 'post_status' => 'publish', 'meta_input' => [ '_elementor_edit_mode' => 'builder', Document::TYPE_META_KEY => 'kit', ], ] ); update_option( self::OPTION_ACTIVE, $id ); return $id; } /** * @param Documents_Manager $documents_manager */ public function register_document( $documents_manager ) { $documents_manager->register_document_type( 'kit', Kit::get_class_full_name() ); } public function localize_settings( $settings ) { $kit = $this->get_active_kit(); $kit_controls = $kit->get_controls(); $design_system_controls = [ 'colors' => $kit_controls['system_colors']['fields'], 'typography' => $kit_controls['system_typography']['fields'], ]; $settings = array_replace_recursive( $settings, [ 'kit_id' => $kit->get_main_id(), 'kit_config' => [ 'typography_prefix' => Global_Typography::TYPOGRAPHY_GROUP_PREFIX, 'design_system_controls' => $design_system_controls, ], 'user' => [ 'can_edit_kit' => $kit->is_editable_by_current_user(), ], ] ); return $settings; } public function preview_enqueue_styles() { $kit = $this->get_kit_for_frontend(); if ( $kit ) { // On preview, the global style is not enqueued. $this->frontend_before_enqueue_styles(); Plugin::$instance->frontend->print_fonts_links(); } } public function frontend_before_enqueue_styles() { $kit = $this->get_kit_for_frontend(); if ( $kit ) { if ( $kit->is_autosave() ) { $css_file = Post_Preview::create( $kit->get_id() ); } else { $css_file = Post_CSS::create( $kit->get_id() ); } $css_file->enqueue(); } } public function render_panel_html() { require __DIR__ . '/views/panel.php'; } public function get_kit_for_frontend() { $kit = false; $active_kit = $this->get_active_kit(); $is_kit_preview = is_preview() && isset( $_GET['preview_id'] ) && $active_kit->get_main_id() === (int) $_GET['preview_id']; if ( $is_kit_preview ) { $kit = Plugin::$instance->documents->get_doc_or_auto_save( $active_kit->get_main_id(), get_current_user_id() ); } elseif ( 'publish' === $active_kit->get_main_post()->post_status ) { $kit = $active_kit; } return $kit; } public function update_kit_settings_based_on_option( $key, $value ) { /** @var Kit $active_kit */ $active_kit = $this->get_active_kit(); if ( $active_kit->is_saving() ) { return; } $active_kit->update_settings( [ $key => $value ] ); } /** * Map Scheme To Global * * Convert a given scheme value to its corresponding default global value * * @param string $type 'color'/'typography' * @param $value * @return mixed */ private function map_scheme_to_global( $type, $value ) { $schemes_to_globals_map = [ 'color' => [ '1' => Global_Colors::COLOR_PRIMARY, '2' => Global_Colors::COLOR_SECONDARY, '3' => Global_Colors::COLOR_TEXT, '4' => Global_Colors::COLOR_ACCENT, ], 'typography' => [ '1' => Global_Typography::TYPOGRAPHY_PRIMARY, '2' => Global_Typography::TYPOGRAPHY_SECONDARY, '3' => Global_Typography::TYPOGRAPHY_TEXT, '4' => Global_Typography::TYPOGRAPHY_ACCENT, ], ]; return $schemes_to_globals_map[ $type ][ $value ]; } /** * Convert Scheme to Default Global * * If a control has a scheme property, convert it to a default Global. * * @param $scheme - Control scheme property * @return array - Control/group control args * @since 3.0.0 * @access public */ public function convert_scheme_to_global( $scheme ) { if ( isset( $scheme['type'] ) && isset( $scheme['value'] ) ) { //_deprecated_argument( $args['scheme'], '3.0.0', 'Schemes are now deprecated - use $args[\'global\'] instead.' ); return $this->map_scheme_to_global( $scheme['type'], $scheme['value'] ); } // Typography control 'scheme' properties usually only include the string with the typography value ('1'-'4'). return $this->map_scheme_to_global( 'typography', $scheme ); } public function register_controls() { $controls_manager = Plugin::$instance->controls_manager; $controls_manager->register_control( Repeater::CONTROL_TYPE, new Repeater() ); } public function is_custom_colors_enabled() { return ! get_option( 'elementor_disable_color_schemes' ); } public function is_custom_typography_enabled() { return ! get_option( 'elementor_disable_typography_schemes' ); } /** * Add kit wrapper body class. * * It should be added even for non Elementor pages, * in order to support embedded templates. */ private function add_body_class() { $kit = $this->get_kit_for_frontend(); if ( $kit ) { Plugin::$instance->frontend->add_body_class( 'elementor-kit-' . $kit->get_main_id() ); } } /** * Send a confirm message before move a kit to trash, or if delete permanently not for trash. * * @param $post_id * @param false $is_permanently_delete */ private function before_delete_kit( $post_id, $is_permanently_delete = false ) { $document = Plugin::$instance->documents->get( $post_id ); if ( ! $document || ! $this->is_kit( $post_id ) || isset( $_GET['force_delete_kit'] ) || // phpcs:ignore -- nonce validation is not require here. ( $is_permanently_delete && $document->is_trash() ) ) { return; } ob_start(); require __DIR__ . '/views/trash-kit-confirmation.php'; $confirmation_content = ob_get_clean(); // PHPCS - the content does not contain user input value. wp_die( new \WP_Error( 'cant_delete_kit', $confirmation_content ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Add 'Edit with elementor -> Site Settings' in admin bar. * * @param [] $admin_bar_config * * @return array $admin_bar_config */ private function add_menu_in_admin_bar( $admin_bar_config ) { $document = Plugin::$instance->documents->get( get_the_ID() ); if ( ! $document || ! $document->is_built_with_elementor() ) { $recent_edited_post = Utils::get_recently_edited_posts_query( [ 'posts_per_page' => 1, ] ); if ( $recent_edited_post->post_count ) { $posts = $recent_edited_post->get_posts(); $document = Plugin::$instance->documents->get( reset( $posts )->ID ); } } if ( $document ) { $admin_bar_config['elementor_edit_page']['children'][] = [ 'id' => 'elementor_site_settings', 'title' => esc_html__( 'Site Settings', 'elementor' ), 'sub_title' => esc_html__( 'Site', 'elementor' ), 'href' => $document->get_edit_url() . '#' . self::E_HASH_COMMAND_OPEN_SITE_SETTINGS, 'class' => 'elementor-site-settings', 'parent_class' => 'elementor-second-section', ]; } return $admin_bar_config; } public function __construct() { add_action( 'elementor/documents/register', [ $this, 'register_document' ] ); add_filter( 'elementor/editor/localize_settings', [ $this, 'localize_settings' ] ); add_filter( 'elementor/editor/footer', [ $this, 'render_panel_html' ] ); add_action( 'elementor/frontend/after_enqueue_styles', [ $this, 'frontend_before_enqueue_styles' ], 0 ); add_action( 'elementor/preview/enqueue_styles', [ $this, 'preview_enqueue_styles' ], 0 ); add_action( 'elementor/controls/controls_registered', [ $this, 'register_controls' ] ); add_action( 'wp_trash_post', function ( $post_id ) { $this->before_delete_kit( $post_id ); } ); add_action( 'before_delete_post', function ( $post_id ) { $this->before_delete_kit( $post_id, true ); } ); add_action( 'update_option_blogname', function ( $old_value, $value ) { $this->update_kit_settings_based_on_option( 'site_name', $value ); }, 10, 2 ); add_action( 'update_option_blogdescription', function ( $old_value, $value ) { $this->update_kit_settings_based_on_option( 'site_description', $value ); }, 10, 2 ); add_action( 'wp_head', function() { $this->add_body_class(); } ); add_filter( 'elementor/frontend/admin_bar/settings', function ( $admin_bar_config ) { return $this->add_menu_in_admin_bar( $admin_bar_config ); }, 9 /* Before site-editor (theme-builder) */ ); } } PK -d2\�xu� � documents/kit.phpnu �[��� <?php namespace Elementor\Core\Kits\Documents; use Elementor\Core\DocumentTypes\PageBase; use Elementor\Core\Files\CSS\Post as Post_CSS; use Elementor\Core\Kits\Documents\Tabs; 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 */ public function register_tab( $id, $class ) { $this->tabs[ $id ] = new $class( $this ); } /** * @inheritDoc */ protected function get_initial_config() { $config = parent::get_initial_config(); foreach ( $this->tabs as $id => $tab ) { $config['tabs'][ $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() { $is_edit_mode = Plugin::$instance->editor->is_edit_mode(); if ( ! $is_edit_mode ) { // In the Front End, the Kit is initialized before CSS is generated, so we always duplicate controls in // the kit. $initial_responsive_controls_duplication_mode = Plugin::$instance->breakpoints->get_responsive_control_duplication_mode(); Plugin::$instance->breakpoints->set_responsive_control_duplication_mode( 'on' ); } $this->register_document_controls(); foreach ( $this->tabs as $tab ) { $tab->register_controls(); } if ( ! $is_edit_mode ) { Plugin::$instance->breakpoints->set_responsive_control_duplication_mode( $initial_responsive_controls_duplication_mode ); } } 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, // TODO: Revert when Page Transitions will be released. //'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 ); } } PK -d2\oNI�} } ) documents/tabs/theme-style-typography.phpnu �[��� <?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(), [ 'label' => esc_html__( 'Typography', 'elementor' ), '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-bottom: {{SIZE}}{{UNIT}}', ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], 'em' => [ 'min' => 0.1, 'max' => 20, ], 'vh' => [ 'min' => 0, 'max' => 100, ], ], 'size_units' => [ 'px', 'em', 'vh' ], ] ); //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(), [ 'label' => esc_html__( 'Typography', 'elementor' ), '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(), [ 'label' => esc_html__( 'Typography', 'elementor' ), 'name' => 'link_hover_typography', 'selector' => $link_hover_selectors, ] ); $this->end_controls_tab(); $this->end_controls_tabs(); // Headings. $this->add_element_controls( esc_html__( 'H1', 'elementor' ), 'h1', '{{WRAPPER}} h1' ); $this->add_element_controls( esc_html__( 'H2', 'elementor' ), 'h2', '{{WRAPPER}} h2' ); $this->add_element_controls( esc_html__( 'H3', 'elementor' ), 'h3', '{{WRAPPER}} h3' ); $this->add_element_controls( esc_html__( 'H4', 'elementor' ), 'h4', '{{WRAPPER}} h4' ); $this->add_element_controls( esc_html__( 'H5', 'elementor' ), 'h5', '{{WRAPPER}} h5' ); $this->add_element_controls( esc_html__( 'H6', 'elementor' ), '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(), [ 'label' => esc_html__( 'Typography', 'elementor' ), 'name' => $prefix . '_typography', 'selector' => $selector, ] ); } } PK -d2\[� � � documents/tabs/global-colors.phpnu �[��� <?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, 'dynamic' => [], '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( 'system_colors', [ 'type' => Global_Style_Repeater::CONTROL_TYPE, 'fields' => $repeater->get_controls(), 'default' => $default_colors, 'item_actions' => [ 'add' => false, 'remove' => false, ], ] ); $this->add_control( 'custom_colors', [ 'type' => Global_Style_Repeater::CONTROL_TYPE, 'fields' => $repeater->get_controls(), ] ); $this->end_controls_section(); } } PK -d2\u��� � $ documents/tabs/global-typography.phpnu �[��� <?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}}', ], ], ], ] ); $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( 'system_typography', [ 'type' => Global_Style_Repeater::CONTROL_TYPE, 'fields' => $repeater->get_controls(), 'default' => $default_typography, 'item_actions' => [ 'add' => false, 'remove' => false, ], ] ); $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', ] ); $this->end_controls_section(); } } PK -d2\ؚ&�~) ~) "