Updated the contribute area in README. Added the multi filter query method, and adapted the setFilterQuery method for the new filter options. gh-378

This commit is contained in:
2020-11-19 05:07:18 +02:00
parent d7233a1420
commit 2490123095
55 changed files with 1714 additions and 1440 deletions

View File

@ -38,11 +38,17 @@ class ComponentbuilderModelLayouts extends JModelList
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
*
* @return void
*
*/
protected function populateState($ordering = null, $direction = null)
{
@ -52,36 +58,37 @@ class ComponentbuilderModelLayouts extends JModelList
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
$name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name');
$this->setState('filter.name', $name);
}
$description = $this->getUserStateFromRequest($this->context . '.filter.description', 'filter_description');
$this->setState('filter.description', $description);
$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);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$dynamic_get = $this->getUserStateFromRequest($this->context . '.filter.dynamic_get', 'filter_dynamic_get');
$this->setState('filter.dynamic_get', $dynamic_get);
$add_php_view = $this->getUserStateFromRequest($this->context . '.filter.add_php_view', 'filter_add_php_view');
$this->setState('filter.add_php_view', $add_php_view);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
$this->setState('filter.add_php_view', $add_php_view);
$name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name');
$this->setState('filter.name', $name);
$description = $this->getUserStateFromRequest($this->context . '.filter.description', 'filter_description');
$this->setState('filter.description', $description);
// List state information.
parent::populateState($ordering, $direction);
@ -222,7 +229,7 @@ class ComponentbuilderModelLayouts extends JModelList
}
}
// Filter by dynamic_get.
// Filter by Dynamic_get.
if ($dynamic_get = $this->getState('filter.dynamic_get'))
{
$query->where('a.dynamic_get = ' . $db->quote($db->escape($dynamic_get)));