]> git.mjollnir.org Git - moodle.git/commitdiff
When getting lists of roles, put role names through format_string
authormoodler <moodler>
Sat, 23 Sep 2006 12:46:53 +0000 (12:46 +0000)
committermoodler <moodler>
Sat, 23 Sep 2006 12:46:53 +0000 (12:46 +0000)
(ie for multilang filter)

lib/accesslib.php
lib/weblib.php

index 0d5932a497c0066d97a685ca45bc79c3379dc684..a459e1aa4dd96ee1552ac9081019d969bfaf52ac 100755 (executable)
@@ -2476,7 +2476,7 @@ function get_assignable_roles ($context) {
     if ($roles = get_records('role', '', '', 'sortorder ASC')) {
         foreach ($roles as $role) {
             if (user_can_assign($context, $role->id)) {
-                $options[$role->id] = $role->name;
+                $options[$role->id] = strip_tags(format_string($role->name, true));
             }
         }
     }
@@ -2495,7 +2495,7 @@ function get_overridable_roles ($context) {
     if ($roles = get_records('role', '', '', 'sortorder ASC')) {
         foreach ($roles as $role) {
             if (user_can_override($context, $role->id)) {
-                $options[$role->id] = $role->name;
+                $options[$role->id] = strip_tags(format_string($role->name, true));
             }
         }
     }
@@ -2798,4 +2798,4 @@ function get_users_from_role_on_context($role, $context) {
                                   AND roleid = $role->id");
 }
 
-?>
\ No newline at end of file
+?>
index 633d1ef7effc425ac6bc6a4a5e074911641eed81..3e2cbb7423bf1131ade9ba70231ef5b358c5f618 100644 (file)
@@ -1424,7 +1424,7 @@ function text_format_name( $key ) {
  */
 function format_string ($string, $striplinks = false, $courseid=NULL ) {
 
-    global $CFG, $course;
+    global $CFG, $COURSE;
 
     //We'll use a in-memory cache here to speed up repeated strings
     static $strcache;
@@ -1438,8 +1438,8 @@ function format_string ($string, $striplinks = false, $courseid=NULL ) {
     }
 
     if (empty($courseid)) {
-        if (!empty($course->id)) {         // An ugly hack for better compatibility
-            $courseid = $course->id;       // (copied from format_text)
+        if (!empty($COURSE->id)) {         // An ugly hack for better compatibility
+            $courseid = $COURSE->id;       // (copied from format_text)
         }
     }