<?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 ComSocialengineControllerApplication extends ComSocialengineControllerBase
{
public function __construct(array $options=array())
{
parent::__construct($options);
$this->registerAuthentication();
$this->registerFunctionBefore(array('add', 'delete'), 'getApplication');
}
public function getApplication()
{
$this->application = KFactory::get('lib.anahita.domain.factory')
->getQuery('lib.anahita.model.application')
->where('id', '=', KRequest::get('get.id','int', 0))
->fetch();
}
public function _actionBrowse()
{
$this->view()->assign('owner', $this->getViewer())->setLayout('default')->display();
}
public function _actionAdd()
{
$this->application->addToProfile( $this->getViewer());
print KFactory::get('lib.anahita.uikit.prompt.message')->setBody(JText::_('AN-SE-APPLICATION-PROMPT-ADDED'));
}
public function _actionDelete()
{
$this->application->removeFromProfile( $this->getViewer() );
print KFactory::get('lib.anahita.uikit.prompt.message')->setBody(JText::_('AN-SE-APPLICATION-PROMPT-DELETED'));
}
//end class
}