From b90052f25348aa63ba738ff129dce94273836ba1 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Fri, 19 Jan 2007 07:54:41 +0000 Subject: [PATCH] mnet: fix logic and html layout in block_course_list --- blocks/course_list/block_course_list.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) 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'); } -- 2.39.5