protected function getInput()
{
$section = $this->section;
$assetField = $this->assetField;
$component = empty($this->component) ? 'root.1' : $this->component;
$this->isGlobalConfig = $component === 'root.1';
$this->actions = Access::getActionsFromFile(JPATH_ADMINISTRATOR . '/components/' . $component . '/access.xml', "/access/section[@name='" . $section . "']/");
if ($this->actions === false) {
$this->actions = [];
}
foreach ($this->element->children() as $el) {
if ($el->getName() === 'action') {
$this->actions[] = (object) array('name' => (string) $el['name'], 'title' => (string) $el['title'], 'description' => (string) $el['description']);
}
}
$this->assetId = (int) $this->form->getValue($assetField);
$this->newItem = empty($this->assetId) && $this->isGlobalConfig === false && $section !== 'component';
if (empty($this->assetId)) {
$db = Factory::getDbo();
$query = $db->getQuery(true)->select($db->quoteName('id'))->from($db->quoteName('#__assets'))->where($db->quoteName('name') . ' = :component')->bind(':component', $component);
$db->setQuery($query);
$this->assetId = (int) $db->loadResult();
}
if (!$this->isGlobalConfig) {
$db = Factory::getDbo();
$query = $db->getQuery(true)->select($db->quoteName('parent_id'))->from($db->quoteName('#__assets'))->where($db->quoteName('id') . ' = :assetId')->bind(':assetId', $this->assetId, ParameterType::INTEGER);
$db->setQuery($query);
$this->parentAssetId = (int) $db->loadResult();
}
$this->assetRules = Access::getAssetRules($this->assetId, false, false);
$this->groups = $this->getUserGroups();
return trim($this->getRenderer($this->layout)->render($this->getLayoutData()));
}