7th release

This commit is contained in:
Paolo
2017-05-05 18:45:28 +02:00
parent bc4ff5c8e9
commit 6a11cc09cf
8 changed files with 396 additions and 35 deletions
+44 -9
View File
@@ -125,11 +125,11 @@ class UDFWidget extends UDFWidgetTpl
// Type
if ($jsonSchema->type == 'checkbox')
{
$this->_renderCheckbox($jsonSchema);
}
else if ($jsonSchema->type == 'textfield')
{
$this->_renderTextfield($jsonSchema);
}
else if ($jsonSchema->type == 'textarea')
{
@@ -155,16 +155,21 @@ class UDFWidget extends UDFWidgetTpl
private function _renderDropdown($jsonSchema, $multiple = false)
{
$dropdownWidgetUDF = new DropdownWidgetUDF($this->_name, $this->_args);
$parameters = array();
//
if (isset($jsonSchema->listValues->enum))
{
$parameters = $jsonSchema->listValues->enum;
}
//
else if (isset($jsonSchema->listValues->sql))
{
$parameters = $jsonSchema->listValues->sql;
$queryResult = $this->UDFModel->execQuery($jsonSchema->listValues->sql);
if (hasData($queryResult))
{
$parameters = $queryResult->retval;
}
}
if ($multiple)
@@ -180,15 +185,45 @@ class UDFWidget extends UDFWidgetTpl
*/
private function _renderTextarea($jsonSchema)
{
$textareaUDF = new TextareaUDF($this->_name, $this->_args);
$textareaUDF = new TextareaWidgetUDF($this->_name, $this->_args);
$text = '';
if (isset($jsonSchema->defaultValue))
$textareaUDF->render(null);
}
/**
*
*/
private function _renderTextfield($jsonSchema)
{
$textareaUDF = new TextfieldWidgetUDF($this->_name, $this->_args);
$textareaUDF->render(null);
}
/**
*
*/
private function _renderCheckbox($jsonSchema)
{
$checkboxWidgetUDF = new CheckboxWidgetUDF($this->_name, $this->_args);
$parameters = array();
//
if (isset($jsonSchema->listValues->enum))
{
$text = $jsonSchema->defaultValue;
$parameters = $jsonSchema->listValues->enum;
}
//
else if (isset($jsonSchema->listValues->sql))
{
$queryResult = $this->UDFModel->execQuery($jsonSchema->listValues->sql);
if (hasData($queryResult))
{
$parameters = $queryResult->retval;
}
}
$textareaUDF->render($text);
$checkboxWidgetUDF->render($parameters);
}
/**