MDL-10395:

Course managers are now displayed in the order that the user
selects in the Define Roles page.
This commit is contained in:
thepurpleblob 2007-07-17 14:07:56 +00:00
parent d717df34e0
commit e8513d2ca0

View File

@ -1783,15 +1783,17 @@ function print_course($course) {
/// first find all roles that are supposed to be displayed
if ($managerroles = get_config('', 'coursemanager')) {
$coursemanagerroles = split(',', $managerroles);
foreach ($coursemanagerroles as $roleid) {
$role = get_record('role','id',$roleid);
if ($users = get_role_users($roleid, $context, true, '', 'u.lastname ASC', true)) {
foreach ($users as $teacher) {
$fullname = fullname($teacher, has_capability('moodle/site:viewfullnames', $context));
$namesarray[] = role_get_name($role, $context).': <a href="'.$CFG->wwwroot.'/user/view.php?id='.
$roles = get_records_select( 'role', '', 'sortorder' );
foreach ($roles as $role) {
if (in_array( $role->id, $coursemanagerroles )) {
if ($users = get_role_users($role->id, $context, true, '', 'u.lastname ASC', true)) {
foreach ($users as $teacher) {
$fullname = fullname($teacher, has_capability('moodle/site:viewfullnames', $context));
$namesarray[] = role_get_name($role, $context).': <a href="'.$CFG->wwwroot.'/user/view.php?id='.
$teacher->id.'&amp;course='.SITEID.'">'.$fullname.'</a>';
}
}
}
}
}
}
if (!empty($namesarray)) {