<?php
/**
 * Export view
 *
 * @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: view.raw.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.view' );

/**
 * Front-end export View
 *
 * @package CSVIVirtueMart
 */
class CsvivirtuemartViewExport extends JView {
	
	/**
	 * Production view display method 
	 * 
	 * @copyright 
	 * @author		RolandD 
	 * @todo 
	 * @see 
	 * @access 		public
	 * @param 
	 * @return 
	 * @since 		3.0
	 */
	public function display($tpl = null) {
		$template = JRequest::getVar('template');
		$csvilog = JRequest::getVar('csvilog');
		// Check if this template can be exported from frontend
		if (!$template->getValue('export_frontend','general')) {
			$csvilog->AddStats('incorrect', JText::_('COM_CSVIVIRTUEMART_NO_EXPORT_ALLOWED'));
			JRequest::setVar('logcount', array('export' => 0));
			echo JText::_('COM_CSVIVIRTUEMART_NO_EXPORT_ALLOWED');
			// Store the log results
			$this->get('StoreLogResults', 'log');
		}
		else {
			$result = $this->get('ProcessData', 'exportfile');
		}
	}
}
?>