Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

navigation MDL-22173 Fixed XHTML issue with navbar, and removed redun…

…dant ul's from nodes without children
  • Loading branch information...
commit 6c721bbfedddef642009adbee770b6a1ac90e986 1 parent 633fedb
Sam Hemelryk samhemelryk authored
7 blocks/navigation/renderer.php
@@ -96,7 +96,12 @@ protected function navigation_node($items, $attrs=array(), $expansionlimit=null,
96 96 $content = html_writer::tag('li', $content, $liattr);
97 97 $lis[] = $content;
98 98 }
99   - return html_writer::tag('ul', implode("\n", $lis), $attrs);
  99 +
  100 + if (count($lis)) {
  101 + return html_writer::tag('ul', implode("\n", $lis), $attrs);
  102 + } else {
  103 + return '';
  104 + }
100 105 }
101 106
102 107 }
7 blocks/settings/renderer.php
@@ -62,7 +62,12 @@ protected function navigation_node(navigation_node $node, $attrs=array()) {
62 62 $content = html_writer::tag('li', $content, $liattr);
63 63 $lis[] = $content;
64 64 }
65   - return html_writer::tag('ul', implode("\n", $lis), $attrs);
  65 +
  66 + if (count($lis)) {
  67 + return html_writer::tag('ul', implode("\n", $lis), $attrs);
  68 + } else {
  69 + return '';
  70 + }
66 71 }
67 72
68 73 public function search_form(moodle_url $formtarget, $searchvalue) {
2  lib/outputrenderers.php
@@ -2079,7 +2079,7 @@ public function navbar() {
2079 2079 }
2080 2080
2081 2081 // XHTML
2082   - return join(get_separator(), $htmlblocks);
  2082 + return html_writer::tag('ul', join(html_writer::tag('li',get_separator()), $htmlblocks));;
2083 2083 }
2084 2084
2085 2085 protected function render_navigation_node(navigation_node $item) {

0 comments on commit 6c721bb

Please sign in to comment.
Something went wrong with that request. Please try again.