mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- Changed controller system/FAS_UDF, less busy now
- Method execReadOnlyQuery of DB_Model less strict check against SQL statements - Added new public method setup to DB_Model to setup the model after initialization - Added new constants to UDFLib - Added new private method _printEndUDFBlock and _printEndUDFBlock to UDFLib - Added new public methods setUDFUniqueId, getSession, getSessionElement, setSession, setSessionElement, saveUDFs and isAllowed to UDFLib - Removed model system/FAS_UDF_model - View views/system/fas_udf now uses the view templates/FHC-Header - Added new parameter udfs to view templates/FHC-Header - Added new properties to UDFWidget - Added new private methods _initUDFWidget, _checkParameters and _startUDFWidget to UDFWidget
This commit is contained in:
@@ -12,7 +12,7 @@ class DropdownWidgetUDF extends DropdownWidget
|
||||
{
|
||||
// Array that will contains the elements to be displayed in the dropdown
|
||||
$tmpNewElements = array();
|
||||
|
||||
|
||||
// Loops through the given parameters
|
||||
foreach($parameters as $parameter)
|
||||
{
|
||||
@@ -29,27 +29,27 @@ class DropdownWidgetUDF extends DropdownWidget
|
||||
// If the single element is an array of two element
|
||||
if (is_array($parameter) && count($parameter) == 2)
|
||||
{
|
||||
$newElement->{DropdownWidget::ID_FIELD} = $parameter[0]; //
|
||||
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter[1]; //
|
||||
$newElement->{DropdownWidget::ID_FIELD} = $parameter[0]; //
|
||||
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter[1]; //
|
||||
}
|
||||
// If the single element is a string or a number
|
||||
else if (is_string($parameter) || is_numeric($parameter))
|
||||
{
|
||||
$newElement->{DropdownWidget::ID_FIELD} = $parameter; //
|
||||
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter; //
|
||||
$newElement->{DropdownWidget::ID_FIELD} = $parameter; //
|
||||
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter; //
|
||||
}
|
||||
// If the single element is an object with two properties: id and description
|
||||
else if (is_object($parameter) && isset($parameter->{DropdownWidget::ID_FIELD})
|
||||
&& isset($parameter->{DropdownWidget::DESCRIPTION_FIELD}))
|
||||
{
|
||||
$newElement->{DropdownWidget::ID_FIELD} = $parameter->{DropdownWidget::ID_FIELD}; //
|
||||
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter->{DropdownWidget::DESCRIPTION_FIELD}; //
|
||||
$newElement->{DropdownWidget::ID_FIELD} = $parameter->{DropdownWidget::ID_FIELD}; //
|
||||
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter->{DropdownWidget::DESCRIPTION_FIELD}; //
|
||||
}
|
||||
|
||||
|
||||
array_push($tmpNewElements, $newElement); // Add $newElement into $tmpNewElements
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set the list of elements
|
||||
$this->setElementsArray(
|
||||
success($tmpNewElements),
|
||||
@@ -57,9 +57,9 @@ class DropdownWidgetUDF extends DropdownWidget
|
||||
$this->htmlParameters[HTMLWidget::PLACEHOLDER],
|
||||
'No data found for this UDF'
|
||||
);
|
||||
|
||||
|
||||
$this->loadDropDownView();
|
||||
|
||||
|
||||
echo $this->content();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user