diff -ruN moodle-1.7/blocks/course_list/block_course_list.php moodle-dev/blocks/course_list/block_course_list.php --- moodle-1.7/blocks/course_list/block_course_list.php 2006-09-29 03:00:48.000000000 +0100 +++ moodle-dev/blocks/course_list/block_course_list.php 2006-10-02 20:06:29.000000000 +0100 @@ -19,11 +19,24 @@ return $this->content; } + $hiddentoguests = false; + + if (isset($CFG->block_course_list_hiddentoguests) ){ + if ( $CFG->block_course_list_hiddentoguests == '1' ){ + $hiddentoguests = true; + } + } + $this->content = new stdClass; $this->content->items = array(); $this->content->icons = array(); $this->content->footer = ''; + // hide courses to those not loogged in + if ( $hiddentoguests && ( !isset($USER->id) || isguest() ) ){ + return $this->content; + } + $icon = "pixpath/i/course.gif\"". " height=\"16\" width=\"16\" alt=\"".get_string("course")."\" />"; diff -ruN moodle-1.7/blocks/course_list/config_global.html moodle-dev/blocks/course_list/config_global.html --- moodle-1.7/blocks/course_list/config_global.html 2005-02-08 18:32:59.000000000 +0000 +++ moodle-dev/blocks/course_list/config_global.html 2006-10-02 20:12:24.000000000 +0100 @@ -4,14 +4,21 @@ @@ -20,6 +27,33 @@ + + block_course_list_hiddentoguests: + + + + + + + + " /> diff -ruN moodle-1.7/lang/en_utf8/block_course_list.php moodle-dev/lang/en_utf8/block_course_list.php --- moodle-1.7/lang/en_utf8/block_course_list.php 2006-02-06 09:28:54.000000000 +0000 +++ moodle-dev/lang/en_utf8/block_course_list.php 2006-10-02 19:58:20.000000000 +0100 @@ -4,5 +4,8 @@ $string['allcourses'] = 'Admin user sees all courses'; $string['configadminview'] = 'What should the admin see in the course list block?'; $string['owncourses'] = 'Admin user sees own courses'; +$string['hiddentoguests_explanation'] = 'Should guests be able to see the course list block?'; +$string['visibletoguests'] = 'Block is visible to guests'; +$string['hiddentoguests'] = 'Block is hidden to guests'; ?>