<?php
/**
* @version	$Id: related_searches_config.php 16388 2016-08-11 08:16:43Z alex $
* @package	In-Portal
* @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' => 'search',

	'Clones' => Array (
		'c-search' => Array ('ParentPrefix' => 'c'),
	),

	'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
	'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
	'EventHandlerClass' => Array ('class' => 'RelatedSearchEventHandler', 'file' => 'related_searches_event_handler.php', 'build_event' => 'OnBuild'),
	'TagProcessorClass' => Array ('class' => 'RelatedSearchTagProcessor', 'file' => 'related_searches_tag_processor.php', 'build_event' => 'OnBuild'),
	'AutoLoad' => true,

	'QueryString' => Array (
		1 => 'id',
		2 => 'Page',
		3 => 'PerPage',
		4 => 'event',
	),

	'IDField' => 'RelatedSearchId',
	'StatusField' => Array ('Enabled'),
	'TableName' => TABLE_PREFIX.'CategoryRelatedSearches',
	'ParentTableKey' => 'ResourceId',
	'ForeignKey' => 'ResourceId',
	'ParentPrefix' => 'c',
	'AutoDelete' => true,
	'AutoClone' => true,

	'ListSQLs' => Array (
		''=> '	SELECT %1$s.* %2$s
				FROM %1$s',
	),

	'ListSortings' => Array (
		'' => Array (
			'ForcedSorting' => Array ('Priority' => 'desc'),
			'Sorting' => Array ('Keyword' => 'asc'),
		)
	),

	'Fields' => Array (
		'RelatedSearchId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
		'ResourceId' => Array ('type' => 'int', 'not_null' => 1, 'required' => 1, 'default' => 0),
		'Keyword' => Array ('type' => 'string', 'required' => 1, 'not_null' => 1, 'default' => ''),
		'ItemType' => Array ('type' => 'int', 'not_null' => 1, 'required' => 1, 'default' => 0),
		'Enabled' => Array (
			'type' => 'int',
			'formatter' => 'kOptionsFormatter',
			'options' => Array (0 => 'la_Disabled', 1 => 'la_Enabled'), 'use_phrases' => 1,
			'not_null' => 1, 'default' => 1,
		),
		'Priority' => Array ('type' => 'int', 'not_null'=>1,'default'=>0),
	),

	'Grids' => Array (
		'Default' => Array (
			'Icons' => Array (
				'default' => 'icon16_item.png',
				0 => 'icon16_disabled.png',
				1 => 'icon16_item.png'
			),
			'Fields' => Array (
				'RelatedSearchId' => Array ( 'title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
				'Keyword' => Array ( 'title' => 'la_col_Keyword', 'data_block' => 'grid_keyword_td', 'filter_block' => 'grid_like_filter'),
				'Enabled' => Array ( 'title' => 'column:la_fld_Status', 'filter_block' => 'grid_options_filter'),
			),
		),
	),
);