Location: PHPKode > projects > Tv.2 CMS > tv2engine/tv2App.class.php
<?php // Sorry for excess comments. Please read HTML docs for general overview.

require_once(ENGINE_DIR.'tv2Client.class.php');

/** 
 * Abstract class for Tv2 applications
 * 
 * @package tv2-engine
 * @author Emilis Dambauskas (hide@address.com)
 * @copyright 2002–2003 Emilis Dambauskas under {@link http://opensource.org/licenses/artistic-license.php Artistic license}
 * @version $Id: tv2App.class.php,v 1.1 2003/07/05 09:46:53 lunaticlt Exp $
 * @class tv2App
 * @extends tv2Client
 */
class tv2App extends tv2Client
{
	/**
	 * Directory where application files are kept
	 * @attribute private string $dir
	 */
	var $dir;
	
	/**
	 * Directory where application templates are kept
	 * @attribute private string $tpl_dir
	 */
	var $tpl_dir;
	
	/**
	 * Configuration parameters
	 * @attribute private array $config
	 */
	var $config;
	
	/**
	 * @constructor tv2App
	 * @return ref object  
	 * @use $apps  
	 * @use $vs 
	 */ 
	function tv2App()
	{
		global $apps;
		$cn = get_class($this);

		$this->dir = @$apps[$cn]['dir'];
		$this->tpl_dir = @$apps[$cn]['tpl_dir'];
		$this->config = @$apps[$cn]['config'];
		
		$this->vs = &$GLOBALS['vs'];
		$this->site = &$GLOBALS['site'];
		$this->db = &$GLOBALS['db'];
	}
	
	/**
	 * Loads security object and connects to it
	 *
	 * @method private loadSecurity   
	 * @use $protocol  
	 * @use $security 
	 * @use ENGINE_DIR
	 */ 
	function loadSecurity()
	{
		global $protocol;
		
		if (!@$GLOBALS['security'])
		{
			require_once(ENGINE_DIR.'ctlSecurity.class.php');
			$GLOBALS['security'] = &new ctlSecurity();
			$GLOBALS['security']->load();
			$GLOBALS['security']->setCurrentUser($protocol->getSessionVar('uid'));
		}
		$this->security = &$GLOBALS['security'];
	}
	
	/**
	 * You should implement this method in your own apps yourself.
	 * 
	 * @method public dispatch   
	 * @param mixed $url URL array or string from mapper
	 */  
	function dispatch($url) {}
	
}

?>
Return current item: Tv.2 CMS