protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
if ($layout = $app->input->get('layout')) {
$this->context .= '.'.$layout;
}
$search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$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', 0, 'int');
$this->setState('filter.level', $level);
$language = $this->getUserStateFromRequest($this->context.'.filter.language', 'filter_language', '');
$this->setState('filter.language', $language);
$author = $this->getUserStateFromRequest($this->context.'.filter.author_id', 'filter_author_id', '');
$this->setState('filter.author_id', $author);
$editor = $this->getUserStateFromRequest($this->context.'.filter.editor_id', 'filter_editor_id', '');
$this->setState('filter.editor_id', $editor);
$tag = $this->getUserStateFromRequest($this->context.'.filter.tag_id', 'filter_tag_id', '');
$this->setState('filter.tag_id', $tag);
parent::populateState('a.title', 'asc');
// Force a language
$forcedLanguage = $app->input->get('forcedLanguage');
if (!empty($forcedLanguage))
{
$this->setState('filter.language', $forcedLanguage);
$this->setState('filter.forcedLanguage', $forcedLanguage);
}
}
to: protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
if ($layout = $app->input->get('layout')) {
$this->context .= '.'.$layout;
}
$search = $app->getUserStateFromRequest($this->context.'.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$access = $app->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$published = $app->getUserStateFromRequest($this->context.'.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$categoryId = $app->getUserStateFromRequest($this->context.'.filter.category_id', 'filter_category_id');
$this->setState('filter.category_id', $categoryId);
$level = $app->getUserStateFromRequest($this->context.'.filter.level', 'filter_level', 0, 'int');
$this->setState('filter.level', $level);
$language = $app->getUserStateFromRequest($this->context.'.filter.language', 'filter_language', '');
$this->setState('filter.language', $language);
$author = $app->getUserStateFromRequest($this->context.'.filter.author_id', 'filter_author_id', '');
$this->setState('filter.author_id', $author);
$editor = $app->getUserStateFromRequest($this->context.'.filter.editor_id', 'filter_editor_id', '');
$this->setState('filter.editor_id', $editor);
$tag = $app->getUserStateFromRequest($this->context.'.filter.tag_id', 'filter_tag_id', '');
$this->setState('filter.tag_id', $tag);
parent::populateState('a.title', 'asc');
// Force a language
$forcedLanguage = $app->input->get('forcedLanguage');
if (!empty($forcedLanguage))
{
$this->setState('filter.language', $forcedLanguage);
$this->setState('filter.forcedLanguage', $forcedLanguage);
}
}