Skip to content

Commit

Permalink
Update code to deal with Hathor template.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuan Pham Ngoc committed Mar 23, 2015
1 parent d778c23 commit 9254cb9
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions administrator/components/com_content/models/articles.php
Expand Up @@ -78,17 +78,49 @@ protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();

$input = $app->input;

// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout'))
if ($layout = $input->get('layout'))
{
$this->context .= '.' . $layout;
}

// Deal with Hathor which is not using search tools
$rawInputData = $input->getArray();

if (isset($rawInputData['filter_search']))
{
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);

$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access');
$this->setState('filter.access', $access);

$authorId = $app->getUserStateFromRequest($this->context . '.filter.author_id', 'filter_author_id');
$this->setState('filter.author_id', $authorId);

$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);

$categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id');
$this->setState('filter.category_id', $categoryId);

$level = $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level');
$this->setState('filter.level', $level);

$language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '');
$this->setState('filter.language', $language);

$tag = $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', '');
$this->setState('filter.tag', $tag);
}

// List state information.
parent::populateState('a.id', 'desc');

// Force a language
$forcedLanguage = $app->input->get('forcedLanguage');
$forcedLanguage = $input->get('forcedLanguage');

if (!empty($forcedLanguage))
{
Expand Down

0 comments on commit 9254cb9

Please sign in to comment.