MyCourses Block: How do you remove 'enrol in another course'

MyCourses Block: How do you remove 'enrol in another course'

by Ruth Clark -
Number of replies: 4

Hi

Is there any way to remove the 'Enrol in another course' link from the 'Mycourses' block?

I am using Moddle 1.8.

Thanks

Ruth

Average of ratings: -
In reply to Ruth Clark

Re: MyCourses Block: How do you remove 'enrol in another course'

by A. T. Wyatt -
Greetings, Ruth!

I believe I just did the same thing a couple of days ago. I put something like "see other courses". I can't get on that computer right now, because it was a local install and my children are playing games smile, but I think you might try editing the language file that comes with the block.

atw
In reply to A. T. Wyatt

Re: MyCourses Block: How do you remove 'enrol in another course'

by Ruth Clark -

Hi!

If possible I'd like to remove the link completely as I don't want the students to see any other courses than those they are enrolled in.

Is this possible?

Ruth

In reply to Ruth Clark

Re: MyCourses Block: How do you remove 'enrol in another course'

by Dave Kichler -
Hi Ruth,
I actually just finished resolving this issue for myself. I assume you are referring to the third-party MyCourses block and not the standard Course block. Removing the 'Enrol in another course' link is possible but only through editing the code manually, not through any setting/option available through the interface. Luckily, in case your not a coding whiz, the modification is a very simple one. If you navigate to the directory containing the files that determine how the block is generated (should be /moodlehome/blocks/myCourse/HTML_TreeMenu-1.2.0) there will be a file there called TreeMenu.php. Open this file and make the following changes:

on line 659, you can either comment out or delete this line all together, it is simply retrieving the string to display as the link.
on line 660, the link code is appended to the $html var which gets printed as content. You can remove the link by deleting the link and center tags which look like this:
<center><a href=\"CFG->wwwroot course \">$enrol</a></center>
be sure not to delete the quote and semicolon at the end of the line which closes the string to be appended to $html

This will remove the 'Enrol in another course link'
In reply to Dave Kichler

Re: MyCourses Block: How do you remove 'enrol in another course'

by Ruth Clark -

Thank you very much Dave.

That has worked a treat!

Ruth