Local plugin adding course administration menu item : Display Course administration Menu

Local plugin adding course administration menu item : Display Course administration Menu

by Bhargava S -
Number of replies: 5

Hi,

I am creating a local plugin which adds a menu item to course administration.

I am able to add the new menu item, but on click of that link when the flow goes to a page ( in that local plugin ) , course administration is not available at the left.


How to display the course administration block ( and have that block open ) ?


Please help.


Average of ratings: -
In reply to Bhargava S

Re: Local plugin adding course administration menu item : Display Course administration Menu

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

No Bhargava, you are right I did not appreciate being personally messaged about a random forum thread that I have no knowledge about or information to share. Please do not do it in future.

There are sufficient members and experts on the forum so that those people who have information to share about your post will do so - and will be the people who generally know what they are talking about. Randomly sending personal messages to community member is not going to get your thread answered any quicker but is more likely to annoy the people you message.

I had already seen this thread, I have nothing to contribute towards it, therefore I had not responded. Sending a PM is not going to change that fact. The community is a very helpful and friendly place to get support - but that support comes from people who volunteer their time and knowledge where they feel they have something to contribute - I don't in this case. If I did, I already would have regardless of being PM'd by the poster.

PMs are a useful tool, but should not be abused in that way.

Average of ratings: Useful (1)
In reply to Richard Oelmann

Re: Local plugin adding course administration menu item : Display Course administration Menu

by Bhargava S -

Aplogies again, i PMed in distress of not having answer, apologies again, i hope i get some reply on this thread.

Regards.

In reply to Bhargava S

Re: Local plugin adding course administration menu item : Display Course administration Menu

by Bhargava S -

I had PMed "Davo Smith" also , so apologies to hiim also. sad

In reply to Bhargava S

Re: Local plugin adding course administration menu item : Display Course administration Menu

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

I also hope you get the appropriate support from someone with that info and expertise - but a PM in 'desperation' after only about 12 hours on a Friday night-Saturday morning (in Europe at least - and that's where both myself and Davo are based) and heading into a weekend... ;)

Like I said, its a very friendly and helpful community and I'm sure someone will come along with some suggestions for you, but weekends do tend to be quieter, so you may have to be a little bit patient smile

Sorry I'm not the person with that expertise in this area to be able to provide that support.

In reply to Richard Oelmann

Re: Local plugin adding course administration menu item : Display Course administration Menu

by Bhargava S -
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.