Skip to content

Commit

Permalink
MDL-46107 badges: Fix badges navigation and remove empty breadcrumbs …
Browse files Browse the repository at this point in the history
…on pages using Clean

Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
  • Loading branch information
Yuliya Bozhko committed Jun 27, 2014
1 parent 7a4832e commit d9fe7db
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
11 changes: 10 additions & 1 deletion badges/badge.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,16 @@
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);
}

Expand Down
8 changes: 8 additions & 0 deletions badges/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@

$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();

Expand Down
3 changes: 3 additions & 0 deletions theme/bootstrapbase/renderers/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public function notification($message, $classes = 'notifyproblem') {
*/
public function navbar() {
$items = $this->page->navbar->get_items();
if (empty($items)) {
return '';
}
$breadcrumbs = array();
foreach ($items as $item) {
$item->hideicon = true;
Expand Down

0 comments on commit d9fe7db

Please sign in to comment.