Location: PHPKode > projects > Anahita Social Engine > dependencies/plg_system_socialengine/socialengine/model/application/gadget.php
<?php
/**
 * @version		1.0.0
 * @category	Anahita Social Engine™
 * @copyright	Copyright (C) 2008 - 2010 rmdStudio Inc. and Peerglobe Technology Inc. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.anahitapolis.com
 */

class AnModelApplicationGadget extends KObject
{	
	const TypeDashboard = 'dashboard';
	
	const TypeProfile   = 'profile';
	
	protected $_contentUrl;
	
	protected $_iconUrl;
	
	protected $_title;

	protected $_titleUrl;
	
	protected $_name;
	
	protected $_media;
	
	protected $_component;
	
	/**
	 * CONSTRUCTOR
	 * @param array of $options
	 * @return null
	 */
	public function __construct($options=array())
	{
		$options = $this->_initialize($options);
		
		settype($options['javascript'], 'array');
		settype($options['stylesheet'], 'array');
				
		$this->_type		= $options['type'];
		$this->_name 	  	= $options['name'];
		$this->_title 	  	= $options['title'];
		$this->_titleUrl  	= $options['title_url'];
		$this->_iconUrl   	= $options['icon_url'];
		$this->_contentUrl  = $options['url'];
		$this->_component   = $options['component'];
		$this->_media		= array('javascript' => $options['javascript'], 'stylesheet' => $options['stylesheet']);
	}
	
	/**
	 * Method to initialize the instance of the class object
	 * @param array of $options
	 * @return array of initialized $options
	 */
	protected function _initialize($options)
	{
		$default = array(
			'type'			=> '',
			'name'  		=> '',
			'title' 		=> '',
			'title_url'   	=> '',
			'url'		  	=> '',
			'icon_url'	  	=> '',
			'component'  	=> '',
			'javascript' 	=> array(),
			'stylesheet' 	=> array()
		);	
		
		return array_merge($default, $options);
	}
	
	public function javascripts()
	{
		return $this->_media['javascript'];
	}
	
	public function stylesheets()
	{
		return $this->_media['stylesheet'];
	}
	
	public function getComponent()
	{
		return $this->_component;
	}
	
	public function getType()
	{
		return $this->_type;	
	}
	
	public function getId()
	{
		return $this->_component.'-'.$this->_name;
	}
		
	public function getName()
	{
		return $this->_name;	
	}
	
	public function getTitle()
	{
		return $this->_title;	
	}
	
	public function getTitleUrl()
	{
		return $this->_titleUrl;
	}
	
	public function getIconUrl()
	{
		return $this->_iconUrl;
	}
	
	/**
	 * Method to obtain the Url to the application
	 * @return string Url
	 */
	public function getContentUrl()
	{
		return $this->_contentUrl;
	}
	
//end class	
}
Return current item: Anahita Social Engine