<?php
/**
 * @version		$Id: contacto.php 20196 2011-03-19 02:40:25Z pol $
 * @package		Joomla.Site
 * @subpackage	Contact
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted Access');


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

class ContactoController extends JController {

	/**
	 * Display
	 *
	 */

	function display() {

		$vName = JRequest::getCmd('view', 'default');
        $vLayout = JRequest::getCmd('layout', 'default');

        //control de las vistas views
		switch ($vName)
		{
			case 'enviado': //aca entro con-> index?option=com_contacto&view=enviado
                $vName = 'enviado';

                break;

			default:  //aca entro con-> index?option=com_contacto <-sin view o con un view inexistente
                $vName = 'contacto';

				break;
		}

		$document = JFactory::getDocument();
		$vType	  = $document->getType();

		// Get/Create the view
		$view = $this->getView($vName, $vType);
		$view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.'/views/'.strtolower($vName).'/tmpl');

		// Set the layout
	    $view->setLayout($vLayout);

		// Display the view
		$view->display();

		return $this;
	}


}