<?php

namespace ThemesflatAddons\Widgets;

use  Elementor\Widget_Base ;
use  Elementor\Controls_Manager ;
use  Elementor\Utils ;
use  Elementor\Scheme_Color ;
use  Elementor\Group_Control_Typography ;
use  Elementor\Scheme_Typography ;
if ( !defined( 'ABSPATH' ) ) {
    exit;
}
// Exit if accessed directly
class TFL_Quote_Widget extends TFL_Widget_Base
{
    public function get_name()
    {
        return 'tfl-quote';
    }
    
    public function get_title()
    {
        return __( 'Quote', 'themesflat' );
    }
    
    public function get_icon()
    {
        return 'tfl-icon-quotes-left';
    }
    
    public function get_categories()
    {
        return array( 'themesflat-addons' );
    }
    
    public function get_custom_help_url()
    {
        return 'https://themesflatelementor.com/docs/themesflat-addons/core-addons/quote-addon/';
    }
    
    public function get_script_depends()
    {
        return [ 'tfl-waypoints', 'tfl-frontend-scripts' ];
    }
    
    public function get_style_depends()
    {
        return [ 'tfl-animate-styles', 'tfl-frontend-styles', 'tfl-quote-styles' ];
    }
    
    protected function register_controls()
    {
        $this->start_controls_section( 'section_quote', [
            'label' => __( 'Quote', 'themesflat' ),
        ] );

        $this->add_control( 'quote_title', [
            'type'        => Controls_Manager::TEXT,
            'label'       => __( 'Quote Title', 'themesflat' ),
            'label_block' => true,
            'separator'   => 'before',
            'default'     => __( 'Quote Title', 'themesflat' ),
            'dynamic'     => [
                'active' => true,
            ],
        ] );

        $this->add_control( 'bg_image', [
            'label'       => __( 'Bg Image', 'themesflat' ),
            'type'        => Controls_Manager::MEDIA,
            'default'     => [
                'url' => Utils::get_placeholder_image_src(),
            ],
            'label_block' => true,
            'dynamic'     => [
                'active' => true,
            ],
        ] );

        $this->add_control( 'short_text', [
            'type'        => 'textarea',
            'label'       => __( 'Short Text', 'themesflat' ),
            'description' => __( 'Short text generally displayed below the quote title.', 'themesflat' ),
            'dynamic'     => [
            'active' => true,
        ],
        ] );

        $this->add_control( 'widget_animation', [
            "type"    => Controls_Manager::SELECT,
            "label"   => __( "Animation Type", "themesflat" ),
            'options' => tfl_get_animation_options(),
            'default' => 'none',
        ] );
        $this->end_controls_section();
    }
    
    protected function render()
    {
        $settings = $this->get_settings_for_display();
        $settings = apply_filters( 'tfl_quote_' . $this->get_id() . '_settings', $settings );
        $args['settings'] = $settings;
        $args['widget_instance'] = $this;
        tfl_get_template_part( "addons/quote/style1", $args );
    }
    
    protected function content_template()
    {
    }

}