navigation MDL-22173 Separators are now written inside the LI elements of the node they relate to.

This commit is contained in:
Sam Hemelryk 2010-04-27 05:19:32 +00:00
parent 931697773c
commit ffca6f4be7

View file

@ -2073,13 +2073,21 @@ END;
$htmlblocks = array(); $htmlblocks = array();
// Iterate the navarray and display each node // Iterate the navarray and display each node
foreach ($items as $item) { $itemcount = count($items);
$separator = get_separator();
for ($i=0;$i < $itemcount;$i++) {
$item = $items[$i];
$item->hideicon = true; $item->hideicon = true;
$htmlblocks[] = html_writer::tag('li', $this->render($item)); if ($i===0) {
$content = html_writer::tag('li', $this->render($item));
} else {
$content = html_writer::tag('li', $separator.$this->render($item));
}
$htmlblocks[] = $content;
} }
// XHTML // XHTML
return html_writer::tag('ul', join(html_writer::tag('li',get_separator()), $htmlblocks));; return html_writer::tag('ul', join('', $htmlblocks));
} }
protected function render_navigation_node(navigation_node $item) { protected function render_navigation_node(navigation_node $item) {