/
home
/
rekodeb
/
webmars
/
wp-content
/
plugins
/
calmor-core
/
widgets
/
Upload File
HOME
<?php namespace calmorCore\Widgets; use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Background; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Text_Shadow; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Text Typing Effect * * Elementor widget for text typing effect. * * @since 1.7.0 */ class calmor_service_cate extends Widget_Base { public function get_name() { return 'calmor-service_cate'; } public function get_title() { return __( 'Service Side Bar', 'calmor-core' ); } public function get_icon() { return 'eicon-device-desktop'; } public function get_categories() { return [ 'calmor-elements' ]; } protected function _register_controls() { $service_cat = new \Elementor\Repeater(); $this->start_controls_section( 'service_cat_images_features_sec', [ 'label' => __( 'Service Category List', 'calmor-core' ), ] ); $service_cat->add_control( 'service_cat_title', [ 'label' => __( 'Category Title', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'Web Development' ] ); $service_cat->add_control( 'service_cat_url', [ 'label' => __( 'Category URL', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => '#' ] ); $this->add_control( 'feature_service_cat', [ 'label' => __( 'Category Info', 'calmor-core' ), 'type' => Controls_Manager::REPEATER, 'title_field' => '{{{ service_cat_title }}}', 'fields' => $service_cat->get_controls(), ] ); $this->end_controls_section(); $this->start_controls_section( 'service_cat_buttom_content', [ 'label' => __( 'Sidebar Content', 'calmor-core' ), ] ); $this->add_control( 'service_content_title', [ 'label' => __( 'Content Title', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'Have a project in mind?' ] ); $this->add_control( 'service_content_text', [ 'label' => __( 'Content Text', 'calmor-core' ), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'default' => 'Have a project in mind?' ] ); $this->add_control( 'feature_img', [ 'label' => esc_html__( 'Feature Image', 'calmor-core' ), 'type' => Controls_Manager::MEDIA, 'label_block' => true, ] ); $this->end_controls_section(); $this->start_controls_section( 'style_sec_list_style', [ 'label' => __( 'List Style', 'calmor-core' ), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'list_background', 'label' => esc_html__( 'Background', 'calmor-core' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .service_sidebar .service_sidebar_list a', ] ); $this->add_responsive_control( 'sidebar_list_margin', [ 'label' => esc_html__('Margin', 'almor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .service_sidebar .service_sidebar_list a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'sidebar_list_padding', [ 'label' => esc_html__('Padding', 'almor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .service_sidebar .service_sidebar_list a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'list_title_color', [ 'label' => esc_html__('Title Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .service_sidebar .service_sidebar_list a p' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'list_title_typo', 'selector' => ' {{WRAPPER}} .service_sidebar .service_sidebar_list a p', ] ); $this->end_controls_section(); $this->start_controls_section( 'style_sec_content', [ 'label' => __( 'Content Style', 'calmor-core' ), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'background', 'label' => esc_html__( 'Background', 'calmor-core' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .service_sidebar .service_sidebar_post', ] ); $this->add_responsive_control( 'sidebar_margin', [ 'label' => esc_html__('Margin', 'almor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .service_sidebar .service_sidebar_post' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'sidebar_padding', [ 'label' => esc_html__('Padding', 'almor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .service_sidebar .service_sidebar_post' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'title_color', [ 'label' => esc_html__('Title Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .service_sidebar .service_sidebar_post h6 a' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typo', 'selector' => ' {{WRAPPER}} .service_sidebar .service_sidebar_post h6 a', ] ); $this->add_control( 'content_color', [ 'label' => esc_html__('Title Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .service_sidebar .service_sidebar_post p' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_typo', 'selector' => ' {{WRAPPER}} .service_sidebar .service_sidebar_post p', ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings(); $feature_service_cat = isset($settings['feature_service_cat']) ? $settings['feature_service_cat'] : ''; ?> <div class="service_sidebar"> <div class="service_sidebar_list list-unstyled"> <?php if ( is_array( $feature_service_cat ) && count( $feature_service_cat ) > 0 ) { $i=1; foreach ( $feature_service_cat as $feature_cl ) { ?> <a href="<?php echo $feature_cl['service_cat_url']; ?>"> <p><?php echo $feature_cl['service_cat_title']; ?></p> <i class="fa-solid fa-arrow-right"></i> </a> <?php } } ?> </div> <div class="service_sidebar_post"> <img src="<?php echo esc_url($settings['feature_img']['url']); ?>" alt=""> <h6><a href="#"><?php echo $settings['service_content_title']; ?></a></h6> <p><?php echo $settings['service_content_text']; ?></p> <i class="fa-solid fa-arrow-right"></i> </div> </div> <?php } }