mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-20 13:39:27 +00:00
6th release
This commit is contained in:
@@ -875,6 +875,9 @@ class DropdownWidget extends Widget
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class DropdownWidgetUDF extends DropdownWidget
|
||||
{
|
||||
/**
|
||||
@@ -907,6 +910,50 @@ class DropdownWidgetUDF extends DropdownWidget
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* It exends the Widget class to represent an HTML textarea
|
||||
*/
|
||||
class TextareaWidget extends Widget
|
||||
{
|
||||
const TEXT = 'text'; //
|
||||
const ROWS = 'rows'; //
|
||||
const COLS = 'cols'; //
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function setText($text)
|
||||
{
|
||||
$this->_args[DropdownWidget::TEXT] = $text;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function loadTextareaView()
|
||||
{
|
||||
$this->view('widgets/textarea', $this->_args);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class TextareaWidgetUDF extends TextareaWidget
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function render($parameters)
|
||||
{
|
||||
$this->setText($parameters);
|
||||
|
||||
$this->loadTextareaView();
|
||||
|
||||
echo $this->content();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -133,7 +133,7 @@ class UDFWidget extends UDFWidgetTpl
|
||||
}
|
||||
else if ($jsonSchema->type == 'textarea')
|
||||
{
|
||||
|
||||
$this->_renderTextarea($jsonSchema);
|
||||
}
|
||||
else if ($jsonSchema->type == 'date')
|
||||
{
|
||||
@@ -156,15 +156,15 @@ class UDFWidget extends UDFWidgetTpl
|
||||
{
|
||||
$dropdownWidgetUDF = new DropdownWidgetUDF($this->_name, $this->_args);
|
||||
|
||||
$paramters = array();
|
||||
$parameters = array();
|
||||
|
||||
if (isset($jsonSchema->listValues->enum))
|
||||
{
|
||||
$paramters = $jsonSchema->listValues->enum;
|
||||
$parameters = $jsonSchema->listValues->enum;
|
||||
}
|
||||
else if (isset($jsonSchema->listValues->sql))
|
||||
{
|
||||
$paramters = $jsonSchema->listValues->sql;
|
||||
$parameters = $jsonSchema->listValues->sql;
|
||||
}
|
||||
|
||||
if ($multiple)
|
||||
@@ -172,7 +172,23 @@ class UDFWidget extends UDFWidgetTpl
|
||||
$dropdownWidgetUDF->setMultiple();
|
||||
}
|
||||
|
||||
$dropdownWidgetUDF->render($paramters);
|
||||
$dropdownWidgetUDF->render($parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _renderTextarea($jsonSchema)
|
||||
{
|
||||
$textareaUDF = new TextareaUDF($this->_name, $this->_args);
|
||||
|
||||
$text = '';
|
||||
if (isset($jsonSchema->defaultValue))
|
||||
{
|
||||
$text = $jsonSchema->defaultValue;
|
||||
}
|
||||
|
||||
$textareaUDF->render($text);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user