what am i doing wrong?
You are not doing anything wrong. Global glossary means the entries are autolinked in every course. It doesn't mean every site user is entitled to view / add to the glossary. This is a pity. I was also looking for a way to have a sitewide link collection (stored in a glossary).
The code of the glossary module is not to blame. All modules are specific to courses. Some possible workarounds I can think of:
Use the nice import/export feature of the glossary module to add entries to different courses.
Use the so called metacourse functionality to aasign all users of certain courses autoamtically to a metacourse in which the glossary resides.
Maybe other people know other solutions
the meta course idea sounds interesting, i might use it when something more than a glossary crops up that i want to use site wide.
in the meantime i did find a workaround that might be a way for your sitewide link collection as well.
1. i added a global glossary in the main menu on the starting page, so it's not assinged to any specific course but to the whole page.
2. i just put a weblink to that glossary in the topmost box of each course.
it's a pity the glossary block showing a random entry doesn't work that way, so i just don't display it anymore.
Interested in your solution. Are students allowed to add entries to this global glossary?
You can choose to allow displaying of all glossaries in the random glossary entry block by changing these lines in
// select glossaries to put in dropdown box ... $glossaries = get_records_select_menu('glossary', 'course='.$this->course->id,'name','id,name');
// select glossaries to put in dropdown box ... $glossaries = get_records_select_menu('glossary','','name','id,name');
Be careful with this hack: now every theacher has access to all glossaries in all courses, even the hidden ones.
everything works they way it looks (even if moodle says, students are not allowed to add entries to a main glossary). means: students are allowed to add, but need my approval, auto linking works around all the courses - could be a way for your link collection.
hope it helps you.
and thx for the php hack, i'll look into it.
Maybe something like this in the options, Is this gossary global (or whatever it was called): Yes, then if Yes have a dropdown that shows the other glossaries and you can choose which one the current glossary shares its content with.
I'm going to see if I can get something figured out using your block and the hack you posted above, but I'm still afraid that when students click on a link in the block they will leave that course and go to the course where the glossary resides. I'll have to check into it.
I'm still afraid that when students click on a link in the block they will leave that course and go to the course where the glossary resides.
That's exactly how it works, and it is what prevented me from adding global glossaries to the random glossary entry block in the first place. The hack is merely ... a hack.
I really can't see a way to make a glossary truly shared by all courses. AFAIK every activity in Moodle is restricted to the course in which it resides. There is no easy way to overcome this because it's the way Moodle core code works. It's a real pity. I can see lots of uses for resources and activities that can be shared across different courses.
Any better ideas? (as I don't want to hack )
Did I miss a step?