mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 08:52:21 +00:00
2nd release
This commit is contained in:
@@ -738,6 +738,36 @@ class DropdownWidget extends Widget
|
||||
|
||||
private $elementsArray; // Array of elements to be place inside the dropdown
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function displayElements($elements, $widgetData)
|
||||
{
|
||||
$this->setElementsArray(success($this->convert($elements)), true);
|
||||
$this->loadDropDownView($widgetData);
|
||||
|
||||
echo $this->content();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static function convert($elements)
|
||||
{
|
||||
$returnArray = array();
|
||||
|
||||
foreach($elements as $key => $val)
|
||||
{
|
||||
$element = new stdClass();
|
||||
$element->id = $key;
|
||||
$element->description = $val;
|
||||
|
||||
array_push($returnArray, $element);
|
||||
}
|
||||
|
||||
return $returnArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the dropdown view with all the elements to be displayed
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user