start_controls_section( 'course_instructors_content', [ 'label' => __('General Settings', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'course_instructors_html_tag', array( 'label' => esc_html__('Select Tag', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => array( 'h1' => esc_html('h1'), 'h2' => esc_html('h2'), 'h3' => esc_html('h3'), 'h4' => esc_html('h4'), 'h5' => esc_html('h5'), 'h6' => esc_html('h6'), ), 'default' => 'h2', ) ); $this->add_responsive_control( 'course_instructors_title', [ 'label' => __('Title', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::TEXTAREA, 'default' => __('Course Instructors:', 'acadlix-addon-for-elementor'), 'placeholder' => __('Type your title here', 'acadlix-addon-for-elementor'), 'rows' => 3, ] ); $this->add_responsive_control( 'course_instructors_title_display', [ 'label' => __('Show Title', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'acadlix-addon-for-elementor'), 'label_off' => __('Hide', 'acadlix-addon-for-elementor'), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'course_instructors_title_divider', [ 'type' => \Elementor\Controls_Manager::DIVIDER, ] ); $this->add_responsive_control( 'course_instructors_profile_picture_display', [ 'label' => __('Profile Picture', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'acadlix-addon-for-elementor'), 'label_off' => __('Hide', 'acadlix-addon-for-elementor'), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'course_instructors_name_display', [ 'label' => __('Display Name', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'acadlix-addon-for-elementor'), 'label_off' => __('Hide', 'acadlix-addon-for-elementor'), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'course_instructors_bio_display', [ 'label' => __('Display Bio', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'acadlix-addon-for-elementor'), 'label_off' => __('Hide', 'acadlix-addon-for-elementor'), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'course_instructors_link', array( 'label' => __('Link', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => array( 'new_window' => 'New Window', 'same_window' => 'Same Window', ), 'default' => 'new_window', ) ); $this->end_controls_section(); $this->start_controls_section( 'course_instructors_display_content_section', [ 'label' => __('Display Settings', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $selector = '{{WRAPPER}} .aelms-course-instructors'; $this->add_responsive_control( 'course_instructors_display', [ 'label' => __('Display', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => [ 'block' => __('Block', 'acadlix-addon-for-elementor'), 'flex' => __('Flex', 'acadlix-addon-for-elementor'), ], 'selectors' => [ $selector => 'display: {{VALUE}};', ], 'default' => 'flex', ] ); $this->add_responsive_control( 'course_instructors_flex_direction', [ 'label' => __('Flex Direction', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => [ 'row' => __('Row', 'acadlix-addon-for-elementor'), 'row-reverse' => __('Row Reverse', 'acadlix-addon-for-elementor'), 'column' => __('Column', 'acadlix-addon-for-elementor'), 'column-reverse' => __('Column Reverse', 'acadlix-addon-for-elementor'), ], 'selectors' => [ $selector => 'flex-direction: {{VALUE}};', ], 'default' => 'row', 'condition' => [ 'course_instructors_display' => 'flex', ], ] ); $this->add_responsive_control( 'course_instructors_justify_content', [ 'label' => __('Justify Content', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => [ 'flex-start' => __('Flex Start', 'acadlix-addon-for-elementor'), 'flex-end' => __('Flex End', 'acadlix-addon-for-elementor'), 'center' => __('Center', 'acadlix-addon-for-elementor'), 'space-between' => __('Space Between', 'acadlix-addon-for-elementor'), 'space-around' => __('Space Around', 'acadlix-addon-for-elementor'), 'space-evenly' => __('Space Evenly', 'acadlix-addon-for-elementor'), 'stretch' => __('Stretch', 'acadlix-addon-for-elementor'), ], 'selectors' => [ $selector => 'justify-content: {{VALUE}};', ], 'default' => 'flex-start', 'condition' => [ 'course_instructors_display' => 'flex', ], ] ); $this->add_responsive_control( 'course_instructors_align_items', [ 'label' => __('Align Items', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => [ 'flex-start' => __('Flex Start', 'acadlix-addon-for-elementor'), 'flex-end' => __('Flex End', 'acadlix-addon-for-elementor'), 'center' => __('Center', 'acadlix-addon-for-elementor'), 'baseline' => __('Baseline', 'acadlix-addon-for-elementor'), 'stretch' => __('Stretch', 'acadlix-addon-for-elementor'), ], 'selectors' => [ $selector => 'align-items: {{VALUE}};', ], 'default' => 'center', 'condition' => [ 'course_instructors_display' => 'flex', ], ] ); $this->add_responsive_control( 'course_instructors_gap', [ 'label' => __('Gap', 'acadlix-addon-for-elementor'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', '%', 'em', 'rem', 'custom'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 8, ], 'selectors' => [ "{$selector}" => 'gap: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'course_instructors_display' => 'flex', ], ] ); $this->end_controls_section(); } protected function register_style_controls() { // instructors title style $instructors_title_selector = '{{WRAPPER}} .aelms-course-instructors-title'; $this->start_controls_section( 'course_instructors_title_style_section', [ 'label' => __('Title', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'course_instructors_title_color', [ 'label' => __('Color', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ $instructors_title_selector => 'color: {{VALUE}};', ], 'default' => '#161616', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'course_instructors_title_typography', 'label' => __('Typography', 'acadlix-addon-for-elementor'), 'selector' => $instructors_title_selector, ] ); $this->end_controls_section(); // instructors profile picture $instructors_profile_picture_selector = '{{WRAPPER}} .aelms-course-instructors-profile-picture'; $this->start_controls_section( 'course_instructors_profile_picture_style_section', [ 'label' => __('Profile Picture', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'course_instructors_profile_picture_size', array( 'label' => __('Image Size', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => array('px'), 'range' => array( 'px' => array( 'min' => 10, 'max' => 200, ), ), 'default' => array( 'size' => 52, 'unit' => 'px', ), 'selectors' => array( "{$instructors_profile_picture_selector}" => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}', ), ) ); $this->add_group_control( \Elementor\Group_Control_Css_Filter::get_type(), [ 'name' => 'course_instructors_profile_picture_filters', 'selector' => "{$instructors_profile_picture_selector}", ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'course_instructors_profile_picture_border', 'selector' => "{$instructors_profile_picture_selector}", ] ); $this->add_responsive_control( 'course_instructors_profile_picture_border_radius', [ 'label' => __('Border Radius', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ "{$instructors_profile_picture_selector}" => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => [ 'top' => 0, 'right' => 0, 'bottom' => 0, 'left' => 0, 'unit' => 'px', 'isLinked' => true ], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'course_instructors_profile_picture_box_shadow', 'label' => __('Box Shadow', 'acadlix-addon-for-elementor'), 'selector' => "{$instructors_profile_picture_selector}", ] ); $this->end_controls_section(); // instructors name and link $instructors_name_selector = '{{WRAPPER}} .aelms-course-instructors-name'; $this->start_controls_section( 'course_instructors_name_style_section', array( 'label' => __('Instructor Name', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ) ); $this->start_controls_tabs('instructors_name_color_tabs'); $this->start_controls_tab( 'instructors_name_color_normal', array( 'label' => __('Normal', 'acadlix-addon-for-elementor'), ) ); $this->add_responsive_control( 'course_instructors_name_color', array( 'label' => __('Color', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => array( "{$instructors_name_selector} a" => 'color: {{VALUE}};', ), 'default' => '#161616', ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'course_instructors_name_typography', 'label' => __('Typography', 'acadlix-addon-for-elementor'), 'selector' => $instructors_name_selector, ) ); $this->end_controls_tab(); $this->start_controls_tab( 'instructors_name_color_hover', array( 'label' => __('Hover', 'acadlix-addon-for-elementor'), ) ); $this->add_responsive_control( 'course_instructors_name_hover_color', array( 'label' => __('Hover', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => array( "{$instructors_name_selector} a:hover" => 'color: {{VALUE}};', ), 'default' => '#161616', ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'course_instructors_name_hover_typography', 'label' => __('Typography', 'acadlix-addon-for-elementor'), 'selector' => "{$instructors_name_selector} a:hover", ) ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); // instructors bio style $instructors_bio_selector = '{{WRAPPER}} .aelms-course-instructors-bio'; $this->start_controls_section( 'course_instructors_bio_style_section', [ 'label' => __('Bio', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'course_instructors_bio_color', [ 'label' => __('Color', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ $instructors_bio_selector => 'color: {{VALUE}};', ], 'default' => '#161616', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'course_instructors_bio_typography', 'label' => __('Typography', 'acadlix-addon-for-elementor'), 'selector' => $instructors_bio_selector, ] ); $this->end_controls_section(); } protected function render() { $course = aelms_get_course(); if ($course) { ob_start(); $settings = $this->get_settings_for_display(); include AELMS_PLUGIN_DIR . 'templates/course/instructors.php'; $html = ob_get_clean(); echo wp_kses_post($html); } } }