<?php
/**
* @version	$Id: listing_types_config.php 13897 2010-08-29 10:18:03Z alex $
* @package	In-Link
* @copyright	Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license      GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/

defined('FULL_PATH') or die('restricted access!');

	$config =	Array (
					'Prefix'			=>	'lst',
					'ItemClass'			=>	Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
					'ListClass'			=>	Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
					'EventHandlerClass'	=>	Array ('class' => 'ListingTypesEventHandler', 'file' => 'listing_types_event_handler.php', 'build_event' => 'OnBuild'),
					'TagProcessorClass' =>	Array ('class' => 'ListingTypesTagProcessor', 'file' => 'listing_types_tag_processor.php', 'build_event' => 'OnBuild'),
					'AutoLoad'			=>	true,
					'AggregateTags'		=>	Array (
															Array (
																'AggregateTo' => 'l',
																'AggregatedTagName' => 'ListListingTypes',
																'LocalTagName' => 'PrintList',
															),
															Array (
																'AggregateTo' => 'l',
																'AggregatedTagName' => 'ListingTypeField',
																'LocalTagName' => 'Field',
															),
													),
					'Hooks'				=>	Array (),
					'QueryString'		=>	Array (
												1	=>	'id',
												2	=>	'Page',
												3	=>	'PerPage',
												4	=>	'event',
												5	=>	'mode',
											),
   					'IDField' 			=>	'ListingTypeId',
   					'TitleField'		=>  'Name',
					'TitlePresets'		=>	Array (
												'default'	=>	Array (	'new_status_labels'		=> Array ('lst' => '!la_title_AddingPaidListingType!'),
																		'edit_status_labels'	=> Array ('lst' => '!la_title_EditingPaidListingType!'),
																		'new_titlefield'		=> Array ('lst' => '!la_title_NewPaidListingType!'),
																),
												'listing_type_list' =>Array (	'prefixes'				=> Array ('lst_List'),
																			'format'				=>	"!la_title_PaidListingTypes!",
																),
												'listing_type_edit' =>Array (	'prefixes'				=> Array ('lst'),
																			'new_titlefield'		=> Array ('lst' => '!la_title_NewPaidListingType!'),
																			'format'				=> "#lst_status# '#lst_titlefield#' - !la_title_General!",
																),
												'listing_type_shop_cart' =>Array (	'prefixes'				=> Array ('lst'),
																					'new_titlefield'		=> Array ('lst' => '!la_title_NewPaidListingType!'),
																					'format'				=> "#lst_status# '#lst_titlefield#' - !la_title_ShopCartEntry!",
																),


											),

					'EditTabPresets' => Array (
						'Default' => Array (
							'general' => Array ('title' => 'la_tab_General', 't' => 'in-link/paid_listings/paid_listing_type_edit', 'priority' => 1),
						),
					),

					'PermSection'		=>	Array ('main' => 'in-link:listing_types'),

					'Sections'			=>	Array (
						'in-link:listing_types'	=>	Array (
							'parent'		=>	'in-link:paid_listings_folder',
							'icon'			=>	'paid_listings',
							'label'			=>	'la_tab_ListingTypes',
							'url'			=>	Array ('t' => 'in-link/paid_listings/paid_listing_types_list', 'pass' => 'm'),
							'permissions'	=>	Array ('view', 'add', 'edit', 'delete'),
							'priority'		=>	1.2, // <parent_priority>.<own_priority>, because this section replaces parent in tree
							'type'			=>	stTAB,
						),
					),

					'TableName'			=>	TABLE_PREFIX.'ListingTypes',

					'ListSQLs'			=>	Array (	'' => 'SELECT * FROM %s',), // key - special, value - list select sql

					'ItemSQLs'			=>	Array (	'' => 'SELECT * FROM %s',),

					'ListSortings'	=> 	Array (
												''	=>	Array (
																'Sorting' => Array ('ListingTypeId' => 'asc'),
														)
										),

					'Fields' => Array (
			            'ListingTypeId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,),
			            'Name' => Array ('type' => 'string', 'not_null' => 1, 'default' => '', 'required' => '1'),
			            'Description' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL),
			            'Duration' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
			            'DurationType' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (1 => 'la_opt_sec', 2 => 'la_opt_min', 3 => 'la_opt_hour', 4 => 'la_opt_day', 5 => 'la_opt_week', 6 => 'la_opt_month', 7 => 'la_opt_year')),
			            'OnPurchaseEdPick' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off'), 'default' => 3),

			            'OnPurchaseStatus' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (3 => 'la_Unchanged', 1 => 'la_Enabled', 0 => 'la_Disabled', 2 => 'la_Pending'), 'default' => 3),

			            'OnPurchaseNew' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'), 'default' => 3),
			            'OnPurchasePop' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'), 'default' => 3),
			            'OnPurchaseHot' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'), 'default' => 3),
			            'OnPurchasePriorityAction' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (0 => 'la_DontChange', 1 => 'la_SetEqualTo', 2 => 'la_IncreaseBy', 3 => 'la_DecreaseBy'), 'default' => 0),
			            'OnPurchasePriorityValue' => Array ('type' => 'int', 'not_null' => 1, 'default' => 1),
			            'OnPurchaseAddToCatEnabled' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
			            'OnPurchaseAddToCat' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
			            'OnPurchaseCustomTemplate' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),

			            'OnExpireEdPick' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off'), 'not_null' => 1, 'default' => 3),
			            'OnExpireNew' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'), 'default' => 3),
			            'OnExpirePop' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'), 'default' => 3),
			            'OnExpireHot' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'), 'default' => 3),
			            'OnExpirePriorityAction' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (0 => 'la_DontChange', 1 => 'la_SetEqualTo', 2 => 'la_IncreaseBy', 3 => 'la_DecreaseBy'), 'default' => 0),
			            'OnExpirePriorityValue' => Array ('type' => 'int', 'not_null' => 1, 'default' => 1),
			            'OnExpireRemoveFromCatEnabled' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
			            'OnExpireRemoveFromCat' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
			            'OnExpireCustomTemplate' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),

			            'OnExpireStatus' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (3 => 'la_Unchanged', 1 => 'la_Enabled', 0 => 'la_Disabled', 2 => 'la_Pending'), 'default' => 3),
			            'RenewalReminder' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
			            'EnableBuying' => Array (
							'type' => 'int',
							'formatter' => 'kOptionsFormatter',
							'options' => Array (0 => 'la_No', 1 => 'la_Yes',), 'use_phrases' => 1,
							'default' => 0, 'not_null' => 1,
						),
			            'ShopCartName' => Array ('type' => 'string', 'default' => null),
			            'Price' => Array ('type' => 'double', 'default' => ''),
			            'Recurring' => Array (
							'type' => 'int',
							'formatter' => 'kOptionsFormatter',
							'options' => Array (0 => 'la_No', 1 => 'la_Yes',), 'use_phrases' => 1,
							'default' => 0, 'not_null' => 1,
						),
			            'VirtualProductId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
						        ),

					'Grids'	=> Array (
						'Default' => Array (
							'Icons' => Array (
								'default' => 'icon16_item.png',
								0 => 'icon16_disbaled.png',
								1 => 'icon16_item.png',
								'module' => 'core',
							),
							'Fields' => Array (
								'ListingTypeId' => Array ( 'title' => 'la_col_Id' , 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60),
								'Name' => Array ( 'title' => 'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 250),
								'Duration' => Array ( 'title' => 'la_col_Duration' , 'data_block' => 'duration_td', 'filter_block' => 'grid_like_filter', 'width' => 100),
																		),

																),
													),
	);