From ffca6f4be77db14205ddad55ec34bf1dc0f9cdc8 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Tue, 27 Apr 2010 05:19:32 +0000 Subject: [PATCH] navigation MDL-22173 Separators are now written inside the LI elements of the node they relate to. --- lib/outputrenderers.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 7bbfe4bcd50..5f42de24a3e 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -2073,13 +2073,21 @@ END; $htmlblocks = array(); // 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; - $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 - 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) {