protected function render_custom_menu_item(custom_menu_item $menunode, $submenu = null) { if ('list_divider' === $menunode->get_text()) { return bootstrap::list_divider(); } if (!$menunode->has_children()) { return $this->render_custom_menu_leaf($menunode); } foreach ($menunode->get_children() as $child) { $items[] = $this->render_custom_menu_item($child, true); } if ($submenu === true) { return html::li(bootstrap::dropdown_submenu($menunode->get_text(), $items)); } else { return html::li(bootstrap::dropdown_menu($menunode->get_text(), $items)); } }