PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.0
Elementor Website Builder – more than just a page builder v4.2.0
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 / settings / editor-preferences / model.php

model.php in Elementor Website Builder – more than just a page builder 4.2.0, at core/settings/editor-preferences/model.php

219 lines 5.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Core\Settings\EditorPreferences;
3
4 use Elementor\Controls_Manager;
5 use Elementor\Core\Settings\Base\Model as BaseModel;
6 use Elementor\Modules\Checklist\Module as ChecklistModule;
7 use Elementor\Plugin;
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12
13 class Model extends BaseModel {
14
15 /**
16 * Get element name.
17 *
18 * Retrieve the element name.
19 *
20 * @return string The name.
21 * @since 2.8.0
22 * @access public
23 */
24 public function get_name() {
25 return 'editor-preferences';
26 }
27
28 /**
29 * Get panel page settings.
30 *
31 * Retrieve the page setting for the current panel.
32 *
33 * @since 2.8.0
34 * @access public
35 */
36 public function get_panel_page_settings() {
37 return [
38 'title' => esc_html__( 'User Preferences', 'elementor' ),
39 ];
40 }
41
42 /**
43 * @since 3.1.0
44 * @access protected
45 */
46 protected function register_controls() {
47 $this->start_controls_section(
48 'preferences',
49 [
50 'tab' => Controls_Manager::TAB_SETTINGS,
51 'label' => esc_html__( 'Preferences', 'elementor' ),
52 ]
53 );
54
55 $this->add_control(
56 'editor_heading',
57 [
58 'label' => esc_html__( 'Panel', 'elementor' ),
59 'type' => Controls_Manager::HEADING,
60 ]
61 );
62
63 $this->add_control(
64 'ui_theme',
65 [
66 'label' => esc_html__( 'Display mode', 'elementor' ),
67 'type' => Controls_Manager::CHOOSE,
68 'options' => [
69 'light' => [
70 'title' => esc_html__( 'Light mode', 'elementor' ),
71 'icon' => 'eicon-light-mode',
72 ],
73 'dark' => [
74 'title' => esc_html__( 'Dark mode', 'elementor' ),
75 'icon' => 'eicon-dark-mode',
76 ],
77 'auto' => [
78 'title' => esc_html__( 'Auto detect', 'elementor' ),
79 'icon' => 'eicon-header',
80 ],
81 ],
82 'default' => 'auto',
83 'description' => esc_html__( 'Set light or dark mode, or auto-detect to sync with your operating system settings.', 'elementor' ),
84 ]
85 );
86
87 $this->add_control(
88 'panel_width',
89 [
90 'label' => esc_html__( 'Width', 'elementor' ) . ' (px)',
91 'type' => Controls_Manager::SLIDER,
92 'range' => [
93 'px' => [
94 'min' => 250,
95 'max' => 680,
96 ],
97 ],
98 'default' => [
99 'size' => 300,
100 ],
101 ]
102 );
103
104 $this->add_control(
105 'preview_heading',
106 [
107 'label' => esc_html__( 'Canvas', 'elementor' ),
108 'type' => Controls_Manager::HEADING,
109 'separator' => 'before',
110 ]
111 );
112
113 $this->add_control(
114 'edit_buttons',
115 [
116 'label' => esc_html__( 'Show quick edit options', 'elementor' ),
117 'type' => Controls_Manager::SWITCHER,
118 'label_on' => esc_html__( 'Yes', 'elementor' ),
119 'label_off' => esc_html__( 'No', 'elementor' ),
120 'description' => esc_html__( 'Show additional actions while hovering over the handle of an element.', 'elementor' ),
121 ]
122 );
123
124 $this->add_control(
125 'lightbox_in_editor',
126 [
127 'label' => esc_html__( 'Expand images in lightbox', 'elementor' ),
128 'type' => Controls_Manager::SWITCHER,
129 'default' => 'yes',
130 'label_on' => esc_html__( 'Yes', 'elementor' ),
131 'label_off' => esc_html__( 'No', 'elementor' ),
132 'description' => esc_html__( 'This only applies while you’re working in the editor. The front end won’t be affected.', 'elementor' ),
133 ]
134 );
135
136 $this->add_control(
137 'show_hidden_elements',
138 [
139 'label' => esc_html__( 'Show hidden elements', 'elementor' ),
140 'type' => Controls_Manager::SWITCHER,
141 'label_on' => esc_html__( 'Yes', 'elementor' ),
142 'label_off' => esc_html__( 'No', 'elementor' ),
143 'default' => 'yes',
144 'description' => esc_html__( 'This refers to elements you’ve hidden in the Responsive Visibility settings.', 'elementor' ),
145 ]
146 );
147
148 if ( ChecklistModule::should_display_checklist_toggle_control() ) {
149 $this->add_control(
150 'get_started_heading',
151 [
152 'label' => esc_html__( 'Get Started', 'elementor' ),
153 'type' => Controls_Manager::HEADING,
154 'separator' => 'before',
155 ]
156 );
157
158 $this->add_control(
159 ChecklistModule::VISIBILITY_SWITCH_ID,
160 [
161 'label' => esc_html__( 'Show launchpad checklist', 'elementor' ),
162 'type' => Controls_Manager::SWITCHER,
163 'label_on' => esc_html__( 'Yes', 'elementor' ),
164 'label_off' => esc_html__( 'No', 'elementor' ),
165 'default' => Plugin::$instance->modules_manager->get_modules( 'checklist' )->is_preference_switch_on() ? 'yes' : '',
166 'description' => esc_html__( 'These will guide you through the first steps of creating your site.', 'elementor' ),
167 ]
168 );
169 }
170
171 $this->add_control(
172 'design_system_heading',
173 [
174 'label' => esc_html__( 'Design System', 'elementor' ),
175 'type' => Controls_Manager::HEADING,
176 'separator' => 'before',
177 ]
178 );
179
180 $this->add_control(
181 'enable_styleguide_preview',
182 [
183 'label' => esc_html__( 'Show global settings', 'elementor' ),
184 'type' => Controls_Manager::SWITCHER,
185 'default' => 'yes',
186 'label_on' => esc_html__( 'Yes', 'elementor' ),
187 'label_off' => esc_html__( 'No', 'elementor' ),
188 'description' => esc_html__( 'Temporarily overlay the canvas with the style guide to preview your changes to global colors and fonts.', 'elementor' ),
189 ]
190 );
191
192 $this->add_control(
193 'navigation_heading',
194 [
195 'label' => esc_html__( 'Navigation', 'elementor' ),
196 'type' => Controls_Manager::HEADING,
197 'separator' => 'before',
198 ]
199 );
200
201 $this->add_control(
202 'exit_to',
203 [
204 'label' => esc_html__( 'Exit to', 'elementor' ),
205 'type' => Controls_Manager::SELECT,
206 'default' => 'this_post',
207 'options' => [
208 'this_post' => esc_html__( 'This Post', 'elementor' ),
209 'all_posts' => esc_html__( 'All Posts', 'elementor' ),
210 'dashboard' => esc_html__( 'WP Dashboard', 'elementor' ),
211 ],
212 'description' => esc_html__( 'Decide where you want to go when leaving the editor.', 'elementor' ),
213 ]
214 );
215
216 $this->end_controls_section();
217 }
218 }
219