Moodle 2.7 - Update core_renderer.php not applying changes - Custom menu -
i developing custom theme based on bootstrap moodle 2.7. adding simple class custom menu function (render_custom_menu) on line 80. addded navbar-right class applied standard menu shown in both code blocks below.
custom menu:
protected function render_custom_menu(custom_menu $menu) { global $cfg, $user; // todo: eliminate duplicated logic, belongs in core, not // here. see mdl-39565. $content = '<ul class="nav navbar-nav navbar-right">'; foreach ($menu->get_children() $item) { $content .= $this->render_custom_menu_item($item, 1); } return $content.'</ul>'; }
standard menu:
protected function render_user_menu(custom_menu $menu) { global $cfg, $user, $db; $addusermenu = true; $addlangmenu = true; $langs = get_string_manager()->get_list_of_translations(); if (count($langs) < 2 or empty($cfg->langmenu) or ($this->page->course != siteid , !empty($this->page->course->lang))) { $addlangmenu = false; } if ($addlangmenu) { $language = $menu->add(get_string('language'), new moodle_url('#'), get_string('language'), 10000); foreach ($langs $langtype => $langname) { $language->add($langname, new moodle_url($this->page->url, array('lang' => $langtype)), $langname); } } if ($addusermenu) { if (isloggedin()) { $usermenu = $menu->add(fullname($user), new moodle_url('#'), fullname($user), 10001); $usermenu->add( '<span class="glyphicon glyphicon-off"></span>' . get_string('logout'), new moodle_url('/login/logout.php', array('sesskey' => sesskey(), 'alt' => 'logout')), get_string('logout') ); $usermenu->add( '<span class="glyphicon glyphicon-user"></span>' . get_string('viewprofile'), new moodle_url('/user/profile.php', array('id' => $user->id)), get_string('viewprofile') ); $usermenu->add( '<span class="glyphicon glyphicon-cog"></span>' . get_string('editmyprofile'), new moodle_url('/user/edit.php', array('id' => $user->id)), get_string('editmyprofile') ); } else { $usermenu = $menu->add(get_string('login'), new moodle_url('/login/index.php'), get_string('login'), 10001); } } $content = '<ul class="nav navbar-nav navbar-right">'; foreach ($menu->get_children() $item) { $content .= $this->render_custom_menu_item($item, 1); } return $content.'</ul>'; }
i'm not sure why change not taking effect. have experience , how solve it. i'm sure i'm overlooking simple.
fyi: have purged moodle cache many times, reset server , cleared history in browser.
thanks!
Comments
Post a Comment