| @@ -1,14 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | namespace Elementor\Core\Settings\EditorPreferences; |
| 3 | 4 | |
| 4 | 5 | use Elementor\Controls_Manager; |
| 5 | 6 | use Elementor\Core\Settings\Base\Model as BaseModel; |
| 6 | -use Elementor\Modules\Checklist\Module as ChecklistModule; | |
| 7 | -use Elementor\Plugin; | |
| 8 | 7 | |
| 9 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | - exit; // Exit if accessed directly. | |
| 9 | + exit; // Exit if accessed directly | |
| 11 | 10 | } |
| 12 | 11 | |
| 13 | 12 | class Model extends BaseModel { |
| 14 | 13 | |
| @@ -19,8 +18,9 @@ | ||
| 19 | 18 | * |
| 20 | 19 | * @return string The name. |
| 21 | 20 | * @since 2.8.0 |
| 22 | 21 | * @access public |
| 22 | + * | |
| 23 | 23 | */ |
| 24 | 24 | public function get_name() { |
| 25 | 25 | return 'editor-preferences'; |
| 26 | 26 | } |
| @@ -34,9 +34,9 @@ | ||
| 34 | 34 | * @access public |
| 35 | 35 | */ |
| 36 | 36 | public function get_panel_page_settings() { |
| 37 | 37 | return [ |
| 38 | - 'title' => esc_html__( 'User Preferences', 'elementor' ), | |
| 38 | + 'title' => __( 'User Preferences', 'elementor' ), | |
| 39 | 39 | ]; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| @@ -43,45 +43,25 @@ | ||
| 43 | 43 | * @since 3.1.0 |
| 44 | 44 | * @access protected |
| 45 | 45 | */ |
| 46 | 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 | - ); | |
| 47 | + $this->start_controls_section( 'preferences', [ | |
| 48 | + 'tab' => Controls_Manager::TAB_SETTINGS, | |
| 49 | + 'label' => __( 'Preferences', 'elementor' ), | |
| 50 | + ] ); | |
| 54 | 51 | |
| 55 | 52 | $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 | 53 | 'ui_theme', |
| 65 | 54 | [ |
| 66 | - 'label' => esc_html__( 'Display mode', 'elementor' ), | |
| 67 | - 'type' => Controls_Manager::CHOOSE, | |
| 55 | + 'label' => __( 'UI Theme', 'elementor' ), | |
| 56 | + 'type' => Controls_Manager::SELECT, | |
| 57 | + 'description' => __( 'Set light or dark mode, or use Auto Detect to sync it with your OS setting.', 'elementor' ), | |
| 58 | + 'default' => 'auto', | |
| 68 | 59 | '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 | - ], | |
| 60 | + 'auto' => __( 'Auto Detect', 'elementor' ), | |
| 61 | + 'light' => __( 'Light', 'elementor' ), | |
| 62 | + 'dark' => __( 'Dark', 'elementor' ), | |
| 81 | 63 | ], |
| 82 | - 'default' => 'auto', | |
| 83 | - 'description' => esc_html__( 'Set light or dark mode, or auto-detect to sync with your operating system settings.', 'elementor' ), | |
| 84 | 64 | ] |
| 85 | 65 | ); |
| 86 | 66 | |
| 87 | 67 | $this->add_control( |
| @@ -86,13 +66,13 @@ | ||
| 86 | 66 | |
| 87 | 67 | $this->add_control( |
| 88 | 68 | 'panel_width', |
| 89 | 69 | [ |
| 90 | - 'label' => esc_html__( 'Width', 'elementor' ) . ' (px)', | |
| 70 | + 'label' => __( 'Panel Width', 'elementor' ), | |
| 91 | 71 | 'type' => Controls_Manager::SLIDER, |
| 92 | 72 | 'range' => [ |
| 93 | 73 | 'px' => [ |
| 94 | - 'min' => 250, | |
| 74 | + 'min' => 200, | |
| 95 | 75 | 'max' => 680, |
| 96 | 76 | ], |
| 97 | 77 | ], |
| 98 | 78 | 'default' => [ |
| @@ -101,24 +81,13 @@ | ||
| 101 | 81 | ] |
| 102 | 82 | ); |
| 103 | 83 | |
| 104 | 84 | $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 | 85 | 'edit_buttons', |
| 115 | 86 | [ |
| 116 | - 'label' => esc_html__( 'Show quick edit options', 'elementor' ), | |
| 87 | + 'label' => __( 'Editing Handles', 'elementor' ), | |
| 117 | 88 | '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' ), | |
| 89 | + 'description' => __( 'Show editing handles when hovering over the element edit button.', 'elementor' ), | |
| 121 | 90 | ] |
| 122 | 91 | ); |
| 123 | 92 | |
| 124 | 93 | $this->add_control( |
| @@ -123,94 +92,11 @@ | ||
| 123 | 92 | |
| 124 | 93 | $this->add_control( |
| 125 | 94 | 'lightbox_in_editor', |
| 126 | 95 | [ |
| 127 | - 'label' => esc_html__( 'Expand images in lightbox', 'elementor' ), | |
| 96 | + 'label' => __( 'Enable Lightbox In Editor', 'elementor' ), | |
| 128 | 97 | 'type' => Controls_Manager::SWITCHER, |
| 129 | 98 | '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 | 99 | ] |
| 214 | 100 | ); |
| 215 | 101 | |
| 216 | 102 | $this->end_controls_section(); |