<?php
/**
 * Available Fields controller
 *
 * @package 	CSVIVirtueMart
 * @author 		Roland Dalmulder
 * @link 		http://www.csvimproved.com
 * @copyright 	Copyright (C) 2006 - 2012 RolandD Cyber Produksi
 * @license 	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 * @version 	$Id: availablefields.php 1892 2012-02-11 11:01:09Z RolandD $
 */

defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );

jimport('joomla.application.component.controller');

/**
 * Available Fields Controller
 *
 * @package    CSVIVirtueMart
 */
class CsvivirtuemartControllerAvailableFields extends JController {
	
	/**
	 * Constructor 
	 * 
	 * @copyright 
	 * @author 		RolandD
	 * @todo 
	 * @see 
	 * @access 		public
	 * @param 
	 * @return 
	 * @since 		3.0
	 */
	public function __construct() {
		parent::__construct();
	}
	
	/**
	 * List the available fields 
	 * 
	 * @copyright 
	 * @author 		RolandD
	 * @todo 
	 * @see 
	 * @access 		public
	 * @param 
	 * @return 
	 * @since 		3.0
	 */
	public function AvailableFields() {
		// Create the view
		$view = $this->getView('availablefields', 'html');
		
		// Add the models
		$view->setModel( $this->getModel( 'availablefields', 'CsvivirtuemartModel' ), true );
		// Available fields
		$view->setModel( $this->getModel( 'templates', 'CsvivirtuemartModel' ));
		
		// Display it all
		$view->display();
	}
	
	/**
	 * Redirect for updating available fields 
	 * 
	 * @copyright 
	 * @author		RolandD 
	 * @todo 
	 * @see 
	 * @access 		public
	 * @param 
	 * @return 
	 * @since 		3.0
	 */
	public function Update() {
		$this->setRedirect('index.php?option=com_csvivirtuemart&task=updateavailablefields&view=maintenance');
	}
}
?>
