PluginProbe
Elementor Website Builder – more than just a page builder / 3.16.3
Elementor Website Builder – more than just a page builder v3.16.3
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / core / kits / documents / tabs / tab-base.php

tab-base.php in Elementor Website Builder – more than just a page builder 3.16.3, at core/kits/documents/tabs/tab-base.php

90 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Core\Kits\Documents\Tabs;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Core\Kits\Documents\Kit;
7 use Elementor\Core\Kits\Manager;
8 use Elementor\Plugin;
9 use Elementor\Settings;
10 use Elementor\Sub_Controls_Stack;
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly
14 }
15
16 abstract class Tab_Base extends Sub_Controls_Stack {
17 /**
18 * @var Kit
19 */
20 protected $parent;
21
22 abstract protected function register_tab_controls();
23
24 public function get_group() {
25 return 'settings';
26 }
27
28 public function get_icon() {
29 return '';
30 }
31
32 public function get_help_url() {
33 return '';
34 }
35
36 public function get_additional_tab_content() {
37 return '';
38 }
39
40 public function register_controls() {
41 $this->register_tab();
42
43 $this->register_tab_controls();
44 }
45
46 public function on_save( $data ) {}
47
48 /**
49 * Before Save
50 *
51 * Allows for modifying the kit data before it is saved to the database.
52 *
53 * @param array $data
54 * @return array
55 */
56 public function before_save( array $data ) {
57 return $data;
58 }
59
60 protected function register_tab() {
61 Controls_Manager::add_tab( $this->get_id(), $this->get_title() );
62 }
63
64 protected function add_default_globals_notice() {
65 // Get the current section config (array - section id and tab) to use for creating a unique control ID and name
66 $current_section = $this->parent->get_current_section();
67
68 /** @var Manager $module */
69 $kits_manager = Plugin::$instance->kits_manager;
70
71 if ( $kits_manager->is_custom_colors_enabled() || $kits_manager->is_custom_typography_enabled() ) {
72 $this->add_control(
73 $current_section['section'] . '_schemes_notice',
74 [
75 'name' => $current_section['section'] . '_schemes_notice',
76 'type' => Controls_Manager::RAW_HTML,
77 'raw' => sprintf(
78 /* translators: 1: Link open tag, 2: Link close tag. */
79 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' ),
80 '<a href="' . esc_url( Settings::get_url() ) . '" target="_blank">',
81 '</a>'
82 ),
83 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
84 'render_type' => 'ui',
85 ]
86 );
87 }
88 }
89 }
90