navigation MDL-22173 Fixed XHTML issue with navbar, and removed redundant ul's from nodes without children

This commit is contained in:
Sam Hemelryk 2010-04-27 02:01:38 +00:00
parent 633fedbcea
commit 6c721bbfed
3 changed files with 13 additions and 3 deletions

View File

@ -96,7 +96,12 @@ class block_navigation_renderer extends plugin_renderer_base {
$content = html_writer::tag('li', $content, $liattr);
$lis[] = $content;
}
return html_writer::tag('ul', implode("\n", $lis), $attrs);
if (count($lis)) {
return html_writer::tag('ul', implode("\n", $lis), $attrs);
} else {
return '';
}
}
}

View File

@ -62,7 +62,12 @@ class block_settings_renderer extends plugin_renderer_base {
$content = html_writer::tag('li', $content, $liattr);
$lis[] = $content;
}
return html_writer::tag('ul', implode("\n", $lis), $attrs);
if (count($lis)) {
return html_writer::tag('ul', implode("\n", $lis), $attrs);
} else {
return '';
}
}
public function search_form(moodle_url $formtarget, $searchvalue) {

View File

@ -2079,7 +2079,7 @@ END;
}
// XHTML
return join(get_separator(), $htmlblocks);
return html_writer::tag('ul', join(html_writer::tag('li',get_separator()), $htmlblocks));;
}
protected function render_navigation_node(navigation_node $item) {