<commit_before><?php
/**
 * @version     $Id: default.php 2721 2010-10-27 00:58:51Z johanjanssens $
 * @category    Nooku
 * @package     Nooku_Components
 * @subpackage  Default
 * @copyright   Copyright (C) 2007 - 2010 <NAME>. All rights reserved.
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Default View Controller
.*
 * @author      <NAME> <<EMAIL>>
 * @category    Nooku
 * @package     Nooku_Components
 * @subpackage  Default
 */
class ComDefaultControllerDefault extends KControllerForm
{
 	/**
     * Constructor
     *
     * @param   object  An optional KConfig object with configuration options
     */
    public function __construct(KConfig $config)
    {
        parent::__construct($config);
        
         //Enqueue the authorization command
        $command = clone $this->_identifier;
	    $command->path = 'command';
		$command->name = 'authorize';
	    
        $this->getCommandChain()->enqueue( KFactory::get($command));
    }
    
    /**
     * Set the request information
     * 
     * This function translates 'limitstart' to 'offset' for compatibility with Joomla
     *
     * @param array An associative array of request information
     * @return KControllerBread
     */
    public function setRequest(array $request = array())
    {
        if(isset($request['limitstart'])) {
            $request['offset'] = $request['limitstart'];
        }
        
        $this->_request = new KConfig($request);
        return $this;
    }
    
    /**
     * Display action
     * 
     * If the controller was not dispatched manually load the langauges files 
     *
     * @param   KCommandContext A command context object
     * @return  KDatabaseRow(set)   A row(set) object containing the data to display
     */
    protected function _actionDisplay(KCommandContext $context)
    {
        //Load the language file for HMVC requests who are not routed through the dispatcher
        if(!$this->isDispatched()) {
            KFactory::get('lib.joomla.language')->load('com_'.$this->getIdentifier()->package); 
        }
        
        return parent::_actionDisplay($context);
    }
}<commit_msg>- ComDefaultControllerDefault now extends KControllerResource - Renamed _actionDisplay to _actionGet. Display is now an alias for Get.<commit_after><?php
/**
 * @version     $Id: default.php 2721 2010-10-27 00:58:51Z johanjanssens $
 * @category    Nooku
 * @package     Nooku_Components
 * @subpackage  Default
 * @copyright   Copyright (C) 2007 - 2010 <NAME>. All rights reserved.
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Default Controller
.*
 * @author      <NAME> <<EMAIL>>
 * @category    Nooku
 * @package     Nooku_Components
 * @subpackage  Default
 */
class ComDefaultControllerDefault extends KControllerResource
{
    /**
     * Set the request information
     * 
     * This function translates 'limitstart' to 'offset' for compatibility with Joomla
     *
     * @param array An associative array of request information
     * @return KControllerBread
     */
    public function setRequest(array $request = array())
    {
        if(isset($request['limitstart'])) {
            $request['offset'] = $request['limitstart'];
        }
        
        $this->_request = new KConfig($request);
        return $this;
    }
    
    /**
     * Display action
     * 
     * If the controller was not dispatched manually load the langauges files 
     *
     * @param   KCommandContext A command context object
     * @return  KDatabaseRow(set)   A row(set) object containing the data to display
     */
    protected function _actionGet(KCommandContext $context)
    {
        //Load the language file for HMVC requests who are not routed through the dispatcher
        if(!$this->isDispatched()) {
            KFactory::get('lib.joomla.language')->load('com_'.$this->getIdentifier()->package); 
        }
        
        return parent::_actionGet($context);
    }
}
{'fraction_non_alphanumeric': 0.11330535670204887, 'fraction_numerical': 0.013330041964946927, 'mean_word_length': 2.5357766143106457, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7388286', 'n_tokens_mistral': 1188, 'n_tokens_neox': 1120, 'n_words': 308}