course MDLSITE-972 Fixed course names names not being displayed on /course/
authorSam Hemelryk <sam@moodle.com>
Fri, 17 Sep 2010 08:49:19 +0000 (08:49 +0000)
committerSam Hemelryk <sam@moodle.com>
Fri, 17 Sep 2010 08:49:19 +0000 (08:49 +0000)
course/lib.php

index 8e95cc4..c1e0fe2 100644 (file)
@@ -2000,7 +2000,7 @@ function make_categories_options() {
  * Prints the category info in indented fashion
  * This function is only used by print_whole_category_list() above
  */
-function print_category_info($category, $depth, $showcourses = false) {
+function print_category_info($category, $depth=0, $showcourses = false) {
     global $CFG, $DB, $OUTPUT;
 
     $strsummary = get_string('summary');
@@ -2051,17 +2051,18 @@ function print_category_info($category, $depth, $showcourses = false) {
                     $linkcss = array('class'=>'dimmed');
                 }
 
-                $coursecontent = '';
                 $courselink = html_writer::link(new moodle_url('/course/view.php', array('id'=>$course->id)), format_string($course->fullname), $linkcss);
-                $coursecontent .= html_writer::tag('div', $courselink, array('class'=>'name'));
 
                 // print enrol info
+                $courseicon = '';
                 if ($icons = enrol_get_course_info_icons($course)) {
                     foreach ($icons as $pix_icon) {
-                        echo $OUTPUT->render($pix_icon);
+                        $courseicon = $OUTPUT->render($pix_icon).' ';
                     }
                 }
 
+                $coursecontent = html_writer::tag('div', $courseicon.$courselink, array('class'=>'name'));
+
                 if ($course->summary) {
                     $link = new moodle_url('/course/info.php?id='.$course->id);
                     $actionlink = $OUTPUT->action_link($link, '<img alt="'.$strsummary.'" src="'.$OUTPUT->pix_url('i/info') . '" />',
@@ -2072,7 +2073,7 @@ function print_category_info($category, $depth, $showcourses = false) {
                 }
 
                 $html = '';
-                for ($i=1; $i <= $depth; $i++) {
+                for ($i=0; $i <= $depth; $i++) {
                     $html = html_writer::tag('div', $html . $coursecontent , array('class'=>'indentation'));
                     $coursecontent = '';
                 }