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

212 lines 5.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
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly
10 }
11
12 class Model extends BaseModel {
13
14 /**
15 * Get element name.
16 *
17 * Retrieve the element name.
18 *
19 * @return string The name.
20 * @since 2.8.0
21 * @access public
22 *
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' => 200,
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 'default_device_view',
115 [
116 'label' => esc_html__( 'Default device view', 'elementor' ),
117 'type' => Controls_Manager::SELECT,
118 'default' => 'default',
119 'options' => [
120 'default' => esc_html__( 'Default', 'elementor' ),
121 'mobile' => esc_html__( 'Mobile', 'elementor' ),
122 'tablet' => esc_html__( 'Tablet', 'elementor' ),
123 'desktop' => esc_html__( 'Desktop', 'elementor' ),
124 ],
125 'description' => esc_html__( 'Choose which device to display when clicking the Responsive Mode icon.', 'elementor' ),
126 ]
127 );
128
129 $this->add_control(
130 'edit_buttons',
131 [
132 'label' => esc_html__( 'Show quick edit options', 'elementor' ),
133 'type' => Controls_Manager::SWITCHER,
134 'label_on' => esc_html__( 'Yes', 'elementor' ),
135 'label_off' => esc_html__( 'No', 'elementor' ),
136 'description' => esc_html__( 'Show additional actions while hovering over the handle of an element.', 'elementor' ),
137 ]
138 );
139
140 $this->add_control(
141 'lightbox_in_editor',
142 [
143 'label' => esc_html__( 'Expand images in lightbox', 'elementor' ),
144 'type' => Controls_Manager::SWITCHER,
145 'default' => 'yes',
146 'label_on' => esc_html__( 'Yes', 'elementor' ),
147 'label_off' => esc_html__( 'No', 'elementor' ),
148 'description' => esc_html__( 'This only applies while you’re working in the editor. The front end won’t be affected.', 'elementor' ),
149 ]
150 );
151
152 $this->add_control(
153 'show_hidden_elements',
154 [
155 'label' => esc_html__( 'Show hidden elements', 'elementor' ),
156 'type' => Controls_Manager::SWITCHER,
157 'label_on' => esc_html__( 'Yes', 'elementor' ),
158 'label_off' => esc_html__( 'No', 'elementor' ),
159 'default' => 'yes',
160 'description' => esc_html__( 'This refers to elements you’ve hidden in the Responsive Visibility settings.', 'elementor' ),
161 ]
162 );
163
164 $this->add_control(
165 'design_system_heading',
166 [
167 'label' => esc_html__( 'Design System', 'elementor' ),
168 'type' => Controls_Manager::HEADING,
169 'separator' => 'before',
170 ]
171 );
172
173 $this->add_control(
174 'enable_styleguide_preview',
175 [
176 'label' => esc_html__( 'Show global settings', 'elementor' ),
177 'type' => Controls_Manager::SWITCHER,
178 'default' => 'yes',
179 'label_on' => esc_html__( 'Yes', 'elementor' ),
180 'label_off' => esc_html__( 'No', 'elementor' ),
181 'description' => esc_html__( 'Temporarily overlay the canvas with the style guide to preview your changes to global colors and fonts.', 'elementor' ),
182 ]
183 );
184
185 $this->add_control(
186 'navigation_heading',
187 [
188 'label' => esc_html__( 'Navigation', 'elementor' ),
189 'type' => Controls_Manager::HEADING,
190 'separator' => 'before',
191 ]
192 );
193
194 $this->add_control(
195 'exit_to',
196 [
197 'label' => esc_html__( 'Exit to', 'elementor' ),
198 'type' => Controls_Manager::SELECT,
199 'default' => 'this_post',
200 'options' => [
201 'this_post' => esc_html__( 'This Post', 'elementor' ),
202 'all_posts' => esc_html__( 'All Posts', 'elementor' ),
203 'dashboard' => esc_html__( 'WP Dashboard', 'elementor' ),
204 ],
205 'description' => esc_html__( 'Decide where you want to go when leaving the editor.', 'elementor' ),
206 ]
207 );
208
209 $this->end_controls_section();
210 }
211 }
212