Added buttons to edit cutomcode directly from where it is added in other areas around the component. This will improve the customcode workflow in JCB.

This commit is contained in:
2019-01-31 23:44:21 +02:00
parent 8cdf056ad4
commit 1a538e71d7
52 changed files with 1407 additions and 236 deletions

View File

@ -45,6 +45,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$this->registerTask('getDynamicValues', 'ajax');
$this->registerTask('checkFunctionName', 'ajax');
$this->registerTask('usedin', 'ajax');
$this->registerTask('getEditCustomCodeButtons', 'ajax');
$this->registerTask('getExistingValidationRuleCode', 'ajax');
$this->registerTask('getValidationRulesTable', 'ajax');
$this->registerTask('checkRuleName', 'ajax');
@ -838,6 +839,44 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
}
break;
case 'getEditCustomCodeButtons':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idValue = $jinput->get('id', NULL, 'INT');
if($idValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getEditCustomCodeButtons($idValue);
}
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 'getExistingValidationRuleCode':
try
{