<?php namespace Webien\SearchAddon\PostType;

class Widget extends \Elementor\Widget_Base
{
    public function get_name()
    {
        return 'webien-post-type';
    }

    public function get_title()
    {
        return 'Webien Posttyp';
    }

    public function get_icon() {
        return 'eicon-post-info';
    }

    public function get_categories() {
        return ['webien'];
    }
    protected function _register_controls()
    {
        $css_handles = [
            'label' => '.webien-label'
        ];

        /** Start Form */
        $this->start_controls_section(
            'section_label_style',
            [
                'label' => __('Text', 'webien-search-addon'),
                'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name'     => 'label_typography',
                'selector' => '{{WRAPPER}} ' . $css_handles['label'],
            ]
        );

        $this->add_control(
            'label_text_color',
            [
                'label' => __( 'Text Color', 'webien-search-addon' ),
                'type'  => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} ' . $css_handles['label'] => 'color: {{VALUE}};',
                ],
            ]
        );
    }

    protected function render()
    {
        $settings = $this->get_settings_for_display();

        include(WEBIEN_SEARCH_ADDON_PLUGIN_PATH . '/src/templates/post-type.php');
    }

    protected function _content_template() {}
}