Update the field area to be more user friendly, phase A of gh-258

This commit is contained in:
2018-04-11 22:05:47 +02:00
parent 6d4c823ea6
commit e6b2b48ac7
27 changed files with 943 additions and 412 deletions

View File

@ -65,6 +65,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$this->registerTask('getValidationRulesTable', 'ajax');
$this->registerTask('checkRuleName', 'ajax');
$this->registerTask('fieldOptions', 'ajax');
$this->registerTask('getFieldPropertyDesc', 'ajax');
$this->registerTask('snippetDetails', 'ajax');
$this->registerTask('setSnippetGithub', 'ajax');
$this->registerTask('getSnippets', 'ajax');
@ -967,6 +968,45 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
}
break;
case 'getFieldPropertyDesc':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$fieldtypeValue = $jinput->get('fieldtype', NULL, 'INT');
$propertyValue = $jinput->get('property', NULL, 'WORD');
if($fieldtypeValue && $propertyValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getFieldPropertyDesc($fieldtypeValue, $propertyValue);
}
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 'snippetDetails':
try
{