|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| __construct (moodle_page &$page) | |
| initialise () | |
| add ($text, $url=null, $type=null, $shorttext=null, $key=null, pix_icon $icon=null) | |
| prepend ($text, $url=null, $type=null, $shorttext=null, $key=null, pix_icon $icon=null) | |
| extend_for_user ($userid) | |
| clear_cache () | |
Protected Member Functions | |
| load_administration_settings (navigation_node $referencebranch=null, part_of_admin_tree $adminbranch=null) | |
| scan_for_active_node (navigation_node $node) | |
| get_by_path (array $path) | |
| get_course_modules ($course) | |
| load_course_settings ($forceopen=false) | |
| add_course_editing_links ($course) | |
| load_module_settings () | |
| load_user_settings ($courseid=SITEID) | |
| generate_user_settings ($courseid, $userid, $gstitle='usercurrentsettings') | |
| load_block_settings () | |
| load_category_settings () | |
| in_alternative_role () | |
| load_front_page_settings ($forceopen=false) | |
Protected Attributes | |
| $context | |
| $page | |
| $adminsection | |
| $initialised = false | |
| $userstoextendfor = array() | |
| $cache | |
Definition at line 2825 of file navigationlib.php.
| __construct | ( | moodle_page &$ | page | ) |
Sets up the object with basic settings and preparse it for use
| moodle_page | $page |
Definition at line 2844 of file navigationlib.php.

| add | ( | $ | text, |
| $ | url = null, |
||
| $ | type = null, |
||
| $ | shorttext = null, |
||
| $ | key = null, |
||
| pix_icon $ | icon = null |
||
| ) |
Override the parent function so that we can add preceeding hr's and set a root node class against all first level element
It does this by first calling the parent's add method navigation_node::add() and then proceeds to use the key to set class and hr
| string | $text | |
| sting | moodle_url | $url | |
| string | $shorttext | |
| string | int | $key | |
| int | $type | |
| string | $icon |
Reimplemented from navigation_node.
Definition at line 2953 of file navigationlib.php.

| add_course_editing_links | ( | $ | course | ) | [protected] |
Adds branches and links to the settings navigation to add course activities and resources.
| stdClass | $course |
Definition at line 3324 of file navigationlib.php.

| clear_cache | ( | ) |
This function marks the cache as volatile so it is cleared during shutdown
Definition at line 3983 of file navigationlib.php.
| extend_for_user | ( | $ | userid | ) |
Extends the settings navigation for the given user.
Note: This method gets called automatically if you call $PAGE->navigation->extend_for_user($userid)
| int | $userid |
Definition at line 3555 of file navigationlib.php.
| generate_user_settings | ( | $ | courseid, |
| $ | userid, | ||
| $ | gstitle = 'usercurrentsettings' |
||
| ) | [protected] |
This function gets called by load_user_settings() and actually works out what can be shown/done
moodle_database $DB
| int | $courseid | The current course' id |
| int | $userid | The user id to load for |
| string | $gstitle | The string to pass to get_string for the branch title |
Definition at line 3585 of file navigationlib.php.

| get_by_path | ( | array $ | path | ) | [protected] |
Gets a navigation node given an array of keys that represent the path to the desired node.
| array | $path |
Definition at line 3085 of file navigationlib.php.
| get_course_modules | ( | $ | course | ) | [protected] |
Generate the list of modules for the given course.
| stdClass | $course | The course to get modules for |
Definition at line 3098 of file navigationlib.php.

| in_alternative_role | ( | ) | [protected] |
Determine whether the user is assuming another role
This function checks to see if the user is assuming another role by means of role switching. In doing this we compare each RSW key (context path) against the current context path. This ensures that we can provide the switching options against both the course and any page shown under the course.
Definition at line 3896 of file navigationlib.php.
| initialise | ( | ) |
Initialise the settings navigation based on the current context
This function initialises the settings navigation tree for a given context by calling supporting functions to generate major parts of the tree.
Definition at line 2863 of file navigationlib.php.

| load_administration_settings | ( | navigation_node $ | referencebranch = null, |
| part_of_admin_tree $ | adminbranch = null |
||
| ) | [protected] |
Load the site administration tree
This function loads the site administration tree by using the lib/adminlib library functions
| navigation_node | $referencebranch | A reference to a branch in the settings navigation tree |
| part_of_admin_tree | $adminbranch | The branch to add, if null generate the admin tree and start at the beginning |
Definition at line 2992 of file navigationlib.php.


| load_block_settings | ( | ) | [protected] |
Loads block specific settings in the navigation
Definition at line 3800 of file navigationlib.php.


| load_category_settings | ( | ) | [protected] |
Loads category specific settings in the navigation
Definition at line 3829 of file navigationlib.php.


| load_course_settings | ( | $ | forceopen = false | ) | [protected] |
This function loads the course settings that are available for the user
| bool | $forceopen | If set to true the course node will be forced open |
Definition at line 3149 of file navigationlib.php.


| load_front_page_settings | ( | $ | forceopen = false | ) | [protected] |
This function loads all of the front page settings into the settings navigation. This function is called when the user is on the front page, or $COURSE==$SITE
Definition at line 3916 of file navigationlib.php.


| load_module_settings | ( | ) | [protected] |
This function calls the module function to inject module settings into the settings navigation tree.
This only gets called if there is a corrosponding function in the modules lib file.
For examples mod/forum/lib.php ::: forum_extend_settings_navigation()
Definition at line 3415 of file navigationlib.php.


| load_user_settings | ( | $ | courseid = SITEID | ) | [protected] |
Loads the user settings block of the settings nav
This function is simply works out the userid and whether we need to load just the current users profile settings, or the current user and the user the current user is viewing.
This function has some very ugly code to work out the user, if anyone has any bright ideas please feel free to intervene.
| int | $courseid | The course id of the current course |
Definition at line 3511 of file navigationlib.php.


| prepend | ( | $ | text, |
| $ | url = null, |
||
| $ | type = null, |
||
| $ | shorttext = null, |
||
| $ | key = null, |
||
| pix_icon $ | icon = null |
||
| ) |
This function allows the user to add something to the start of the settings navigation, which means it will be at the top of the settings navigation block
| string | $text | |
| sting | moodle_url | $url | |
| string | $shorttext | |
| string | int | $key | |
| int | $type | |
| string | $icon |
Definition at line 2971 of file navigationlib.php.

| scan_for_active_node | ( | navigation_node $ | node | ) | [protected] |
This function recursivily scans nodes until it finds the active node or there are no more nodes.
| navigation_node | $node |
Definition at line 3070 of file navigationlib.php.


$adminsection [protected] |
Definition at line 2831 of file navigationlib.php.
$cache [protected] |
Definition at line 2837 of file navigationlib.php.
$context [protected] |
Definition at line 2827 of file navigationlib.php.
$initialised = false [protected] |
Definition at line 2833 of file navigationlib.php.
$page [protected] |
Definition at line 2829 of file navigationlib.php.
$userstoextendfor = array() [protected] |
Definition at line 2835 of file navigationlib.php.