MDL-46107 badges: Fix badges navigation and remove empty breadcrumbs on pages using Clean
Signed-off-by: Yuliya Bozhko <[email protected]>
This commit is contained in:
+10
-1
@@ -52,7 +52,16 @@ $PAGE->set_title(get_string('issuedbadge', 'badges'));
|
||||
if (isloggedin()) {
|
||||
$PAGE->set_heading($badge->badgeclass['name']);
|
||||
$PAGE->navbar->add($badge->badgeclass['name']);
|
||||
$url = new moodle_url('/badges/mybadges.php');
|
||||
if ($badge->recipient->id == $USER->id) {
|
||||
$url = new moodle_url('/badges/mybadges.php');
|
||||
} else {
|
||||
$url = new moodle_url($CFG->wwwroot);
|
||||
}
|
||||
navigation_node::override_active_url($url);
|
||||
} else {
|
||||
$PAGE->set_heading($badge->badgeclass['name']);
|
||||
$PAGE->navbar->add($badge->badgeclass['name']);
|
||||
$url = new moodle_url($CFG->wwwroot);
|
||||
navigation_node::override_active_url($url);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +82,14 @@ $badge = new external_badge($badge, $userid);
|
||||
|
||||
$PAGE->set_pagelayout('base');
|
||||
$PAGE->set_title(get_string('issuedbadge', 'badges'));
|
||||
$PAGE->set_heading(s($badge->issued->assertion->badge->name));
|
||||
$PAGE->navbar->add(s($badge->issued->assertion->badge->name));
|
||||
if (isloggedin() && $USER->id == $userid) {
|
||||
$url = new moodle_url('/badges/mybadges.php');
|
||||
} else {
|
||||
$url = new moodle_url($CFG->wwwroot);
|
||||
}
|
||||
navigation_node::override_active_url($url);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
|
||||
@@ -56,6 +56,9 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
|
||||
*/
|
||||
public function navbar() {
|
||||
$items = $this->page->navbar->get_items();
|
||||
if (empty($items)) {
|
||||
return '';
|
||||
}
|
||||
$breadcrumbs = array();
|
||||
foreach ($items as $item) {
|
||||
$item->hideicon = true;
|
||||
|
||||
Reference in New Issue
Block a user