Hi
I am beginning to code my groupware module for moodle, and I have been going through the code trying to find out how to obtain information about the current course, user, instance of my module etc.
I have got as far as:-
course->id = ID of course user is in
groupware->id = ID of Instance of my module user is in
But I require some other information like the ID of the current user etc...
Is there a particular file I should be looking in for this information? I have looked in moodle, datalib etc, but cannot find the right information.
I am presuming there are some class files that I can look through to find out the
data the classes store? There seems to be an instance of a course and groupware class I can read information from, is there also an instance of the user class for the current user?
Many thanks,
Chris.
Update I found the user object, it was USER, capitalised
I got this from line 23 of the index.php file for the main site:-
if (empty($USER->id))
Any guidance about where to find these things without hunting through code would be fantastic.
Many thanks,
chris.
I got this from line 23 of the index.php file for the main site:-
if (empty($USER->id))
Any guidance about where to find these things without hunting through code would be fantastic.
Many thanks,
chris.
The coding guidelines will be helpful to you I think.
There are four global environment objects: $CFG, $SESSION, $THEME and $USER
There are four global environment objects: $CFG, $SESSION, $THEME and $USER
Thanks Martin. I was following these, but these globals were presented as something not to extend, not something people should use. Though as a PHP programmer, I should I suppose have simply seen these and print_r'd them to find out more.
Aside from the wiki, where is the best place I can contribute more developer documentation to? or is this wiki the right place? it seems to be infrequently updated, so I wondered if some other document repository has superceeded it?
Many thanks,
Chris.
Aside from the wiki, where is the best place I can contribute more developer documentation to? or is this wiki the right place? it seems to be infrequently updated, so I wondered if some other document repository has superceeded it?
Many thanks,
Chris.
Please keep asking questions Chris. Although I have not posted before, I am learning a lot watching this thread and the other threads about your project.
WP1
WP1
Are you developing a new module as well? I've found it difficult to get into, but now have most of the answers I need I think. I will produce some developer docs to further help new module developers soon.
If you think I can answer any questions to you, as someone who has now suceeded in creating a basic module, please post, and I'll reply.
Many thanks,
Chris.
If you think I can answer any questions to you, as someone who has now suceeded in creating a basic module, please post, and I'll reply.
Many thanks,
Chris.