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

@ -832,6 +832,26 @@ x#fitem_id_availabilityconditionsjson input[type=text] {
#custommenu .yui3-menu .yui3-menu .yui3-menu-label {background-image:url([[pix:theme|vertical-menu-submenu-indicator]]); padding-right: 20px;}
#custommenu .yui3-menu .yui3-menu .yui3-menu-label-menuvisible {background-image:url([[pix:theme|horizontal-menu-submenu-indicator]]);}
/**
* Dividers.
*/
.yui3-menu.yui3-menu-horizontal .yui3-menuitem.divider {
overflow: hidden;
width: 0;
height: 24px;
border-left: 1px solid #ddd;
}
.yui3-menu .yui3-menu .yui3-menuitem.divider {
width: auto;
height: 0;
margin: 4px 1px;
border-left: 0px none;
border-top: 1px solid #ddd;
}
.yui3-menu .yui3-menuitem.divider a {
visibility: invisible;
}
/**
* Smart Select Element
*/

View file

@ -324,3 +324,23 @@ div#dock {
.dir-rtl .nav .caret {
margin-right: 4px;
}
// Dividers
.nav {
.divider {
overflow: hidden;
width: 0;
height: 40px;
border-left: 1px solid #e5e5e5;
border-right: 1px solid #fff;
}
}
.dropdown-menu {
.divider {
width: auto;
height: 1px;
border-left: 0px none;
border-right: 0px none;
}
}

View file

@ -133,6 +133,7 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
protected function render_custom_menu_item(custom_menu_item $menunode, $level = 0 ) {
static $submenucount = 0;
$content = '';
if ($menunode->has_children()) {
if ($level == 1) {
@ -164,14 +165,21 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
}
$content .= '</ul>';
} else {
$content = '<li>';
// The node doesn't have children so produce a final menuitem.
if ($menunode->get_url() !== null) {
$url = $menunode->get_url();
// Also, if the node's text matches '####', add a class so we can treat it as a divider.
if (preg_match("/^#+$/", $menunode->get_text())) {
// This is a divider.
$content = '<li class="divider">&nbsp;</li>';
} else {
$url = '#';
$content = '<li>';
if ($menunode->get_url() !== null) {
$url = $menunode->get_url();
} else {
$url = '#';
}
$content .= html_writer::link($url, $menunode->get_text(), array('title' => $menunode->get_title()));
$content .= '</li>';
}
$content .= html_writer::link($url, $menunode->get_text(), array('title'=>$menunode->get_title()));
}
return $content;
}

File diff suppressed because one or more lines are too long