<?php

/*
 * Adds Mascot_Core_Educacion_Widget_SocialList widget.
 */
if( !class_exists( 'Mascot_Core_Educacion_Widget_SocialList' ) ) {
class Mascot_Core_Educacion_Widget_SocialList extends Mascot_Core_Educacion_Widget_Loader {

	/**
	 * Register widget with WordPress.
	 */
	function __construct() {
		$this->widgetOptions = array( 
			'classname'		=> 'widget-social-icons clearfix',
			'description'	=> esc_html__( 'The widget lets you easily display social icons which are configured at Theme Options > Social Links.', 'mascot-core' ),
		);
		parent::__construct( 'tm_widget_social_list', esc_html__( '(TM) Social List', 'mascot-core' ), $this->widgetOptions );
		$this->getFormFields();
	}

	
	/**
	 * Get form fields of the widget.
	 */
	protected function getFormFields() {
		$this->formFields = array(
			array(
				'id'		=> 'desc',
				'type'		=> 'description',
				'title'		=> $this->widgetOptions['description'],
			),
			array(
				'id'		=> 'title',
				'type'		=> 'text',
				'title'		=> esc_html__( 'Widget Title:', 'mascot-core' ),
				'desc'		=> '',
				'default'	=> esc_html__( 'Social List', 'mascot-core' ),
			),
			array(
				'id'		=> 'custom_css_class',
				'type'		=> 'text',
				'title'		=> esc_html__( 'Custom CSS Class:', 'mascot-core' ),
				'desc'		=> esc_html__( 'To style particular content element', 'mascot-core' ),
			),

			array(
				'id'		=> 'icon_size',
				'type'		=> 'dropdown',
				'title'		=> esc_html__( 'Icon Size:', 'mascot-core' ),
				'desc'		=> '',
				'options'	=> array(
					''  	  => esc_html__( 'Default', 'mascot-core' ),
					'icon-xs' => esc_html__( 'Extra Small', 'mascot-core' ),
					'icon-sm' => esc_html__( 'Small', 'mascot-core' ),
					'icon-md' => esc_html__( 'Medium', 'mascot-core' ),
					'icon-lg' => esc_html__( 'Large', 'mascot-core' ),
					'icon-xl' => esc_html__( 'Extra Large', 'mascot-core' ),
				)
			),
			array(
				'id'		=> 'icon_color',
				'type'		=> 'dropdown',
				'title'		=> esc_html__( 'Icon Color:', 'mascot-core' ),
				'desc'		=> '',
				'options'	=> array(
					'icon-dark' => esc_html__( 'Dark', 'mascot-core' ),
					''			=> esc_html__( 'Default', 'mascot-core' ),
					'icon-gray' => esc_html__( 'Gray', 'mascot-core' ),
				)
			),

			array(
				'id'		=> 'icon_style',
				'type'		=> 'dropdown',
				'title'		=> esc_html__( 'Icon Style:', 'mascot-core' ),
				'desc'		=> '',
				'options'	=> array(
					'icon-rounded'	=> esc_html__( 'Rounded', 'mascot-core' ),
					'icon-default'	=> esc_html__( 'Default', 'mascot-core' ),
					'icon-circled'	=> esc_html__( 'Circled', 'mascot-core' ),
				)
			),

			
			array(
				'id'		=> 'icon_border_style',
				'type'		=> 'checkbox',
				'title'		=> esc_html__( 'Make Icon Area Bordered?', 'mascot-core' ),
				'desc'		=> '',
				'value'		=> 'on',
			),
			array(
				'id'		=> 'icon_theme_colored',
				'type'		=> 'dropdown',
				'title'		=> esc_html__( 'Make Icon Theme Colored?', 'mascot-core' ),
				'desc'		=> '',
				'options'	=> mascot_core_educacion_theme_color_list()
			),
			array(
				'id'		=> 'icon_brand_colored',
				'type'		=> 'checkbox',
				'title'		=> esc_html__( 'Make Icon to It\'s Own Brand color', 'mascot-core' ),
				'desc'		=> '',
				'value'		=> 'brand',
			),
		);
	}



	/**
	 * Front-end display of widget.
	 *
	 * @see WP_Widget::widget()
	 *
	 * @param array $args	 Widget arguments.
	 * @param array $instance Saved values from database.
	 */
	public function widget( $args, $instance ) {

		//Render Shortcode from themes
		if( function_exists('mascot_core_educacion_widget_social_list') ) {
			return mascot_core_educacion_widget_social_list( $args, $instance );
		}

	}
}
}