Moved some class around for better structure in the jcb_powers of JCB. Fixed small issue with JCB package export.

This commit is contained in:
2022-10-23 23:18:02 +02:00
parent d4843d6696
commit 869a1879cb
18 changed files with 136 additions and 81 deletions

View File

@ -693,17 +693,26 @@ class ComponentbuilderModelJoomla_components extends ListModel
{
$values = json_decode($values, true);
}
// let's check for just a string or int
elseif (is_string($values) || (is_numeric($values) && $values > 0))
{
$values = [$values];
}
// make sure we have an array of values
if (!ComponentbuilderHelper::checkArray($values, true) || !ComponentbuilderHelper::checkString($table) || !ComponentbuilderHelper::checkString($key))
{
return false;
}
// start the query
$query = $this->_db->getQuery(true);
// Select some fields
$query->select(array('a.*'));
// From the componentbuilder_ANY table
$query->from($this->_db->quoteName('#__componentbuilder_'. $table, 'a'));
// check if this is an array of integers
if ($this->is_numeric($values))
{
@ -722,12 +731,14 @@ class ComponentbuilderModelJoomla_components extends ListModel
return $this->_db->quote($var);
}, $values)) . ')');
}
// Implement View Level Access
if (!$this->user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $this->user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');
// Load the items

View File

@ -271,7 +271,7 @@ class ComponentbuilderModelPowers extends ListModel
else
{
$search = $db->quote('%' . $db->escape($search) . '%');
$query->where('(a.system_name LIKE '.$search.' OR a.type LIKE '.$search.' OR a.description LIKE '.$search.' OR a.extends_custom LIKE '.$search.' OR a.extends LIKE '.$search.' OR a.name LIKE '.$search.')');
$query->where('(a.system_name LIKE '.$search.' OR a.type LIKE '.$search.' OR a.description LIKE '.$search.' OR a.extends_custom LIKE '.$search.' OR a.extends LIKE '.$search.' OR a.guid LIKE '.$search.' OR a.name LIKE '.$search.')');
}
}