<?php

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

	/**
	 * @since TBD
	 * @return void
	 */
	public function __construct() {
		parent::__construct(array(
			'name'          	=> __( 'Event Countdown', 'fl-theme-builder' ),
			'description'   	=> __( 'Displays a countdown timer for the current event.', '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-countdown/',
			'url'               => FL_THEME_BUILDER_THE_EVENTS_CALENDAR_URL . 'modules/fl-the-events-calendar-countdown/',
			'enabled'           => FLThemeBuilderLayoutData::current_post_is( 'singular' ),
		));
	}
}

FLBuilder::register_module( 'FLTheEventsCalendarCountdownModule', 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',
							'property'      => 'text-align',
						),
					),
					'show_seconds'   => array(
						'type'          => 'select',
						'label'         => __( 'Show Seconds', 'fl-theme-builder' ),
						'default'	    => '1',
						'options'		=> array(
							'1'				=> __( 'Yes', 'fl-theme-builder' ),
							'0'				=> __( 'No', 'fl-theme-builder' ),
						),
					),
				),
			),
		),
	),
) );
