Permalink
Browse files

mnet: fix logic and html layout in block_course_list

  • Loading branch information...
1 parent a819a51 commit b90052f25348aa63ba738ff129dce94273836ba1 martinlanghoff committed Jan 19, 2007
Showing with 13 additions and 10 deletions.
  1. +13 −10 blocks/course_list/block_course_list.php
@@ -65,8 +65,10 @@ function get_content() {
$this->content->items[]="<a $linkcss href=\"$CFG->wwwroot/course/category.php?id=$category->id\">$category->name</a>";
$this->content->icons[]=$icon;
}
- $this->content->footer = "<a href=\"$CFG->wwwroot/course/\">".get_string("searchcourses")."</a>...<br />".
- "<a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
+ $this->content->icons[] = '';
+ $this->content->items[] = "&nbsp;&nbsp;&nbsp;<a href=\"$CFG->wwwroot/course/\">".get_string("searchcourses")."</a>...<br />";
+ $this->content->icons[] = '';
+ $this->content->items[] = "&nbsp;&nbsp;&nbsp;<a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
$this->title = get_string('categories');
} else { // Just print course names of single category
$category = array_shift($categories);
@@ -79,17 +81,18 @@ function get_content() {
"href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
$this->content->icons[]=$icon;
}
- $this->content->footer = "<a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
+ $this->content->icons[] = '';
+ $this->content->items[] = "&nbsp;&nbsp;&nbsp;<a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
$this->get_remote_courses();
} else {
- if ($this->get_remote_courses()) {
- $this->content->items = array();
- $this->content->icons = array();
- $this->content->footer = get_string('nocoursesyet').'<br /><br />';
- if (has_capability('moodle/course:create', get_context_instance(CONTEXT_COURSECAT, $category->id))) {
- $this->content->footer .= '<a href="'.$CFG->wwwroot.'/course/edit.php?category='.$category->id.'">'.get_string("addnewcourse").'</a>...';
- }
+
+ $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[] = '&nbsp;&nbsp;&nbsp;<a href="'.$CFG->wwwroot.'/course/edit.php?category='.$category->id.'">'.get_string("addnewcourse").'</a>...';
}
+ $this->get_remote_courses();
}
$this->title = get_string('courses');
}

0 comments on commit b90052f

Please sign in to comment.