Fixed the access filter in query. Fixed the array to int helper use. Added the correct language strings to category and access filters. gh-378

This commit is contained in:
2020-12-03 02:13:49 +02:00
parent 4339ca00b3
commit 83e4562d62
74 changed files with 763 additions and 174 deletions

View File

@ -288,9 +288,17 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
$_access = $this->getState('filter.access');
if ($_access && is_numeric($_access))
{
$query->where('a.access = ' . (int) $access);
$query->where('a.access = ' . (int) $_access);
}
elseif (ComponentbuilderHelper::checkArray($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
// Filter by the Access Array.
$query->where('a.access IN (' . implode(',', $_access) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))