I've been busy making some necessary code-hacks to our moodle installation. I'm stuck on one problem, which I'm not sure if it is a bug or needs a code modification.
This is predominantly for our main-menu block, but could be applicable in other areas. There is a checkbox that allows you to choose whether a resource is 'visible to students'. But when you set it to not-visible it also hides the resource for course creators. That is not the functionality that we need. We need them to be visible to admins AND course creators, but not students.
Unfortunately, I'm still getting used to the code-structure of moodle. I was hoping someone would have some good ideas as to which files/directories I might look in to amend this functionality. Or in other words, where does that visibility option get checked, so that I can throw in a 'course creator' option.
Thanks,
Mike.
Mike Mike
Should you wish to go for the hack, perhaps becuase you have already made various hacks and don't want to have to hack all over again, or just for interest's sake then...
The problem is that this "hidden" setting is spread around various parts of moodle.
For the main site menu see
moodle/blocks/site_main_menu/block_site_main_menu.php
around line 31
$isteacher = isteacher($this->instance->pageid);
which is used on around line 83
if ($mod->visible || $isteacher) {
I think that *perhaps*
$isteacher = iscoursecreator();
or *perhaps*
$isteacher = iscoursecreator($this->instance->pageid);
or, for all teachers
$isteacher = isteacherinanycourse();
may work, but I have not tried any of these.
I stress, that this is just out of interest, and it may well be better to upgrade to moodle 1.7 (which has roles, Ajax and lots more), and with all caveats about the dangers of hacking your moodle.
Timothy