From: martinlanghoff Date: Fri, 19 Jan 2007 07:54:41 +0000 (+0000) Subject: mnet: fix logic and html layout in block_course_list X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b90052f25348aa63ba738ff129dce94273836ba1;p=moodle.git mnet: fix logic and html layout in block_course_list --- diff --git a/blocks/course_list/block_course_list.php b/blocks/course_list/block_course_list.php index 95bea22d44..87608ab3b7 100644 --- a/blocks/course_list/block_course_list.php +++ b/blocks/course_list/block_course_list.php @@ -65,8 +65,10 @@ class block_course_list extends block_list { $this->content->items[]="wwwroot/course/category.php?id=$category->id\">$category->name"; $this->content->icons[]=$icon; } - $this->content->footer = "wwwroot/course/\">".get_string("searchcourses")."...
". - "wwwroot/course/index.php\">".get_string("fulllistofcourses")."..."; + $this->content->icons[] = ''; + $this->content->items[] = "   wwwroot/course/\">".get_string("searchcourses")."...
"; + $this->content->icons[] = ''; + $this->content->items[] = "   wwwroot/course/index.php\">".get_string("fulllistofcourses")."..."; $this->title = get_string('categories'); } else { // Just print course names of single category $category = array_shift($categories); @@ -79,17 +81,18 @@ class block_course_list extends block_list { "href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname"; $this->content->icons[]=$icon; } - $this->content->footer = "wwwroot/course/index.php\">".get_string("fulllistofcourses")."..."; + $this->content->icons[] = ''; + $this->content->items[] = "   wwwroot/course/index.php\">".get_string("fulllistofcourses")."..."; $this->get_remote_courses(); } else { - if ($this->get_remote_courses()) { - $this->content->items = array(); - $this->content->icons = array(); - $this->content->footer = get_string('nocoursesyet').'

'; - if (has_capability('moodle/course:create', get_context_instance(CONTEXT_COURSECAT, $category->id))) { - $this->content->footer .= ''.get_string("addnewcourse").'...'; - } + + $this->content->icons[] = ''; + $this->content->items[] = get_string('nocoursesyet'); + if (has_capability('moodle/course:create', get_context_instance(CONTEXT_COURSECAT, $category->id))) { + $this->content->icons[] = ''; + $this->content->items[] = '   '.get_string("addnewcourse").'...'; } + $this->get_remote_courses(); } $this->title = get_string('courses'); }