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:
@ -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'))
|
||||
|
Reference in New Issue
Block a user