mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-13 18:19:27 +00:00
UDF bugfixes
This commit is contained in:
@@ -1074,20 +1074,6 @@ class CheckboxWidget extends Widget
|
||||
// this element is used to tell what element of the dropdown is selected
|
||||
const CHECKED_ELEMENT = 'checkedElement';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct($name, $args, $htmlArgs = array())
|
||||
{
|
||||
parent::__construct($name, $args, $htmlArgs);
|
||||
|
||||
//
|
||||
if (!isset($this->_args[CheckboxWidget::CHECKED_ELEMENT]))
|
||||
{
|
||||
$this->_args[CheckboxWidget::CHECKED_ELEMENT] = Widget::HTML_DEFAULT_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -1133,48 +1119,6 @@ class CheckboxWidgetUDF extends CheckboxWidget
|
||||
$this->loadCheckboxView();
|
||||
|
||||
echo $this->content();
|
||||
|
||||
// $tmpElements = array();
|
||||
|
||||
//
|
||||
// foreach($parameters as $parameter)
|
||||
// {
|
||||
// //
|
||||
// if ((is_array($parameter) && count($parameter) == 2)
|
||||
// || (is_string($parameter) || is_numeric($parameter))
|
||||
// || (is_object($parameter) && isset($parameter->{PARENT::VALUE_FIELD})
|
||||
// && isset($parameter->{PARENT::DESCRIPTION_FIELD})))
|
||||
// {
|
||||
// $element = new stdClass(); //
|
||||
// //
|
||||
// if (is_array($parameter) && count($parameter) == 2)
|
||||
// {
|
||||
// $element->{PARENT::VALUE_FIELD} = $parameter[0]; //
|
||||
// $element->{PARENT::DESCRIPTION_FIELD} = $parameter[1]; //
|
||||
// }
|
||||
// //
|
||||
// else if (is_string($parameter) || is_numeric($parameter))
|
||||
// {
|
||||
// $element->{PARENT::VALUE_FIELD} = $parameter; //
|
||||
// $element->{PARENT::DESCRIPTION_FIELD} = $parameter; //
|
||||
// }
|
||||
// //
|
||||
// else if (is_object($parameter) && isset($parameter->{PARENT::VALUE_FIELD})
|
||||
// && isset($parameter->{PARENT::DESCRIPTION_FIELD}))
|
||||
// {
|
||||
// $element->{PARENT::VALUE_FIELD} = $parameter->{PARENT::VALUE_FIELD}; //
|
||||
// $element->{PARENT::DESCRIPTION_FIELD} = $parameter->{PARENT::DESCRIPTION_FIELD}; //
|
||||
// }
|
||||
//
|
||||
// array_push($tmpElements, $element); //
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $this->setValuesArray(success($tmpElements));
|
||||
//
|
||||
// $this->loadCheckboxView();
|
||||
//
|
||||
// echo $this->content();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -283,15 +283,9 @@ class UDFWidget extends UDFWidgetTpl
|
||||
{
|
||||
$this->_args[CheckboxWidget::CHECKED_ELEMENT] = $this->_args[UDFWidgetTpl::UDFS_ARG_NAME][$jsonSchema->{UDFWidget::NAME}];
|
||||
}
|
||||
|
||||
//
|
||||
if (!isset($this->_args[CheckboxWidget::CHECKED_ELEMENT]))
|
||||
{
|
||||
$this->_args[CheckboxWidget::CHECKED_ELEMENT] = $jsonSchema->{UDFWidgetTpl::DEFAULT_VALUE};
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_args[CheckboxWidget::CHECKED_ELEMENT] = Widget::HTML_DEFAULT_VALUE;
|
||||
$this->_args[CheckboxWidget::CHECKED_ELEMENT] = $jsonSchema->{UDFWidgetTpl::DEFAULT_VALUE};
|
||||
}
|
||||
|
||||
$checkboxWidgetUDF = new CheckboxWidgetUDF($this->_name, $this->_args);
|
||||
|
||||
Reference in New Issue
Block a user