Skip to content
Snippets Groups Projects
Commit 59407722 authored by Phy's avatar Phy
Browse files

don't show empty optiongroup item in Mobilemenu

parent 33e09e14
No related branches found
No related tags found
No related merge requests found
......@@ -70,14 +70,16 @@ class MobileMenu implements MenuInterface {
$html .= '<option value="">' . $empty . '</option>';
foreach($this->getGroupedItems() as $tools => $items) {
$html .= '<optgroup label="' . $lang[$tools . '_tools'] . '">';
foreach($items as $item) {
$params = $item->getParams();
$html .= '<option value="' . $params['do'] . '">';
$html .= hsc($item->getLabel());
$html .= '</option>';
if (count($items)) {
$html .= '<optgroup label="' . $lang[$tools . '_tools'] . '">';
foreach($items as $item) {
$params = $item->getParams();
$html .= '<option value="' . $params['do'] . '">';
$html .= hsc($item->getLabel());
$html .= '</option>';
}
$html .= '</optgroup>';
}
$html .= '</optgroup>';
}
$html .= '</select>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment