PK]"Ð\wï|¬¿ ¿ model.phpnuW+A„¶ __( 'Global Settings', 'elementor' ), ]; } /** * Get controls list. * * Retrieve the global settings model controls list. * * @since 1.6.0 * @access public * @static * * @return array Controls list. */ public static function get_controls_list() { return [ Controls_Manager::TAB_STYLE => [ 'style' => [ 'label' => __( 'Style', 'elementor' ), 'controls' => [ 'elementor_default_generic_fonts' => [ 'label' => __( 'Default Generic Fonts', 'elementor' ), 'type' => Controls_Manager::TEXT, 'default' => 'Sans-serif', 'description' => __( 'The list of fonts used if the chosen font is not available.', 'elementor' ), 'label_block' => true, ], 'elementor_container_width' => [ 'label' => __( 'Content Width', 'elementor' ) . ' (px)', 'type' => Controls_Manager::NUMBER, 'min' => 300, 'description' => __( 'Sets the default width of the content area (Default: 1140)', 'elementor' ), 'selectors' => [ '.elementor-section.elementor-section-boxed > .elementor-container' => 'max-width: {{VALUE}}px', ], ], 'elementor_space_between_widgets' => [ 'label' => __( 'Widgets Space', 'elementor' ) . ' (px)', 'type' => Controls_Manager::NUMBER, 'min' => 0, 'placeholder' => '20', 'description' => __( 'Sets the default space between widgets (Default: 20)', 'elementor' ), 'selectors' => [ '.elementor-widget:not(:last-child)' => 'margin-bottom: {{VALUE}}px', ], ], 'elementor_stretched_section_container' => [ 'label' => __( 'Stretched Section Fit To', 'elementor' ), 'type' => Controls_Manager::TEXT, 'placeholder' => 'body', 'description' => __( 'Enter parent element selector to which stretched sections will fit to (e.g. #primary / .wrapper / main etc). Leave blank to fit to page width.', 'elementor' ), 'label_block' => true, 'frontend_available' => true, ], 'elementor_page_title_selector' => [ 'label' => __( 'Page Title Selector', 'elementor' ), 'type' => Controls_Manager::TEXT, 'placeholder' => 'h1.entry-title', 'description' => __( 'Elementor lets you hide the page title. This works for themes that have "h1.entry-title" selector. If your theme\'s selector is different, please enter it above.', 'elementor' ), 'label_block' => true, ], ], ], ], Manager::PANEL_TAB_LIGHTBOX => [ 'lightbox' => [ 'label' => __( 'Lightbox', 'elementor' ), 'controls' => [ 'elementor_global_image_lightbox' => [ 'label' => __( 'Image Lightbox', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'description' => __( 'Open all image links in a lightbox popup window. The lightbox will automatically work on any link that leads to an image file.', 'elementor' ), 'frontend_available' => true, ], 'elementor_lightbox_enable_counter' => [ 'label' => __( 'Counter', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'frontend_available' => true, ], 'elementor_lightbox_enable_fullscreen' => [ 'label' => __( 'Fullscreen', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'frontend_available' => true, ], 'elementor_lightbox_enable_zoom' => [ 'label' => __( 'Zoom', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'frontend_available' => true, ], 'elementor_lightbox_enable_share' => [ 'label' => __( 'Share', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'frontend_available' => true, ], 'elementor_lightbox_title_src' => [ 'label' => __( 'Title', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __( 'None', 'elementor' ), 'title' => __( 'Title', 'elementor' ), 'caption' => __( 'Caption', 'elementor' ), 'alt' => __( 'Alt', 'elementor' ), 'description' => __( 'Description', 'elementor' ), ], 'default' => 'title', 'frontend_available' => true, ], 'elementor_lightbox_description_src' => [ 'label' => __( 'Description', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __( 'None', 'elementor' ), 'title' => __( 'Title', 'elementor' ), 'caption' => __( 'Caption', 'elementor' ), 'alt' => __( 'Alt', 'elementor' ), 'description' => __( 'Description', 'elementor' ), ], 'default' => 'description', 'frontend_available' => true, ], 'elementor_lightbox_color' => [ 'label' => __( 'Background Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '.elementor-lightbox' => 'background-color: {{VALUE}}', ], ], 'elementor_lightbox_ui_color' => [ 'label' => __( 'UI Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '.elementor-lightbox' => '--lightbox-ui-color: {{VALUE}}', ], ], 'elementor_lightbox_ui_color_hover' => [ 'label' => __( 'UI Hover Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '.elementor-lightbox' => '--lightbox-ui-color-hover: {{VALUE}}', ], ], 'elementor_lightbox_text_color' => [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '.elementor-lightbox' => '--lightbox-text-color: {{VALUE}}', ], ], 'lightbox_icons_size' => [ 'label' => __( 'Toolbar Icons Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '.elementor-lightbox' => '--lightbox-header-icons-size: {{SIZE}}{{UNIT}}', ], 'separator' => 'before', ], 'lightbox_slider_icons_size' => [ 'label' => __( 'Navigation Icons Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '.elementor-lightbox' => '--lightbox-navigation-icons-size: {{SIZE}}{{UNIT}}', ], 'separator' => 'before', ], ], ], ], ]; } /** * Register model controls. * * Used to add new controls to the global settings model. * * @since 1.6.0 * @access protected */ protected function _register_controls() { $controls_list = self::get_controls_list(); foreach ( $controls_list as $tab_name => $sections ) { foreach ( $sections as $section_name => $section_data ) { $this->start_controls_section( $section_name, [ 'label' => $section_data['label'], 'tab' => $tab_name, ] ); foreach ( $section_data['controls'] as $control_name => $control_data ) { $this->add_control( $control_name, $control_data ); } $this->end_controls_section(); } } } } PK]"Ð\˜¹ª$`` manager.phpnuW+A„¶add_panel_tabs(); } /** * Get manager name. * * Retrieve general settings manager name. * * @since 1.6.0 * @access public * * @return string Manager name. */ public function get_name() { return 'general'; } /** * Get model for config. * * Retrieve the model for settings configuration. * * @since 1.6.0 * @access public * * @return BaseModel The model object. */ public function get_model_for_config() { return $this->get_model(); } /** * Get saved settings. * * Retrieve the saved settings from the site options. * * @since 1.6.0 * @access protected * * @param int $id Post ID. * * @return array Saved settings. */ protected function get_saved_settings( $id ) { $model_controls = Model::get_controls_list(); $settings = []; foreach ( $model_controls as $tab_name => $sections ) { foreach ( $sections as $section_name => $section_data ) { foreach ( $section_data['controls'] as $control_name => $control_data ) { $saved_setting = get_option( $control_name, null ); if ( null !== $saved_setting ) { $settings[ $control_name ] = $saved_setting; } } } } return $settings; } /** * Get CSS file name. * * Retrieve CSS file name for the general settings manager. * * @since 1.6.0 * @access protected * @return string * * @return string CSS file name. */ protected function get_css_file_name() { return 'global'; } /** * Save settings to DB. * * Save general settings to the database, as site options. * * @since 1.6.0 * @access protected * * @param array $settings Settings. * @param int $id Post ID. */ protected function save_settings_to_db( array $settings, $id ) { $model_controls = Model::get_controls_list(); $one_list_settings = []; foreach ( $model_controls as $tab_name => $sections ) { foreach ( $sections as $section_name => $section_data ) { foreach ( $section_data['controls'] as $control_name => $control_data ) { if ( isset( $settings[ $control_name ] ) ) { $one_list_control_name = str_replace( 'elementor_', '', $control_name ); $one_list_settings[ $one_list_control_name ] = $settings[ $control_name ]; update_option( $control_name, $settings[ $control_name ] ); } else { delete_option( $control_name ); } } } } // Save all settings in one list for a future usage if ( ! empty( $one_list_settings ) ) { update_option( self::META_KEY, $one_list_settings ); } else { delete_option( self::META_KEY ); } } /** * Get model for CSS file. * * Retrieve the model for the CSS file. * * @since 1.6.0 * @access protected * * @param Base $css_file The requested CSS file. * * @return BaseModel The model object. */ protected function get_model_for_css_file( Base $css_file ) { return $this->get_model(); } /** * Get CSS file for update. * * Retrieve the CSS file before updating the it. * * @since 1.6.0 * @access protected * * @param int $id Post ID. * * @return Global_CSS The global CSS file object. */ protected function get_css_file_for_update( $id ) { return Global_CSS::create( 'global.css' ); } /** * Add panel tabs. * * Register new panel tab for the lightbox settings. * * @since 1.6.0 * @access private */ private function add_panel_tabs() { Controls_Manager::add_tab( self::PANEL_TAB_LIGHTBOX, __( 'Lightbox', 'elementor' ) ); } } PK]"Ð\wï|¬¿ ¿ model.phpnuW+A„¶PK]"Ð\˜¹ª$`` ø manager.phpnuW+A„¶PK”“2