Location: PHPKode > projects > injooosm > administrator/components/com_injooosm/controller.php
<?php
/**
 * Joomla! 1.5 component injooosm
 *
 * @version $Id: controller.php 2010-01-29 21:12:00$
 * @author Christian Knorr
 * @package injooosm
 * @subpackage backend
 * @license GNU/GPL
 * @filesource
 *
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport( 'joomla.application.component.controller' );
require_once( JPATH_COMPONENT.DS.'helpers'.DS.'helper.php' );

/**
 * maincontroller for backend
 */
class injooosmController extends JController {

	/**
	 * 
	 */
	function __construct() {
		parent::__construct();

		$this->registerTask( 'savecat'	 , 'savecat' );
	}

	/**
	 * @use get task form uri and set view and layout
	 */
	function display() {
		switch($this->getTask()) {
			default:
				JRequest::setVar('view',	'default');
				break;

			case 'config':
				JRequest::setVar('view',	'config');
				JRequest::setVar('layout',	'default');
				break;

			case 'info':
				JRequest::setVar('view',	'info');
				JRequest::setVar('layout',	'default');
				break;

			case 'cats':
				JRequest::setVar('view',	'cats');
				JRequest::setVar('layout',	'default');
				break;
			
			case "newcat":
				JRequest::setVar('view',	'cats' );
				JRequest::setVar('layout',	'form' );
				break;

			case "editcat":
				JRequest::setVar('view',	'cats');
				JRequest::setVar('layout',	'editform');
				break;

			case "files":
				JRequest::setVar('view',	'files');
				JRequest::setVar('layout',	'default');
				break;

			case "newfiles":
				JRequest::setVar('view',	'files');
				JRequest::setVar('layout',	'import');
				break;

			case "newfile":
			case "editfile":
				JRequest::setVar('view',	'files');
				JRequest::setVar('layout',	'form');
				break;

			case "terrain":
				JRequest::setVar('view',	'terrain');
				JRequest::setVar('layout',	'default');
				break;

			case "newterrain":
				JRequest::setVar('view',	'terrain');
				JRequest::setVar('layout',	'form');
				break;

			case "comments":
				JRequest::setVar('view',	'comments');
				JRequest::setVar('layout',	'default');
				break;

			case "editComment":
				JRequest::setVar('view',	'comments');
				JRequest::setVar('layout',	'form');
				break;

			case "importjgt":
				JRequest::setVar('view',	'files');
				JRequest::setVar('layout',	'importjgt');
				break;
		}
		parent::display();
	}
}
Return current item: injooosm