mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'wip-MDL-41788_master_3' of git://github.com/gjb2048/moodle
This commit is contained in:
commit
69f86e87a7
3 changed files with 15 additions and 10 deletions
|
@ -176,10 +176,9 @@ img.icon-pre {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extends bootstrapbase/less/bootstrap/navbar.less
|
// Extends bootstrapbase/less/bootstrap/navbar.less
|
||||||
// to enable scroll in longer menus especially language menu.
|
// to enable scroll in the language menu.
|
||||||
|
.langmenu.open > .dropdown-menu {
|
||||||
.open > .dropdown-menu {
|
|
||||||
display: block;
|
display: block;
|
||||||
max-height: 500px;
|
max-height: 150px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
|
|
||||||
class theme_bootstrapbase_core_renderer extends core_renderer {
|
class theme_bootstrapbase_core_renderer extends core_renderer {
|
||||||
|
|
||||||
|
/** @var custom_menu_item language The language menu if created */
|
||||||
|
protected $language = null;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This renders a notification message.
|
* This renders a notification message.
|
||||||
* Uses bootstrap compatible html.
|
* Uses bootstrap compatible html.
|
||||||
|
@ -102,9 +105,9 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($addlangmenu) {
|
if ($addlangmenu) {
|
||||||
$language = $menu->add(get_string('language'), new moodle_url('#'), get_string('language'), 10000);
|
$this->language = $menu->add(get_string('language'), new moodle_url('#'), get_string('language'), 10000);
|
||||||
foreach ($langs as $langtype => $langname) {
|
foreach ($langs as $langtype => $langname) {
|
||||||
$language->add($langname, new moodle_url($this->page->url, array('lang' => $langtype)), $langname);
|
$this->language->add($langname, new moodle_url($this->page->url, array('lang' => $langtype)), $langname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,12 +129,15 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
|
||||||
if ($menunode->has_children()) {
|
if ($menunode->has_children()) {
|
||||||
|
|
||||||
if ($level == 1) {
|
if ($level == 1) {
|
||||||
$dropdowntype = 'dropdown';
|
$class = 'dropdown';
|
||||||
} else {
|
} else {
|
||||||
$dropdowntype = 'dropdown-submenu';
|
$class = 'dropdown-submenu';
|
||||||
}
|
}
|
||||||
|
|
||||||
$content = html_writer::start_tag('li', array('class'=>$dropdowntype));
|
if ($menunode === $this->language) {
|
||||||
|
$class .= ' langmenu';
|
||||||
|
}
|
||||||
|
$content = html_writer::start_tag('li', array('class' => $class));
|
||||||
// If the child has menus render it as a sub menu.
|
// If the child has menus render it as a sub menu.
|
||||||
$submenucount++;
|
$submenucount++;
|
||||||
if ($menunode->get_url() !== null) {
|
if ($menunode->get_url() !== null) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue