<?php

	/*
	 * @author	Martijn Polak
	 * @since	20040805
	 * @name	Interchange Component.
	 * 			Parameters
	 * 			 - template:	defines which template to use
	 * 			 - uri:			the URI to print
	 * 			 - uli:			[DON'T USE] an optional uli to print the uri for (instead of uri)
	 * 			 - xsl:			[DON'T USE] the xsl uri to use to transform an xml uri
	 */
	 
	global $g_obj_tich0105;

//	if ($componentSettings['uli']) printResourceByURI($componentSettings['uli']);
//	else printResourceByURI($componentSettings['uri'], $componentSettings['uri']);

	$g_obj_tich0105->setTemplateVariableByRef('componentSettings', $componentSettings);
	$tmp_org_id = $g_obj_tich0105->getVariable('org_id');
	if (is_numeric($componentSettings['org_id'])) $g_obj_tich0105->setVariable('org_id', $componentSettings['org_id']);
	
	switch ($componentSettings['show']) {

		case 'blocks':
			$g_obj_tich0105->showBlocks($componentSettings['group'], $_REQUEST['uri']);
			break;
		
		case 'search':
			$g_obj_tich0105->setVariable('search->minimum_word_length', 2);
			$g_obj_tich0105->setVariable('search->results_per_page', 15);
			$g_obj_tich0105->printSearchResult($componentSettings['search'], "", $_REQUEST['os'], $_REQUEST['sc']);
			break;

		default:
			if ($componentSettings['template'])	$g_obj_tich0105->setSetting('templates->resource', $componentSettings['template']);
			$g_obj_tich0105->printResourceByURI($componentSettings['uri']);
		
	}

	if (is_numeric($componentSettings['org_id'])) $g_obj_tich0105->setVariable('org_id', $tmp_org_id);

?>