I'm calling a new script from a block. Inside the 'standard' block $COURSE is defined but in my new script is (not surprisingly) isn't. This is breaking the call to build_navigation().
Anyway... what's the proper way of getting this created? I'm passing the course id to the script so do I 'just' create it (from the course's db record) or is there something more subtle to be done?
Either require_login, or course_setup if you don't need to check that the user is logged in.
Ahh... that's why require_login takes the courseid as a parameter.
Completely obvious when you know
Thanks!!
Completely obvious when you know
Thanks!!
Well, require_login also checks whether the course is visible, and if not checks that the user can see hidden courses. And there are a bunch of other checks done too if you pass a $cm.
The curse of function feature creep dare I say...
require_login_and_optional_do_loads_of_checks_on_the_course();