<commit_before><?php
/**
 * @version     $Id$
 * @category	Nooku
 * @package     Nooku_Server
 * @subpackage  Files
 * @copyright   Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Default Model Class
 *
 * @author      <NAME> <http://nooku.assembla.com/profile/ercanozkaya>
 * @category	Nooku
 * @package     Nooku_Server
 * @subpackage  Files
 */

class ComFilesModelDefault extends KModelAbstract
{
	public function __construct(KConfig $config)
	{
		parent::__construct($config);

		$this->_state
			->insert('limit'    , 'int', JFactory::getApplication()->getCfg('list_limit'))
			->insert('offset'   , 'int', 0)
			->insert('search'	, 'filename')
			->insert('direction', 'word', 'asc')

			->insert('container', 'identifier', null)
			->insert('path'		, 'com://admin/files.filter.path', null, true) // unique
			->insert('folder'	, 'com://admin/files.filter.path', '')
			->insert('types'	, 'cmd', '')
			->insert('editor'   , 'cmd', '') // used in modal windows
			;
	}

	protected function _initialize(KConfig $config)
	{
		$config->append(array(
            'state'      => KFactory::get('com://admin/files.model.state.node'),
       	));

       	parent::_initialize($config);
    }
}<commit_msg>re #148: Add sort state to the default model<commit_after><?php
/**
 * @version     $Id$
 * @category	Nooku
 * @package     Nooku_Server
 * @subpackage  Files
 * @copyright   Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Default Model Class
 *
 * @author      <NAME> <http://nooku.assembla.com/profile/ercanozkaya>
 * @category	Nooku
 * @package     Nooku_Server
 * @subpackage  Files
 */

class ComFilesModelDefault extends KModelAbstract
{
	public function __construct(KConfig $config)
	{
		parent::__construct($config);

		$this->_state
			->insert('limit'    , 'int', JFactory::getApplication()->getCfg('list_limit'))
			->insert('offset'   , 'int', 0)
			->insert('search'	, 'filename')
			->insert('direction', 'word', 'asc')
            ->insert('sort'     , 'cmd')

			->insert('container', 'identifier', null)
			->insert('path'		, 'com://admin/files.filter.path', null, true) // unique
			->insert('folder'	, 'com://admin/files.filter.path', '')
			->insert('types'	, 'cmd', '')
			->insert('editor'   , 'cmd', '') // used in modal windows
			;
	}

	protected function _initialize(KConfig $config)
	{
		$config->append(array(
            'state'      => KFactory::get('com://admin/files.model.state.node'),
       	));

       	parent::_initialize($config);
    }
}
{'fraction_non_alphanumeric': 0.1893555394641564, 'fraction_numerical': 0.005430847212165098, 'mean_word_length': 3.1548872180451126, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '6199894', 'n_tokens_mistral': 987, 'n_tokens_neox': 925, 'n_words': 176}