Merge branch 'MDL-46022-master' of git://github.com/jethac/moodle

Conflicts:
	theme/bootstrapbase/less/moodle/modules.less
	theme/bootstrapbase/style/moodle.css
This commit is contained in:
Damyon Wiese 2014-06-24 14:10:51 +08:00
commit d9640a99ba
6 changed files with 80 additions and 13 deletions

View file

@ -3070,14 +3070,31 @@ EOD;
$content .= html_writer::end_tag('div');
$content .= html_writer::end_tag('li');
} else {
// The node doesn't have children so produce a final menuitem
$content = html_writer::start_tag('li', array('class'=>'yui3-menuitem'));
if ($menunode->get_url() !== null) {
$url = $menunode->get_url();
// The node doesn't have children so produce a final menuitem.
// Also, if the node's text matches '####', add a class so we can treat it as a divider.
$content = '';
if (preg_match("/^#+$/", $menunode->get_text())) {
// This is a divider.
$content = html_writer::start_tag('li', array('class' => 'yui3-menuitem divider'));
} else {
$url = '#';
$content = html_writer::start_tag(
'li',
array(
'class' => 'yui3-menuitem'
)
);
if ($menunode->get_url() !== null) {
$url = $menunode->get_url();
} else {
$url = '#';
}
$content .= html_writer::link(
$url,
$menunode->get_text(),
array('class' => 'yui3-menuitem-content', 'title' => $menunode->get_title())
);
}
$content .= html_writer::link($url, $menunode->get_text(), array('class'=>'yui3-menuitem-content', 'title'=>$menunode->get_title()));
$content .= html_writer::end_tag('li');
}
// Return the sub menu