<?php
if (! class_exists ( 'DTBooking_Cs_Sc_ServiceList' ) ) {

    class DTBooking_Cs_Sc_ServiceList {

        function DTBooking_sc_ServiceList() {

			$plural_name = '';
			if( function_exists( 'dt_booking_cs_get_option' ) ) :
				$plural_name	=	dt_booking_cs_get_option( 'singular-service-text', esc_html__('Service', 'dt-reservation-plugin') );
			endif;

			$options = array(
			  'name'      => 'dt_sc_service_list',
			  'title'     => $plural_name.esc_html__(' List', 'dt-reservation-plugin'),
			  'fields'    => array(

				array(
				  'id'          => 'terms',
				  'type'        => 'select',
				  'title'       => esc_html__('Terms', 'dt-reservation-plugin'),
				  'options'     => 'categories',
				  'query_args'  => array(
					'type'      => 'dt_service',
					'taxonomy'  => 'dt_service_category'
				  ),
				  'attributes' => array(
					'multiple' 		   => 'only-key',
					'data-placeholder' => esc_html__('Select service category', 'dt-reservation-plugin'),
					'style'            => 'width: 200px;'
				  ),
				  'class' 	   => 'chosen',
				  'desc'       => '<div class="cs-text-muted">'.esc_html__('Choose service as you want.', 'dt-reservation-plugin').'</div>',
				),
				array(
				  'id'    => 'posts_per_page',
				  'type'  => 'text',
				  'title' => esc_html__( 'Products Per Page', 'dt-reservation-plugin' ),
				  'default' => 3
				),
				array(
				  'id'        => 'orderby',
				  'type'      => 'select',
				  'title'     => esc_html__('Order by', 'dt-reservation-plugin'),
				  'options'   => array(
					'ID'       => esc_html__('ID', 'dt-reservation-plugin'),
					'title'    => esc_html__('Title', 'dt-reservation-plugin'),
					'name'     => esc_html__('Name', 'dt-reservation-plugin'),
					'type' 	   => esc_html__('Type', 'dt-reservation-plugin'),
					'date'     => esc_html__('Date', 'dt-reservation-plugin'),
					'rand'     => esc_html__('Random', 'dt-reservation-plugin')
				  ),
				  'class'     => 'chosen',
				  'default'   => 'ID',
				  'info'      => esc_html__('Choose orderby of services to display.', 'dt-reservation-plugin')
				),
				array(
				  'id'        => 'order',
				  'type'      => 'select',
				  'title'     => esc_html__('Sort order', 'dt-reservation-plugin'),
				  'options'   => array(
					'desc'    => esc_html__('Descending', 'dt-reservation-plugin'),
					'asc'     => esc_html__('Ascending', 'dt-reservation-plugin')
				  ),
				  'class'     => 'chosen',
				  'default'   => 'desc',
				  'info'      => esc_html__('Choose order of services to display.', 'dt-reservation-plugin')
				),
				array(
				  'id'    => 'el_class',
				  'type'  => 'text',
				  'title' => esc_html__( 'Extra class name', 'dt-reservation-plugin' ),
				  'after' => '<div class="cs-text-muted">'.esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'dt-reservation-plugin').'</div>',
				),
			  ),
			);

			return $options;
		}
	}				
}