Hi All,
I am now able to get the course administration menu.
I had already set page
context to the current course using code
$PAGE->set_context($currContext);
I set newly,
$PAGE->set_course($courserecord);
wherein $courserecord is obtained as :
global $DB;
$courserecord = $DB->get_record('course', array('id' => $currCourseid), '*', MUST_EXIST);
We can do
require_login($courserecord);
without which also the course administration is visible, but if we require login for the course, I think we need to place require login.
If i did require_login($courserecord);, $PAGE->set_course($courserecord); was not needed.
Also, $currContext is obtained by
$currCourseid = optional_param( 'id',0,PARAM_INT );
$currContext = context_course::instance($currCourseid);
The parameter to this page in local plugin is obtained using
the following line in the lib file of the local plugin where we are
adding new menu item :
$clManageHpsUrl = new moodle_url( '/local/hps/cl_manage_hps.php',array('id' => $PAGE->course->id) );
Regards.
Hi Richard,
If you reading this, I pledge not to spoil the forum spirit again.
My hurry and desperation are because I am very new to moodle without proper training yet have to complete this by tomorrow. Mine is a small company doing first moodle project.
Thanks & Regards.