Index: theme/standard/styles_fonts.css
===================================================================
RCS file: /cvsroot/moodle/moodle/theme/standard/styles_fonts.css,v
retrieving revision 1.140
diff -u -r1.140 styles_fonts.css
--- theme/standard/styles_fonts.css 9 Oct 2007 16:56:00 -0000 1.140
+++ theme/standard/styles_fonts.css 16 Oct 2007 14:15:49 -0000
@@ -251,6 +251,7 @@
}
#admin-roles-override .cell.c1,
+#admin-roles-assign .cell.c3,
#admin-roles-assign .cell.c1 {
font-size: 0.7em;
}
Index: theme/standard/styles_layout.css
===================================================================
RCS file: /cvsroot/moodle/moodle/theme/standard/styles_layout.css,v
retrieving revision 1.516.2.2
diff -u -r1.516.2.2 styles_layout.css
--- theme/standard/styles_layout.css 12 Oct 2007 08:50:00 -0000 1.516.2.2
+++ theme/standard/styles_layout.css 16 Oct 2007 14:15:50 -0000
@@ -992,6 +992,7 @@
}
#admin-roles-override .cell.c1,
+#admin-roles-assign .cell.c3,
#admin-roles-assign .cell.c1 {
padding-top: 0.75em;
}
Index: admin/roles/assign.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/roles/assign.php,v
retrieving revision 1.63
diff -u -r1.63 assign.php
--- admin/roles/assign.php 9 Oct 2007 12:49:57 -0000 1.63
+++ admin/roles/assign.php 16 Oct 2007 14:15:49 -0000
@@ -6,6 +6,7 @@
require_once($CFG->libdir.'/adminlib.php');
define("MAX_USERS_PER_PAGE", 5000);
+ define("MAX_USERS_TO_LIST_PER_ROLE", 10);
$contextid = required_param('contextid',PARAM_INT); // context id
$roleid = optional_param('roleid', 0, PARAM_INT); // required role id
@@ -417,14 +418,25 @@
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '60%';
- $table->head = array(get_string('roles', 'role'), get_string('description'), get_string('users'));
- $table->wrap = array('nowrap', '', 'nowrap');
- $table->align = array('right', 'left', 'center');
+ $table->head = array(get_string('roles', 'role'), get_string('description'), get_string('users'), '');
+ $table->wrap = array('nowrap', '', 'nowrap', 'nowrap');
+ $table->align = array('right', 'left', 'center', 'left');
foreach ($assignableroles as $roleid => $rolename) {
$countusers = count_role_users($roleid, $context);
+ $strroleusers = '';
+ if (0 < $countusers && $countusers <= MAX_USERS_TO_LIST_PER_ROLE) {
+ $roleusers = get_role_users($roleid, $context, false, 'u.id, u.lastname, u.firstname');
+ if (!empty($roleusers)) {
+ $strroleusers = array();
+ foreach ($roleusers as $user) {
+ $strroleusers[] = fullname($user);
+ }
+ $strroleusers = implode('
', $strroleusers);
+ }
+ }
$description = format_string(get_field('role', 'description', 'id', $roleid));
- $table->data[] = array(''.$rolename.'',$description, $countusers);
+ $table->data[] = array(''.$rolename.'',$description, $countusers, $strroleusers);
}
print_table($table);