<?php

/**
 * @since TBD
 * @class FLTheEventsCalendarExportLinksModule
 */
class FLTheEventsCalendarExportLinksModule extends FLBuilderModule {

	/**
	 * @since TBD
	 * @return void
	 */
	public function __construct() {
		parent::__construct(array(
			'name'          	=> __( 'Event Export Links', 'fl-theme-builder' ),
			'description'   	=> __( 'Displays links to export the current event to your calendar.', 'fl-theme-builder' ),
			'group'      		=> __( 'Themer Modules', 'fl-theme-builder' ),
			'category'      	=> __( 'The Events Calendar', 'fl-theme-builder' ),
			'partial_refresh'	=> true,
			'dir'               => FL_THEME_BUILDER_THE_EVENTS_CALENDAR_DIR . 'modules/fl-the-events-calendar-export-links/',
			'url'               => FL_THEME_BUILDER_THE_EVENTS_CALENDAR_URL . 'modules/fl-the-events-calendar-export-links/',
			'enabled'           => FLThemeBuilderLayoutData::current_post_is( 'singular' ),
		));
	}
}

FLBuilder::register_module( 'FLTheEventsCalendarExportLinksModule', array(
	'general'       => array(
		'title'         => __( 'Style', 'fl-theme-builder' ),
		'sections'      => array(
			'general'         => array(
				'title'         => '',
				'fields'        => array(
					'align'    		=> array(
						'type'          => 'select',
						'label'         => __( 'Alignment', 'fl-theme-builder' ),
						'default'	    => 'left',
						'options'		=> array(
							'left'			=> __( 'Left', 'fl-theme-builder' ),
							'center'		=> __( 'Center', 'fl-theme-builder' ),
							'right'			=> __( 'Right', 'fl-theme-builder' ),
						),
						'preview'       => array(
							'type'          => 'css',
							'selector'      => '.fl-module-content .tribe-events-cal-links',
							'property'      => 'text-align',
						),
					),
					'text_color'    => array(
						'type'          => 'color',
						'label'         => __( 'Text Color', 'fl-theme-builder' ),
						'show_reset'    => true,
					),
					'bg_color'      => array(
						'type'          => 'color',
						'label'         => __( 'Background Color', 'fl-theme-builder' ),
						'show_reset'    => true,
					),
					'border_radius' => array(
						'type'          => 'text',
						'label'         => __( 'Border Radius', 'fl-theme-builder' ),
						'default'       => '0',
						'size'          => '5',
						'description'   => 'px',
						'placeholder'	=> '0',
					),
				),
			),
		),
	),
) );
