]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12336 Inconsistent naming of the Front page area of the question bank, and the...
authortjhunt <tjhunt>
Fri, 5 Sep 2008 04:06:17 +0000 (04:06 +0000)
committertjhunt <tjhunt>
Fri, 5 Sep 2008 04:06:17 +0000 (04:06 +0000)
lib/accesslib.php

index 34771f5d3f5c6a038878344fb8c3f1a79ea7432c..6c7ca44fb371cb65388d30a78997519f3502e05b 100755 (executable)
@@ -3278,20 +3278,19 @@ function print_context_name($context, $withprefix = true, $short = false) {
             break;
 
         case CONTEXT_COURSE: // 1 to 1 to course cat
-            if ($course = $DB->get_record('course', array('id'=>$context->instanceid))) {
-                if ($withprefix){
-                    if ($context->instanceid == SITEID) {
-                        $name = get_string('site').': ';
-                    } else {
+            if ($context->instanceid == SITEID) {
+                $name = get_string('frontpage', 'admin');
+            } else {
+                if ($course = $DB->get_record('course', array('id'=>$context->instanceid))) {
+                    if ($withprefix){
                         $name = get_string('course').': ';
                     }
+                    if (!$short){
+                        $name .= format_string($course->shortname);
+                    } else {
+                        $name .= format_string($course->fullname);
+                   }
                 }
-                if ($short){
-                    $name .=format_string($course->shortname);
-                } else {
-                    $name .=format_string($course->fullname);
-               }
-
             }
             break;