Location: PHPKode > projects > Anahita Social Engine > site/controllers/story.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 ComSocialengineControllerStory extends AnUikitStoryController
{
	
	public function __construct($options)
	{
		$options['story_model'] 		= 'lib.anahita.model.person.story';	
				
		parent::__construct($options);		
	}
	
	/**
	 * Add a story
	 * @return 
	 */
	public function _actionAdd()
	{
		$update = KRequest::get('post.story', 'string');
		
		$app 	= $this->getApplication();
		
		$owner  = $this->getOwner();
		
		if ($this->getViewer() === $this->getOwner())
			$story = $app->publishStoryUpdate($update);	
		else
			$story = $app->publishPublicMessage($owner, $update);
		
		parent::_actionAdd($story);	
	}
	
	public function _actionBrowse()
	{
		$layout = KRequest::get('get.layout', 'cmd');
				
		if ( $layout == 'dashboard' )
		{
			KFactory::get('lib.anahita.model.application.context')->setActor( null);
			$this->view()->setLayout('dashboard')->display();
			return;
		}
		parent::_actionBrowse();
			
	}
	
	public function _actionComment()
	{
		if ( $comment = parent::_actionComment() ) 
		{		
			$this->getApplication()->publishStoryCommentNotification( $this->getViewer(), $comment );	
		}
	}
						
//end class	
}
Return current item: Anahita Social Engine