start_controls_section( 'course_wishlist_content', [ 'label' => __('General Settings', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'course_add_wishlist_icon', [ 'label' => __('Add Icon', 'acadlix-addon-for-elementor'), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'far fa-heart', 'library' => 'fa-solid', ], ] ); $this->add_control( 'course_remove_wishlist_icon', [ 'label' => __('Remove Icon', 'acadlix-addon-for-elementor'), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-heart', 'library' => 'fa-solid', ], ] ); $this->end_controls_section(); } protected function register_style_controls() { // $this->start_controls_section( // 'course_wishlist_style_section', // array( // 'label' => __('General Styles', 'acadlix-addon-for-elementor'), // 'tab' => Controls_Manager::TAB_STYLE, // ) // ); // $selector = '{{WRAPPER}} .aelms-course-wishlist'; // $this->add_group_control( // \Elementor\Group_Control_Border::get_type(), // [ // 'name' => 'course_wishlist_border', // 'selector' => "{$selector}", // ] // ); // $this->add_responsive_control( // 'course_whishlist_border_radius', // [ // 'label' => __('Border Radius', 'acadlix-addon-for-elementor'), // 'type' => Controls_Manager::DIMENSIONS, // 'size_units' => ['px', '%'], // 'selectors' => [ // "{$selector}" => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', // ], // 'default' => [ // 'top' => 50, // 'right' => 50, // 'bottom' => 50, // 'left' => 50, // 'unit' => '%', // 'isLinked' => true // ], // ] // ); // $this->add_group_control( // \Elementor\Group_Control_Box_Shadow::get_type(), // [ // 'name' => 'course_whishlist_box_shadow', // 'label' => __('Box Shadow', 'acadlix-addon-for-elementor'), // 'selector' => "{$selector}", // 'fields_options' => [ // 'box_shadow_type' => [ // 'default' =>'yes' // ] // ], // ] // ); // $this->add_control( // 'course_wishlist_background_color', // array( // 'label' => __('Background Color', 'acadlix-addon-for-elementor'), // 'type' => Controls_Manager::COLOR, // 'selectors' => array( // "{$selector}" => 'background-color: {{VALUE}}' // ), // 'default' => '#fff', // ) // ); // $this->add_responsive_control( // 'course_wishlist_padding', // [ // 'label' => __('Padding', 'acadlix-addon-for-elementor'), // 'type' => Controls_Manager::DIMENSIONS, // 'size_units' => ['px', 'em', '%'], // 'selectors' => [ // $selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', // ], // 'default' => [ // 'unit' => 'px', // 'top' => 8, // 'right' => 8, // 'bottom' => 8, // 'left' => 8, // ], // ] // ); // $this->end_controls_section(); $this->start_controls_section( 'course_add_wishlist_style_section', array( 'label' => __('Add Icon Styles', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ) ); $add_selector = '{{WRAPPER}} .aelms-course-add-wishlist'; $this->add_control( 'course_add_wishlist_icon_color', array( 'label' => __('Add Icon Color', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => array( $add_selector => 'color: {{VALUE}}' ), 'default' => '#0073e6', ) ); $this->add_responsive_control( 'course_add_wishlist_icon_size', array( 'label' => __('Add Icon Size', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => array('px'), 'range' => array( 'px' => array( 'min' => 5, 'max' => 100, ), ), 'default' => array( 'unit' => 'px', 'size' => 20, ), 'selectors' => array( $add_selector => 'font-size: {{SIZE}}{{UNIT}};', ), ) ); $this->end_controls_section(); $this->start_controls_section( 'course_remove_wishlist_style_section', array( 'label' => __('Remove Icon Styles', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ) ); $remove_selector = '{{WRAPPER}} .aelms-course-remove-wishlist'; $this->add_control( 'course_remove_wishlist_icon_color', array( 'label' => __('Remove Icon Color', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => array( $remove_selector => 'color: {{VALUE}}' ), 'default' => '#0073e6', ) ); $this->add_responsive_control( 'course_remove_wishlist_icon_size', array( 'label' => __('Remove Icon Size', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => array('px'), 'range' => array( 'px' => array( 'min' => 5, 'max' => 100, ), ), 'default' => array( 'unit' => 'px', 'size' => 20, ), 'selectors' => array( $remove_selector => 'font-size: {{SIZE}}{{UNIT}};', ), ) ); $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/wishlist.php'; $html = ob_get_clean(); echo wp_kses_post($html); } } }