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

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