PluginProbe
Elementor Website Builder – more than just a page builder / 3.26.2
Elementor Website Builder – more than just a page builder v3.26.2
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 3.26.2, at core/settings/editor-preferences/model.php

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