Fixed widgets to show if data are not present

This commit is contained in:
Paolo
2017-03-27 10:48:12 +02:00
parent 75f21145ce
commit ee827983b0
5 changed files with 53 additions and 9 deletions
+9 -1
View File
@@ -23,10 +23,18 @@ class Stufe_widget extends Widget
$emptyElement->beschreibung = 'Select a stufe...';
array_unshift($stufen->retval, $emptyElement);
}
else
else if (isError($stufen))
{
show_error($stufen);
}
else
{
// Adding an element to the array
$emptyElement = new stdClass();
$emptyElement->stufe = Partial::HTML_DEFAULT_VALUE;
$emptyElement->beschreibung = 'No stufen found';
array_unshift($stufen->retval, $emptyElement);
}
// Data to be used in the widget view
$widgetData['stufen'] = $stufen->retval;