Merged additions from stable

This commit is contained in:
moodler
2007-02-26 08:52:38 +00:00
parent 42424a464b
commit fb6e87f373
2 changed files with 34 additions and 5 deletions
+14 -5
View File
@@ -49,7 +49,10 @@ class block_course_list extends block_list {
$this->content->icons[]=$icon;
}
$this->title = get_string('mycourses');
$this->content->footer = "<a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
/// If we can update any course of the view all isn't hidden, show the view all courses link
if (has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM)) || empty($CFG->block_course_list_hideallcourseslink)) {
$this->content->footer = "<a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
}
$this->get_remote_courses();
if ($this->content->items) { // make sure we don't return an empty list
return $this->content;
@@ -67,8 +70,11 @@ class block_course_list extends block_list {
}
$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>...";
/// If we can update any course of the view all isn't hidden, show the view all courses link
if (has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM)) || empty($CFG->block_course_list_hideallcourseslink)) {
$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);
@@ -81,8 +87,11 @@ class block_course_list extends block_list {
"href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
$this->content->icons[]=$icon;
}
$this->content->icons[] = '';
$this->content->items[] = "&nbsp;&nbsp;&nbsp;<a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
/// If we can update any course of the view all isn't hidden, show the view all courses link
if (has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM)) || empty($CFG->block_course_list_hideallcourseslink)) {
$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 {
+20
View File
@@ -20,6 +20,26 @@
<?php print_string("configadminview", "block_course_list") ?>
</td>
</tr>
<tr valign="top">
<td align="right">block_course_list_hideallcourseslink:</td>
<td>
<select name="block_course_list_hideallcourseslink">
<option value="1" <?php if(isset($CFG->block_course_list_allcourseslink)){
if($CFG->block_course_list_hideallcourseslink){ echo "selected=\"selected\"";}
}?>
><?php p(get_string('yes')) ?></option>
<option value="0" <?php if(isset($CFG->block_course_list_hideallcourseslink)){
if(!$CFG->block_course_list_hideallcourseslink){ echo "selected=\"selected\""; }
}else{
echo "selected=\"selected\"";
}?>
><?php p(get_string('no')) ?></option>
</select>
</td>
<td>
<?php print_string("confighideallcourseslink", "block_course_list") ?>
</td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="submit" value="<?php print_string("savechanges") ?>" /></td>