<?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
*/
abstract class AnUikitControllerAbstract extends KControllerAbstract
{
public function __construct($options)
{
parent::__construct($options);
}
/**
* Browse a list of items
*
* @return void
*/
public function _actionBrowse()
{
$layout = KRequest::get('get.layout', 'cmd', 'default' );
$this->view()
->setLayout($layout)
->display();
}
/**
* Display a single item
*
* @return void
*/
public function _actionRead()
{
$layout = KRequest::get('get.layout', 'cmd', 'default' );
$this->view()
->setLayout($layout)
->display();
}
public function view()
{
return KFactory::get($this->getView());
}
public function execute($action = null)
{
if ( empty($action) )
$action = KRequest::get('request.action', 'cmd', null);
if(empty($action))
{
// default action is browse (list) or read (item)
$view = KRequest::get('request.view', 'cmd');
$action = KInflector::isPlural($view) ? 'browse' : 'read';
}
else
{
//Convert to lower case for lookup
$action = strtolower( $action );
}
return parent::execute($action);
}
//end class
}