]> git.mjollnir.org Git - moodle.git/commitdiff
Use role sortorder when getting role lists
authormoodler <moodler>
Fri, 22 Sep 2006 01:21:01 +0000 (01:21 +0000)
committermoodler <moodler>
Fri, 22 Sep 2006 01:21:01 +0000 (01:21 +0000)
lib/accesslib.php

index 2d1c6a254c8fed2cb3b44b5d84ebd170fc7c1a65..bc2e5930a48cd11076a04b341c8f0a684e20163e 100755 (executable)
@@ -2427,7 +2427,7 @@ function get_assignable_roles ($context) {
 
     $options = array();
 
-    if ($roles = get_records('role')) {
+    if ($roles = get_records('role', '', '', 'sortorder ASC')) {
         foreach ($roles as $role) {
             if (user_can_assign($context, $role->id)) {
                 $options[$role->id] = $role->name;
@@ -2446,7 +2446,7 @@ function get_overridable_roles ($context) {
 
     $options = array();
 
-    if ($roles = get_records('role')) {
+    if ($roles = get_records('role', '', '', 'sortorder ASC')) {
         foreach ($roles as $role) {
             if (user_can_override($context, $role->id)) {
                 $options[$role->id] = $role->name;