My courses Block

My courses Block

by Cory B -
Number of replies: 2
The courses block will show all courses for an admin users even if the setting "block_course_list_adminview" is set to "admin sees own courses". This is because this block will display the full list of courses if a user is not enrolled in any courses.

line 50 of block_course_list.php looks like this:
if ($this->content->items) { // make sure we don't return an empty list

Changing it to:
if ($this->content->items || ( isadmin() and !$adminseesall )  ){

Would cause the module to return a blank list for an administrator user who is not enrolled in any courses. This behavior is preferable in my case since we have 1500 courses and loading the list every time I go to a course page takes too long.

A better solution would be to add an option to this block to allow blank lists when a user isn't enrolled in any courses. This would negate the need for my patch above.

Any thoughts?

Average of ratings: -
In reply to Cory B

Re: My courses Block

by Darren Smith -
An 'admin sees no courses' would be a nice option to include.

As we are talking course block I had this idea which would save screen estate, improve navigation (IMHO) and offer an additional function .....

Attachment 001.jpg