Added the community JCB package import option. Improved the jsonToString method to be more dynamic

This commit is contained in:
2018-05-02 00:17:38 +02:00
parent 8b4efd640f
commit 88dbcee380
15 changed files with 702 additions and 137 deletions

View File

@ -46,6 +46,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$this->registerTask('isRead', 'ajax');
$this->registerTask('getComponentDetails', 'ajax');
$this->registerTask('getCronPath', 'ajax');
$this->registerTask('getJCBpackageInfo', 'ajax');
$this->registerTask('tableColumns', 'ajax');
$this->registerTask('fieldSelectOptions', 'ajax');
$this->registerTask('getDynamicScripts', 'ajax');
@ -235,6 +236,44 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
}
break;
case 'getJCBpackageInfo':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$urlValue = $jinput->get('url', NULL, 'STRING');
if($urlValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getJCBpackageInfo($urlValue);
}
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 'tableColumns':
try
{