diff --git a/blocks/course_list/block_course_list.php b/blocks/course_list/block_course_list.php
index b68b5b6407e..df9b145ec41 100644
--- a/blocks/course_list/block_course_list.php
+++ b/blocks/course_list/block_course_list.php
@@ -49,7 +49,10 @@ class block_course_list extends block_list {
$this->content->icons[]=$icon;
}
$this->title = get_string('mycourses');
- $this->content->footer = "wwwroot/course/index.php\">".get_string("fulllistofcourses")."...";
+ /// 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 = "wwwroot/course/index.php\">".get_string("fulllistofcourses")."...";
+ }
$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[] = " wwwroot/course/\">".get_string("searchcourses")."...
";
- $this->content->icons[] = '';
- $this->content->items[] = " wwwroot/course/index.php\">".get_string("fulllistofcourses")."...";
+ /// 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[] = " wwwroot/course/index.php\">".get_string("fulllistofcourses")."...";
+ }
$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";
$this->content->icons[]=$icon;
}
- $this->content->icons[] = '';
- $this->content->items[] = " wwwroot/course/index.php\">".get_string("fulllistofcourses")."...";
+ /// 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[] = " wwwroot/course/index.php\">".get_string("fulllistofcourses")."...";
+ }
$this->get_remote_courses();
} else {
diff --git a/blocks/course_list/config_global.html b/blocks/course_list/config_global.html
index 91d9c298db2..5e1b61406e2 100644
--- a/blocks/course_list/config_global.html
+++ b/blocks/course_list/config_global.html
@@ -20,6 +20,26 @@
+