<?php
namespace SabaiApps\Directories\Component\Directory\Type;

class DirectoryType extends AbstractType {

	protected function _directoryInfo() {
		return array(
			'label'                => _x( 'Directory', 'directory type', 'directories-pro' ),
			'content_types'        => array( 'listing' ),
			'primary_content_type' => 'listing',
		);
	}

	public function directoryContentTypeInfo( $contentType ) {
		switch ( $contentType ) {
			case 'listing':
				return array(
					'component'                 => 'Directory',
					'entity_type'               => 'post',
					'suffix'                    => 'dir_ltg',
					'slug'                      => 'listing',
					'label'                     => __( 'Listings', 'directories-pro' ),
					'label_singular'            => __( 'Listing', 'directories-pro' ),
					'label_add'                 => __( 'Add Listing', 'directories-pro' ),
					'label_all'                 => __( 'All Listings', 'directories-pro' ),
					'label_select'              => __( 'Select Listing', 'directories-pro' ),
					'label_search'              => __( 'Search Listings', 'directories-pro' ),
					'label_compare'             => __( 'Compare Listings', 'directories-pro' ),
					'label_count'               => __( '%s listing', 'directories-pro' ),
					'label_count2'              => __( '%s listings', 'directories-pro' ),
					'label_page'                => __( 'Listing: %s', 'directories-pro' ),
					'icon'                      => 'fas fa-file-alt',
					'public'                    => true,
					'properties'                => array(
						'content' => array(
							'label'           => __( 'Listing Description', 'directories-pro' ),
							'weight'          => 10,
							'widget_settings' => array( 'rows' => 10 ),
						),
					),
					'fields'                    => array(),
					'taxonomies'                => array(),
					'levelable'                 => true,
					'privatable'                => false,
					'featurable'                => true,
					'expirable'                 => true,
					'frontendsubmit_enable'     => true,
					'frontendsubmit_guest'      => true,
					'entity_tag'                => 'directory_category',
					'voting_enable'             => array( 'updown', 'rating', 'bookmark', 'report' ),
					'search_enable'             => true,
					'search_fields'             => array(
						'search_keyword' => array(),
					),
					'directory_category_enable' => true,
					'directory_category_field'  => array( 'weight' => 2 ),
					'directory_tag_enable'      => true,
					'directory_tag_field'       => array( 'weight' => 98 ),
					'displays'                  => 'directory_listing_displays.php',
					'views'                     => 'directory_listing_views.php',
					'comparison_enable'         => true,
				);
		}
	}
}
