<?php
/*
 *
 * @package		ARI Smart Content
 * @author		ARI Soft
 * @copyright	Copyright (c) 2011 www.ari-soft.com. All rights reserved
 * @license		GNU/GPL (http://www.gnu.org/copyleft/gpl.html)
 * 
 */

(defined('_JEXEC') && defined('ARI_FRAMEWORK_LOADED')) or die;

AriKernel::import('Joomla.Controllers.Controller');
AriKernel::import('Data.DataFilter');
AriKernel::import('Web.Controls.Data.MultiPageDataTable');
AriKernel::import('Application.ARISmartContent.Providers.ProvidersHelper');

class AriSmartContentControllerSourcetemplate extends AriController 
{
	function display()
	{
		$jInput = JFactory::getApplication()->input;
		$callback = $jInput->request->get('callback', null, 'RAW');
		$sourceId =  $jInput->request->get('sourceId', null, 'int');

		$columns = null;
		if ($sourceId > 0)
		{
			$sourceData = AriSmartContentProvidersHelper::resolveSource($sourceId);
			$columns = AriUtils::getParam($sourceData, 'columns');
		}

		$view = $this->getView();
		$view->display($columns, $callback);
	}
}