Skip to content

Commit

Permalink
MDL-38320 fix role name display when roles switched
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Mar 17, 2013
1 parent 29f8c09 commit 54aabc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/outputrenderers.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ public function login_info($withlinks = null) {
} else if (is_role_switched($course->id)) { // Has switched roles
$rolename = '';
if ($role = $DB->get_record('role', array('id'=>$USER->access['rsw'][$context->path]))) {
$rolename = ': '.format_string($role->name);
$rolename = ': '.role_get_name($role, $context);
}
$loggedinas = get_string('loggedinas', 'moodle', $username).$rolename;
if ($withlinks) {
Expand Down
2 changes: 1 addition & 1 deletion theme/mymobile/renderers.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public function login_info_footer() {
} else if (is_role_switched($course->id)) { // Has switched roles
$rolename = '';
if ($role = $DB->get_record('role', array('id'=>$USER->access['rsw'][$context->path]))) {
$rolename = ': '.format_string($role->name);
$rolename = ': '.role_get_name($role, $context);
}
$loggedinas = get_string('loggedinas', 'moodle', $username).$rolename." (<a href=\"$CFG->wwwroot/course/view.php?id=$course->id&amp;switchrole=0&amp;sesskey=".sesskey()."\">".get_string('switchrolereturn').'</a>)';
} else {
Expand Down

0 comments on commit 54aabc8

Please sign in to comment.