Retrieve course list

Retrieve course list

napisao/la robert flook -
Broj odgovora: 11
Hi,

I have been tasked with putting together a new theme for moodle in my school. What I need to do is to populate a drop down menu with all the courses available which match a specific ID. It would seem that usually the category.php file displays this info, but I can't seem to find out if there is a function I can call to retrieve this data easily. I would rather not have to write some code if something else is already in place. Can anyone help here?

Many thanks

rob
Odgovor na robert flook

Re: Retrieve course list

napisao/la Jon Witts -
Slika Particularly helpful Moodlers Slika Plugin developers Slika Testers
What ID are trying to match them to?

I have just been writing a page for my Moodle that will display all courses which have guest access enabled. I will post it up when I finish it; it might point you in the right direction...

Jon
Odgovor na Jon Witts

Re: Retrieve course list

napisao/la Jon Witts -
Slika Particularly helpful Moodlers Slika Plugin developers Slika Testers
OK,

So here is the finished script... We are using guest access to get our parents to access information in our VLE and this script produces a list of all courses with guest access enabled... It is not very elegant but it does the job!

Jon
Odgovor na robert flook

Re: Retrieve course list

napisao/la Barry Oosthuizen -
Hi Robert,

The Course Category / Course Dropdown Navigation menu in the Beaux Theme (partly based on "a theme with automatic menus") might have something (in the topmenu.php file) that points you in the right direction as well.

Cheers,

Barry
Odgovor na Barry Oosthuizen

Re: Retrieve course list

napisao/la Tieku Bortei-Doku -

Barry,

How easy is it to incorporate the Beaux theme's menu in other Moodle Themes?

Tieku

Odgovor na Tieku Bortei-Doku

Re: Retrieve course list

napisao/la Barry Oosthuizen -
I found it pretty easy, though I do remember fiddling with it a bit at first.
Odgovor na Barry Oosthuizen

Re: Retrieve course list

napisao/la Tieku Bortei-Doku -
Can you outline the steps to incorporate the Beaux theme's menu in other Moodle Themes?
Odgovor na Barry Oosthuizen

Re: Retrieve course list

napisao/la Tieku Bortei-Doku -

Barry,

Why is the menu link in the Beaux theme going to:

domain.com/course/view.php?id=13

instead of

domain.com/moodle/course/view.php?id=13

for one of my courses?

Tieku

Odgovor na Tieku Bortei-Doku

Re: Retrieve course list

napisao/la Barry Oosthuizen -
Hi Tieku,

For the automatic menu, I based my theme on the 'A theme with automatic menus' and didn't spend too much time trying to perfect it. The culprit will be in the topmenu.php file.

To fix it, find all occurrences of $CFG->wwwroot and replace it with $CFG->webroot

Cheers,

Barry