name = esc_html__('Carousel', 'addons-for-divi'); $this->settings_modal_toggles = array( 'general' => array( 'toggles' => array( 'content' => esc_html__('Content', 'addons-for-divi'), ), ), 'advanced' => array( 'toggles' => array( 'image' => esc_html__('Image', 'addons-for-divi'), 'overlay' => esc_html__('Overlay', 'addons-for-divi'), 'content' => esc_html__('Content', 'addons-for-divi'), 'title' => esc_html__('Title', 'addons-for-divi'), 'subtitle' => esc_html__('Sub Title', 'addons-for-divi'), 'button' => esc_html__('Button', 'addons-for-divi'), 'borders' => esc_html__('Border', 'addons-for-divi'), ), ), ); $this->custom_css_fields = array( 'image_wrap' => array( 'label' => esc_html__('Image Wrapper', 'addons-for-divi'), 'selector' => '%%order_class%% figure', ), 'image' => array( 'label' => esc_html__('Image', 'addons-for-divi'), 'selector' => '%%order_class%% figure img', ), 'title' => array( 'label' => esc_html__('Title', 'addons-for-divi'), 'selector' => '%%order_class%% .dtq-image-title', ), 'sub_title' => array( 'label' => esc_html__('Sub Title', 'addons-for-divi'), 'selector' => '%%order_class%% .dtq-image-subtitle', ), 'button' => array( 'label' => esc_html__('Button', 'addons-for-divi'), 'selector' => '%%order_class%% .dtq-btn-img-carousel', ), ); } public function get_fields() { $fields = array( 'photo' => array( 'label' => esc_html__('Upload Image', 'addons-for-divi'), 'description' => esc_html__('Upload an image or type in the URL of the image you would like to display.', 'addons-for-divi'), 'type' => 'upload', 'option_category' => 'basic_option', 'toggle_slug' => 'content', 'upload_button_text' => esc_attr__('Upload an image', 'addons-for-divi'), 'choose_text' => esc_attr__('Choose an Image', 'addons-for-divi'), 'update_text' => esc_attr__('Set As Image', 'addons-for-divi'), 'hover' => 'tabs', 'mobile_options' => true, ), 'photo_alt' => array( 'label' => esc_html__('Image Alt Text', 'addons-for-divi'), 'description' => esc_html__('Define the HTML ALT text for your image here.', 'addons-for-divi'), 'type' => 'text', 'toggle_slug' => 'content', ), 'title' => array( 'label' => esc_html__('Title', 'addons-for-divi'), 'description' => esc_html__('Define the title text for the item.', 'addons-for-divi'), 'type' => 'text', 'toggle_slug' => 'content', ), 'sub_title' => array( 'label' => esc_html__('Subtitle', 'addons-for-divi'), 'description' => esc_html__('Define the sub-title text for the item.', 'addons-for-divi'), 'type' => 'text', 'toggle_slug' => 'content', ), 'use_button' => array( 'label' => esc_html__('Use Button', 'addons-for-divi'), 'description' => esc_html__('Here you can choose whether button should be used.', 'addons-for-divi'), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'on' => esc_html__('Yes', 'addons-for-divi'), 'off' => esc_html__('No', 'addons-for-divi'), ), 'default' => 'off', 'toggle_slug' => 'content', ), 'button_text' => array( 'label' => esc_html__('Button Text', 'addons-for-divi'), 'description' => esc_html__('Define the button text for your button.', 'addons-for-divi'), 'type' => 'text', 'default' => 'Click Here', 'toggle_slug' => 'content', 'dynamic_content' => 'text', 'show_if' => array( 'use_button' => 'on', ), ), 'button_link' => array( 'label' => esc_html__('Button Link', 'addons-for-divi'), 'description' => esc_html__('Define the button link url for your button.', 'addons-for-divi'), 'type' => 'text', 'default' => '', 'toggle_slug' => 'content', 'dynamic_content' => 'url', 'show_if' => array( 'use_button' => 'on', ), ), 'is_new_window' => array( 'label' => esc_html__('Open Button link in new window', 'addons-for-divi'), 'description' => esc_html__('Here you can choose whether button URL should be opened in new window.', 'addons-for-divi'), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'on' => esc_html__('Yes', 'addons-for-divi'), 'off' => esc_html__('No', 'addons-for-divi'), ), 'default' => 'off', 'toggle_slug' => 'content', 'show_if' => array( 'use_button' => 'on', ), ), 'content_alignment' => array( 'label' => esc_html__('Content Text Alignment', 'addons-for-divi'), 'description' => esc_html__('Align texts to the left, right or center.', 'addons-for-divi'), 'type' => 'text_align', 'option_category' => 'layout', 'options' => et_builder_get_text_orientation_options(array('justified')), 'options_icon' => 'module_align', 'default_on_front' => 'left', 'toggle_slug' => 'content', 'tab_slug' => 'advanced', ), 'content_width' => array( 'label' => esc_html__('Content Width', 'addons-for-divi'), 'description' => esc_html__('Define custom content width.', 'addons-for-divi'), 'type' => 'range', 'mobile_options' => true, 'default' => '100%', 'range_settings' => array( 'step' => 1, 'min' => 0, 'max' => 100, ), 'tab_slug' => 'advanced', 'toggle_slug' => 'content', ), 'content_type' => array( 'label' => esc_html__('Content Type', 'addons-for-divi'), 'description' => esc_html__('Define content type. By selecting absolute type content can be placed as image overlay.', 'addons-for-divi'), 'type' => 'select', 'toggle_slug' => 'content', 'tab_slug' => 'advanced', 'default' => 'normal', 'options' => array( 'normal' => esc_html__('Normal', 'addons-for-divi'), 'absolute' => esc_html__('Absolute', 'addons-for-divi'), ), ), 'content_position' => array( 'label' => esc_html__('Content Position', 'addons-for-divi'), 'description' => esc_html__('Define content position.', 'addons-for-divi'), 'type' => 'select', 'toggle_slug' => 'content', 'tab_slug' => 'advanced', 'default' => 'bottom', 'options' => array( 'top' => esc_html__('Top', 'addons-for-divi'), 'bottom' => esc_html__('Bottom', 'addons-for-divi'), ), 'show_if' => array( 'content_type' => 'normal', ), ), 'content_pos_x' => array( 'label' => esc_html__('Content Horizontal Placement', 'addons-for-divi'), 'description' => esc_html__('Select content horizontal placement.', 'addons-for-divi'), 'type' => 'select', 'toggle_slug' => 'content', 'tab_slug' => 'advanced', 'default' => 'center', 'options' => array( 'center' => esc_html__('Center', 'addons-for-divi'), 'flex-start' => esc_html__('Left', 'addons-for-divi'), 'flex-end' => esc_html__('Right', 'addons-for-divi'), ), 'show_if' => array( 'content_type' => 'absolute', ), ), 'content_offset_x' => array( 'label' => esc_html__('Content Horizontal Position', 'addons-for-divi'), 'description' => esc_html__('Define the value for the content horizontally offset.', 'addons-for-divi'), 'type' => 'range', 'default_unit' => 'px', 'default' => '0px', 'mobile_options' => true, 'toggle_slug' => 'content', 'tab_slug' => 'advanced', 'range_settings' => array( 'min' => 0, 'step' => 1, 'max' => 1000, ), 'show_if' => array( 'content_type' => 'absolute', 'content_pos_x' => array('flex-start', 'flex-end'), ), ), 'content_pos_y' => array( 'label' => esc_html__('Content Vertical Placement', 'addons-for-divi'), 'description' => esc_html__('Select content vertical placement.', 'addons-for-divi'), 'type' => 'select', 'toggle_slug' => 'content', 'tab_slug' => 'advanced', 'default' => 'center', 'options' => array( 'center' => esc_html__('Center', 'addons-for-divi'), 'flex-start' => esc_html__('Top', 'addons-for-divi'), 'flex-end' => esc_html__('Bottom', 'addons-for-divi'), ), 'show_if' => array( 'content_type' => 'absolute', ), ), 'content_offset_y' => array( 'label' => esc_html__('Content Vertical Position', 'addons-for-divi'), 'description' => esc_html__('Define the value for the content vertically offset.', 'addons-for-divi'), 'type' => 'range', 'default_unit' => 'px', 'default' => '0px', 'toggle_slug' => 'content', 'mobile_options' => true, 'tab_slug' => 'advanced', 'range_settings' => array( 'min' => 0, 'step' => 1, 'max' => 1000, ), 'show_if' => array( 'content_type' => 'absolute', 'content_pos_y' => array('flex-start', 'flex-end'), ), ), 'content_padding' => array( 'label' => esc_html__('Content Padding', 'addons-for-divi'), 'description' => esc_html__('Define custom padding for the content area.', 'addons-for-divi'), 'type' => 'custom_padding', 'tab_slug' => 'advanced', 'toggle_slug' => 'content', 'mobile_options' => true, ), // image. 'image_height' => array( 'label' => esc_html__('Image Height', 'addons-for-divi'), 'description' => esc_html__('.', 'addons-for-divi'), 'type' => 'range', 'mobile_options' => true, 'default_unit' => 'px', 'default' => 'auto', 'range_settings' => array( 'min' => 0, 'step' => 1, 'max' => 600, ), 'toggle_slug' => 'image', 'tab_slug' => 'advanced', ), 'image_hover_animation' => array( 'label' => esc_html__('Image Hover Animation', 'addons-for-divi'), 'description' => esc_html__('Select image hover animation.', 'addons-for-divi'), 'type' => 'select', 'tab_slug' => 'advanced', 'toggle_slug' => 'image', 'default' => 'none', 'options' => $this->get_image_hover_animations(), ), // Text. 'title_bottom_spacing' => array( 'label' => esc_html__('Title Spacing Bottom', 'addons-for-divi'), 'description' => esc_html__('Here you can define a custom spacing at the bottom of the title.', 'addons-for-divi'), 'type' => 'range', 'default' => '5px', 'mobile_options' => true, 'allowed_units' => array('px'), 'default_unit' => 'px', 'range_settings' => array( 'min' => 0, 'step' => 1, 'max' => 100, ), 'toggle_slug' => 'title', 'tab_slug' => 'advanced', ), 'btn_spacing_top' => array( 'label' => esc_html__('Spacing Top', 'addons-for-divi'), 'description' => esc_html__('Here you can define a custom spacing at the top of the button.', 'addons-for-divi'), 'type' => 'range', 'default' => '15px', 'mobile_options' => true, 'default_unit' => 'px', 'range_settings' => array( 'min' => 0, 'step' => 1, 'max' => 500, ), 'toggle_slug' => 'button', 'tab_slug' => 'advanced', ), ); $label = array( 'admin_title' => array( 'label' => esc_html__('Admin Label', 'addons-for-divi'), 'description' => esc_html__('.', 'addons-for-divi'), 'type' => 'text', 'description' => esc_html__('This will change the label of the item', 'addons-for-divi'), 'toggle_slug' => 'admin_label', ), ); $content = $this->custom_background_fields( 'content', esc_html__('Content', 'addons-for-divi'), 'advanced', 'content', array('color', 'gradient', 'image', 'hover'), array(), '' ); $overlay = $this->get_overlay_option_fields('overlay', 'off', array()); return array_merge($label, $fields, $content, $overlay); } public function get_advanced_fields_config() { $advanced_fields = array(); $advanced_fields['text'] = array(); $advanced_fields['text_shadow'] = array(); $advanced_fields['max_width'] = array(); $advanced_fields['fonts'] = array(); $advanced_fields['borders'] = array(); $advanced_fields['button']['button'] = array( 'label' => esc_html__('Button', 'addons-for-divi'), 'css' => array( 'main' => '%%order_class%% .dtq-btn-img-carousel', 'alignment' => '%%order_class%% .dtq-btn-wrap', 'important' => 'all', ), 'tab_slug' => 'advanced', 'toggle_slug' => 'button', 'use_alignment' => false, 'box_shadow' => array( 'css' => array( 'main' => '%%order_class%% .dtq-btn-img-carousel', ), ), 'borders' => array( 'css' => array( 'important' => 'all', ), ), 'margin_padding' => array( 'css' => array( 'important' => 'all', ), ), ); $advanced_fields['box_shadow']['content'] = array( 'label' => esc_html__('Box Shadow', 'addons-for-divi'), 'css' => array( 'main' => '%%order_class%% .content .content-inner', 'important' => 'all', ), 'tab_slug' => 'advanced', 'toggle_slug' => 'content', ); $advanced_fields['fonts']['title'] = array( 'label' => esc_html__('Title', 'addons-for-divi'), 'css' => array( 'main' => '%%order_class%% .dtq-image-title, .et-db #et-boc %%order_class%% .dtq-image-title', 'important' => 'all', ), 'tab_slug' => 'advanced', 'toggle_slug' => 'title', 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), 'hide_text_align' => true, 'header_level' => array( 'default' => 'h3', ), ); $advanced_fields['fonts']['subtitle'] = array( 'label' => esc_html__('Subtitle', 'addons-for-divi'), 'css' => array( 'main' => '%%order_class%% .dtq-image-subtitle, .et-db #et-boc %%order_class%% .dtq-image-subtitle', 'important' => 'all', ), 'tab_slug' => 'advanced', 'toggle_slug' => 'subtitle', 'hide_text_align' => true, 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), 'header_level' => array( 'default' => 'h5', ), ); $advanced_fields['borders']['item'] = array( 'label_prefix' => esc_html__('Item', 'addons-for-divi'), 'css' => array( 'main' => '%%order_class%%', 'important' => 'all', ), 'tab_slug' => 'advanced', 'toggle_slug' => 'borders', ); return $advanced_fields; } public function render_figure() { $photo = $this->props['photo']; $photo_alt = $this->props['photo_alt']; $processed_overlay_icon = esc_attr(et_pb_process_font_icon($this->props['overlay_icon'])); $overlay_icon = !empty($processed_overlay_icon) ? $processed_overlay_icon : ''; $data_schema = $this->get_swapped_img_schema('photo'); $parent_module = self::get_parent_modules('page')['ba_image_carousel']; $use_lightbox = $parent_module->shortcode_atts['use_lightbox']; $overlay_on_hover = $this->props['overlay_on_hover']; $overlay = ''; if ('on' === $overlay_on_hover) { dtq_inject_fa_icons($this->props['overlay_icon']); $overlay = sprintf( '
', $overlay_icon ); } if (!empty($photo)) { return sprintf( '