<?php
/**
* @version 1.0.0
* @category Anahita Social Engineâ¢
* @copyright Copyright (C) 2008 - 2009 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
*/
jimport('joomla.filesystem.file');
class AnUikitViewHtml extends AnUikitViewAbstract
{
/**
* Initialize the view
* @return
* @param $options Object[optional]
*/
public function __construct($options=array())
{
parent::__construct($options);
//Add the template override path
$parts = $this->_identifier->path;
array_shift($parts);
if(count($parts) > 1)
{
$path = KInflector::pluralize(array_shift($parts));
$path .= count($parts) ? DS.implode(DS, $parts) : '';
$path .= DS.strtolower($this->getName());
}
else $path = strtolower($this->getName());
$template = KFactory::get('lib.koowa.application')->getTemplate();
$path = JPATH_THEMES.DS.$template.DS.'html'.DS.'com_'.$this->_identifier->package.DS.$path;
$this->addTemplatePath($path);
$this->css('media/com_socialengine/css/socialengine.css', array('overwrite_path' => 'css/com_socialengine'));
//mix the getViewer, getOwner method into the views
$this->mixin( KFactory::get('lib.anahita.uikit.node.mixin') );
$this->mixin( KFactory::get('lib.anahita.uikit.page.mixin') );
}
/**
* Get application using the view identifier
* uses a static method of a mixin class to get the application
* this is purely for performance reason. instead of mixin the object for each view, the method of the mixin
* is hardcoded in the view
* @return AnModelApplication
*/
public function getApplication()
{
return AnModelApplicationHelper::getApplicationByIdentifier( $this->getIdentifier() );
}
}