start_controls_section( 'settings', [ 'label' => esc_html__( 'Content', 'business-roy' ) ] ); $this->add_control( 'gallery_type',[ 'type' => Controls_Manager::SELECT, 'label' => esc_html__( 'Type', 'business-roy' ), 'default' => 'multiple', 'label_block' => true, 'options' => [ 'single' => esc_html__( 'Single', 'business-roy' ), 'multiple' => esc_html__( 'Multiple', 'business-roy' ), ], ] ); $this->add_control( 'gallery',[ 'type' => Controls_Manager::GALLERY, 'condition' => [ 'gallery_type' => 'single', ], ] ); $repeater = new Repeater(); $repeater->add_control( 'gallery_title',[ 'type' => Controls_Manager::TEXT, 'label' => esc_html__( 'Title', 'business-roy' ), 'default' => esc_html__( 'New Gallery', 'business-roy' ), ] ); $repeater->add_control( 'multiple_gallery',[ 'type' => Controls_Manager::GALLERY, ] ); $this->add_control( 'galleries',[ 'type' => Controls_Manager::REPEATER, 'label' => esc_html__( 'Galleries', 'business-roy' ), 'fields' => $repeater->get_controls(), 'title_field' => '{{{ gallery_title }}}', 'default' => [ [ 'gallery_title' => esc_html__( 'New Gallery', 'business-roy' ), ], ], 'condition' => [ 'gallery_type' => 'multiple', ], ] ); $this->add_control( 'show_all_galleries_label',[ 'type' => Controls_Manager::TEXT, 'label' => esc_html__( '"All" Filter Label', 'business-roy' ), 'default' => '', 'label_block' => true, 'condition' => [ 'gallery_type' => 'multiple', ], ] ); $this->add_control( 'order_by',[ 'type' => Controls_Manager::SELECT, 'label_block' => true, 'label' => esc_html__( 'Order By', 'business-roy' ), 'options' => [ '' => esc_html__( 'Default', 'business-roy' ), 'random' => esc_html__( 'Random', 'business-roy' ), ], 'default' => '', 'separator' => 'before', 'frontend_available' => true, ] ); $this->add_control( 'gallery_layout',[ 'type' => Controls_Manager::SELECT, 'label' => esc_html__( 'Display Layout', 'business-roy' ), 'default' => 'style3', 'label_block' => true, 'options' => [ 'style1' => esc_html__( 'Style One', 'business-roy' ), 'style2' => esc_html__( 'Style Two', 'business-roy' ), 'style3' => esc_html__( 'Style Three', 'business-roy' ), 'style6' => esc_html__( 'Style Four', 'business-roy' ), ], 'separator' => 'before', 'frontend_available' => true, ] ); $this->add_control( 'gap',[ 'label' => esc_html__( 'Spacing', 'business-roy' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 3, ], ], 'default' => [ 'size' => 1, ], 'separator' => 'before', ], ); $this->add_control( 'overlay_background',[ 'label' => esc_html__( 'Overlay Background', 'business-roy' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'lightbox',[ 'type' => Controls_Manager::SWITCHER, 'label' => esc_html__( 'Zoom Lightbox', 'business-roy' ), 'return_value' => 'yes', 'default' => 'yes', 'separator' => 'before', ] ); $this->end_controls_section(); $this->start_controls_section( 'tabs_style',[ 'label' => esc_html__( 'Tabs Filter', 'business-roy' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'gallery_type' => 'multiple', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(),[ 'name' => 'tab_typography', 'selector' => '{{WRAPPER}} .iktheme-gallery-item-name', ] ); $this->add_group_control( Group_Control_Text_Stroke::get_type(),[ 'name' => 'tab_text_stroke', 'selector' => "{{WRAPPER}} .iktheme-gallery-item-name", ] ); $this->add_responsive_control( 'tab_alignment',[ 'label' => esc_html__( 'Tab Alignment', 'business-roy' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'business-roy' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'business-roy' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'business-roy' ), 'icon' => 'eicon-text-align-right', ], ], 'default' => 'center', 'selectors' => [ '{{WRAPPER}} .iktheme-gallery-name-wrap' => 'justify-content: {{VALUE}};' ], ] ); $this->add_responsive_control( 'tabs_padding',[ 'label' => esc_html__( 'Padding', 'business-roy' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ '{{WRAPPER}} .iktheme-gallery-item-name' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'tabs_radius',[ 'label' => esc_html__( 'Radius', 'business-roy' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ '{{WRAPPER}} .iktheme-gallery-item-name' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'overlay_style',[ 'label' => esc_html__( 'Overlay', 'business-roy' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'overlay_background' => 'yes', ], ] ); $this->start_controls_tabs( 'overlay_background_tabs' ); $this->start_controls_tab( 'overlay_normal',[ 'label' => esc_html__( 'Normal', 'business-roy' ), ] ); $this->add_group_control( Group_Control_Background::get_type(),[ 'name' => 'overlay_background', 'types' => [ 'classic', 'gradient' ], 'exclude' => [ 'image' ], 'selector' => '{{WRAPPER}} .iktheme-gallery-name:after', 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'default' => 'rgba(0,0,0,0.1)', ], ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'overlay_hover',[ 'label' => esc_html__( 'Hover', 'business-roy' ), ] ); $this->add_group_control( Group_Control_Background::get_type(),[ 'name' => 'overlay_background_hover', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .iktheme-gallery-caption', 'exclude' => [ 'image' ], 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'default' => '', ], ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'content_alignment',[ 'label' => esc_html__( 'Alignment', 'business-roy' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'business-roy' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'business-roy' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'business-roy' ), 'icon' => 'eicon-text-align-right', ], ], 'separator' => 'before', 'default' => 'left', 'selectors' => [ '{{WRAPPER}} .iktheme-gallery-caption' => 'text-align: {{VALUE}}', ], ] ); $this->add_responsive_control( 'content_vertical_position',[ 'label' => esc_html__( 'Vertical Position', 'business-roy' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'top' => [ 'title' => esc_html__( 'Top', 'business-roy' ), 'icon' => 'eicon-v-align-top', ], 'middle' => [ 'title' => esc_html__( 'Middle', 'business-roy' ), 'icon' => 'eicon-v-align-middle', ], 'bottom' => [ 'title' => esc_html__( 'Bottom', 'business-roy' ), 'icon' => 'eicon-v-align-bottom', ], ], 'default' => 'bottom', 'selectors_dictionary' => [ 'top' => 'flex-start', 'middle' => 'center', 'bottom' => 'flex-end', ], 'selectors' => [ '{{WRAPPER}} .iktheme-gallery-caption' => 'justify-content: {{VALUE}}', ], ] ); $this->add_responsive_control( 'content_padding',[ 'label' => esc_html__( 'Padding', 'business-roy' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'default' => [ 'size' => 20, ], 'selectors' => [ '{{WRAPPER}} .iktheme-gallery-caption' => 'padding: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'heading_title',[ 'label' => esc_html__( 'Title', 'business-roy' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'title_color',[ 'label' => esc_html__( 'Color', 'business-roy' ), 'type' => Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} .iktheme-gallery-caption h4' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(),[ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .iktheme-gallery-caption h4', ] ); $this->add_control( 'title_spacing',[ 'label' => esc_html__( 'Spacing', 'business-roy' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .iktheme-gallery-caption h4' => 'margin-bottom: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'heading_description',[ 'label' => esc_html__( 'Description', 'business-roy' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before' ] ); $this->add_control( 'description_color',[ 'label' => esc_html__( 'Color', 'business-roy' ), 'type' => Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} .iktheme-gallery-caption' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(),[ 'name' => 'description_typography', 'selector' => '{{WRAPPER}} .iktheme-gallery-caption', ] ); $this->end_controls_section(); $this->start_controls_section( 'zoom_icon_style',[ 'label' => esc_html__( 'Zoom Lightbox', 'business-roy' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'lightbox' => 'yes', ], ] ); $this->add_control( 'zoom_bg_color',[ 'label' => esc_html__( 'Background Color', 'business-roy' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} a.iktheme-gallery-image-large' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'zoom_color',[ 'label' => esc_html__( 'Color', 'business-roy' ), 'type' => Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} a.iktheme-gallery-image-large' => 'color: {{VALUE}}', ], ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $id = $this->get_id(); $is_multiple = 'multiple' === $settings['gallery_type'] && ! empty( $settings['galleries'] ); $is_single = 'single' === $settings['gallery_type'] && ! empty( $settings['gallery'] ); $galleries = []; if ( $is_multiple ) { $galleries = $settings['galleries']; }elseif ( $is_single ) { $galleries[0] = $settings['gallery']; } $this->add_render_attribute( 'gallery_container', 'class', 'iktheme-gallery-block-wrap' ); ?>
print_render_attribute_string( 'gallery_container' ); ?>> get_advance_gallery_tab(); $layout = $settings['gallery_layout']; $gap = $settings['gap']['size'] . $settings['gap']['unit']; ?>
get_settings_for_display(); $this->add_render_attribute('tab_wrap_class',[ 'class' => [ 'iktheme-gallery-item-wrap' ] ] ); ?>
print_render_attribute_string( 'tab_wrap_class' ); ?>>