From fb6e87f37366fde640eb905ac8053ed4a99d8ac0 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 26 Feb 2007 08:52:38 +0000 Subject: [PATCH] Merged additions from stable --- blocks/course_list/block_course_list.php | 19 ++++++++++++++----- blocks/course_list/config_global.html | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/blocks/course_list/block_course_list.php b/blocks/course_list/block_course_list.php index b68b5b6407..df9b145ec4 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 91d9c298db..5e1b61406e 100644 --- a/blocks/course_list/config_global.html +++ b/blocks/course_list/config_global.html @@ -20,6 +20,26 @@ + + block_course_list_hideallcourseslink: + + + + + + + " /> -- 2.39.5