Resolves gh-644 and addes the option to add, or hide the category sub-menu of a view.

This commit is contained in:
2021-01-06 12:02:55 +02:00
parent d9da5d9fc4
commit 12600431ca
16 changed files with 860 additions and 738 deletions

View File

@ -45,6 +45,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$this->registerTask('getAjaxDisplay', 'ajax');
$this->registerTask('getLinked', 'ajax');
$this->registerTask('checkAliasField', 'ajax');
$this->registerTask('checkCategoryField', 'ajax');
$this->registerTask('templateDetails', 'ajax');
$this->registerTask('getLayoutDetails', 'ajax');
$this->registerTask('dbTableColumns', 'ajax');
@ -768,6 +769,44 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
}
break;
case 'checkCategoryField':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$typeValue = $jinput->get('type', NULL, 'ALNUM');
if($typeValue && $user->id != 0)
{
$result = $this->getModel('ajax')->checkCategoryField($typeValue);
}
else
{
$result = false;
}
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
echo json_encode($result);
}
else
{
echo "(".json_encode($result).");";
}
}
catch(Exception $e)
{
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback."(".json_encode($e).");";
}
else
{
echo "(".json_encode($e).");";
}
}
break;
case 'templateDetails':
try
{