Your IP : 216.73.216.196


Current Path : /home/icmq6107/clients/naddaf/wp-content/themes/crowdngo/inc/vendors/elementor/widgets/
Upload File :
Current File : /home/icmq6107/clients/naddaf/wp-content/themes/crowdngo/inc/vendors/elementor/widgets/story.php

<?php

namespace Elementor;

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

class Crowdngo_Elementor_Story extends Widget_Base {

	public function get_name() {
        return 'apus_element_story';
    }

	public function get_title() {
        return esc_html__( 'Apus Story', 'crowdngo' );
    }
    
	public function get_categories() {
        return [ 'crowdngo-elements' ];
    }

	protected function _register_controls() {

        $this->start_controls_section(
            'content_section',
            [
                'label' => esc_html__( 'Story', 'crowdngo' ),
                'tab' => Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'title',
            [
                'label' => esc_html__( 'Title', 'crowdngo' ),
                'type' => Controls_Manager::TEXT,
                'placeholder' => esc_html__( 'Enter your title here', 'crowdngo' ),
            ]
        );

        $this->add_control(
            'subtitle',
            [
                'label' => esc_html__( 'SubTitle', 'crowdngo' ),
                'type' => Controls_Manager::TEXT,
                'placeholder' => esc_html__( 'Enter your subtitle here', 'crowdngo' ),
            ]
        );

        $this->add_control(
            'desc',
            [
                'label' => esc_html__( 'Description', 'crowdngo' ),
                'type' => Controls_Manager::TEXTAREA,
                'placeholder' => esc_html__( 'Enter your Description here', 'crowdngo' ),
            ]
        );

        $this->add_control(
            'days',
            [
                'label' => esc_html__( 'Waiting days', 'crowdngo' ),
                'type' => Controls_Manager::TEXT,
            ]
        );

        $this->add_control(
            'img_src',
            [
                'name' => 'image',
                'label' => esc_html__( 'Image', 'crowdngo' ),
                'type' => Controls_Manager::MEDIA,
                'placeholder'   => esc_html__( 'Upload Image Here', 'crowdngo' ),
            ]
        );

        $this->add_control(
            'btn_text',
            [
                'label' => esc_html__( 'Button Text', 'crowdngo' ),
                'type' => Controls_Manager::TEXT,
                'placeholder' => esc_html__( 'Enter your button text here', 'crowdngo' ),
            ]
        );

        $this->add_control(
            'link',
            [
                'label' => esc_html__( 'Button URL', 'crowdngo' ),
                'type' => Controls_Manager::TEXT,
                'input_type' => 'url',
                'placeholder' => esc_html__( 'Enter your Button Link here', 'crowdngo' ),
            ]
        );

   		$this->add_control(
            'el_class',
            [
                'label'         => esc_html__( 'Extra class name', 'crowdngo' ),
                'type'          => Controls_Manager::TEXT,
                'placeholder'   => esc_html__( 'If you wish to style particular content element differently, please add a class name to this field and refer to it in your custom CSS file.', 'crowdngo' ),
            ]
        );

        $this->end_controls_section();

    }

	protected function render() {

        $settings = $this->get_settings();

        extract( $settings );

        ?>
        <div class="widget-story <?php echo esc_attr($el_class); ?>">
        
            <div class="row">
                <div class="col-md-6 col-sm-12 col-xs-12">
                    <?php if ( !empty($subtitle) ) { ?>
                        <div class="subtitle"><?php echo esc_html($subtitle); ?></div>
                    <?php } ?>
                    <?php if ( !empty($title) ) { ?>
                        <h3 class="title"><?php echo esc_html($title); ?></h3>
                    <?php } ?>
                    <?php if ( !empty($desc) ) { ?>
                            <div class="desc">
                                <?php echo wp_kses_post($desc); ?>
                            </div>
                    <?php } ?>
                    <?php if ( !empty($days) ) { ?>
                            <div class="days">
                                <i class="fa fa-clock-o"></i>
                                <div class="days-content">
                                    <?php echo wp_kses_post($days); ?>
                                </div>
                            </div>
                    <?php } ?>
                </div>
                <div class="col-md-6 col-sm-12 col-xs-12">
                    <?php
                    if ( !empty($img_src['id']) ) {
                    ?>
                            <?php echo crowdngo_get_attachment_thumbnail($img_src['id'], 'full'); ?>
                    <?php } ?>
                </div>
                
            </div>
            <?php if ( !empty($btn_text) && !empty($link) ) { ?>
                <a href="<?php echo esc_url($link); ?>" class="btn btn-theme"><?php echo wp_kses_post($btn_text); ?></a>
            <?php } ?>
        </div>
        <?php

    }

}

Plugin::instance()->widgets_manager->register_widget_type( new Crowdngo_Elementor_Story );