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


Definition at line 928 of file navigationlib.php.
| __construct | ( | moodle_page $ | page | ) |
Constructs a new global navigation
| moodle_page | $page | The page this navigation object belongs to |
Reimplemented in exposed_global_navigation.
Definition at line 962 of file navigationlib.php.

| add_category | ( | stdClass $ | category, |
| navigation_node $ | parent | ||
| ) | [protected] |
Adds a structured category to the navigation in the correct order/place
| stdClass | $category | |
| navigation_node | $parent |
Definition at line 1534 of file navigationlib.php.


| add_course | ( | stdClass $ | course, |
| $ | forcegeneric = false, |
||
| $ | ismycourse = false |
||
| ) |
Adds the given course to the navigation structure.
| stdClass | $course |
Definition at line 2166 of file navigationlib.php.


| add_course_essentials | ( | $ | coursenode, |
| stdClass $ | course | ||
| ) |
Adds essential course nodes to the navigation for the given course.
This method adds nodes such as reports, blogs and participants
| navigation_node | $coursenode | |
| stdClass | $course |
Definition at line 2251 of file navigationlib.php.


| add_front_page_course_essentials | ( | navigation_node $ | coursenode, |
| stdClass $ | course | ||
| ) |
This generates the the structure of the course that won't be generated when the modules and sections are added.
Things such as the reports branch, the participants branch, blogs... get added to the course node by this method.
| navigation_node | $coursenode | |
| stdClass | $course |
Definition at line 2319 of file navigationlib.php.


| clear_cache | ( | ) |
Clears the navigation cache
Definition at line 2387 of file navigationlib.php.
| extend_for_user | ( | $ | user | ) |
Extends the navigation for the given user.
| stdClass | $user | A user from the database |
Definition at line 2148 of file navigationlib.php.
| find | ( | $ | key, |
| $ | type | ||
| ) |
Searches this nodes children and thier children to find a navigation node with the matching key and type.
This method is recursive and searches children so until either a node is found of there are no more nodes to search.
If you know that the node being searched for is a child of this node then use the {
Note: If you are trying to set the active node {
| string | int | $key | The key of the node you wish to receive. |
| int | $type | One of navigation_node::TYPE_* |
Reimplemented from navigation_node.
Definition at line 2461 of file navigationlib.php.
| format_display_course_content | ( | $ | format | ) | [protected] |
Checks the course format to see whether it wants the navigation to load additional information for the course.
This function utilises a callback that can exist within the course format lib.php file The callback should be a function called: callback_{formatname}_display_content() It doesn't get any arguments and should return true if additional content is desired. If the callback doesn't exist we assume additional content is wanted.
| string | $format | The course format |
Definition at line 1368 of file navigationlib.php.

| generate_sections_and_activities | ( | stdClass $ | course | ) | [protected] |
Generates an array of sections and an array of activities for the given course.
This method uses the cache to improve performance and avoid the get_fast_modinfo call
| stdClass | $course |
Definition at line 1608 of file navigationlib.php.


| get | ( | $ | key, |
| $ | type = null |
||
| ) |
Attempts to get the navigation with the given key from this nodes children.
This function only looks at this nodes children, it does NOT look recursivily. If the node can't be found then false is returned.
If you need to search recursivily then use the {
Note: If you are trying to set the active node {
| string | int | $key | The key of the node you wish to receive. |
| int | $type | One of navigation_node::TYPE_* |
Reimplemented from navigation_node.
Definition at line 2437 of file navigationlib.php.
Returns all of the users the navigation is being extended for
Definition at line 2157 of file navigationlib.php.
| initialise | ( | ) |
Initialises the navigation object.
This causes the navigation object to look at the current state of the page that it is associated with and then load the appropriate content.
This should only occur the first time that the navigation structure is utilised which will normally be either when the navbar is called to be displayed or when a block makes use of it.
Reimplemented in global_navigation_for_ajax.
Definition at line 1021 of file navigationlib.php.

| load_activity | ( | $ | cm, |
| stdClass $ | course, | ||
| navigation_node $ | activity | ||
| ) | [protected] |
Loads the navigation structure for the given activity into the activities node.
This method utilises a callback within the modules lib.php file to load the content specific to activity given.
The callback is a method: {modulename}_extend_navigation() Examples: * {
| cm_info | stdClass | $cm | |
| stdClass | $course | |
| navigation_node | $activity |
Definition at line 1841 of file navigationlib.php.


| load_all_categories | ( | $ | categoryid = null, |
| $ | showbasecategories = false |
||
| ) | [protected] |
Loads all categories (top level or if an id is specified for that category)
| int | $categoryid | The category id to load or null/0 to load all base level categories |
| bool | $showbasecategories | If set to true all base level categories will be loaded as well as the requested category and any parent categories. |
Definition at line 1435 of file navigationlib.php.


| load_all_courses | ( | $ | categoryids = null | ) | [protected] |
Loads of the the courses in Moodle into the navigation.
moodle_database $DB
| string | array | $categoryids | Either a string or array of category ids to load courses for |
Definition at line 1388 of file navigationlib.php.


| load_course | ( | stdClass $ | course | ) | [protected] |
Loads the given course into the navigation
| stdClass | $course |
Definition at line 1558 of file navigationlib.php.


| load_course_sections | ( | stdClass $ | course, |
| navigation_node $ | coursenode | ||
| ) | [protected] |
Loads all of the courses section into the navigation.
This function utilisies a callback that can be implemented within the course formats lib.php file to customise the navigation that is generated at this point for the course.
By default (if not defined) the method {
| stdClass | $course | Database record for the course |
| navigation_node | $coursenode | The course node within the navigation |
Definition at line 1582 of file navigationlib.php.


| load_for_user | ( | $ | user = null, |
| $ | forceforcontext = false |
||
| ) | [protected] |
Loads user specific information into the navigation in the appropriate place.
If no user is provided the current user is assumed.
| stdClass | $user | |
| bool | $forceforcontext | probably force something to be loaded somewhere (ask SamH if not sure what this means) |
Definition at line 1882 of file navigationlib.php.


| load_generic_course_sections | ( | stdClass $ | course, |
| navigation_node $ | coursenode, | ||
| $ | courseformat = 'unknown' |
||
| ) |
Generically loads the course sections into the course's navigation.
| stdClass | $course | |
| navigation_node | $coursenode | |
| string | $courseformat | The course format |
Definition at line 1672 of file navigationlib.php.


| load_section_activities | ( | navigation_node $ | sectionnode, |
| $ | sectionnumber, | ||
| $ | activities | ||
| ) | [protected] |
Loads all of the activities for a section into the navigation structure.
| navigation_node | $sectionnode | |
| int | $sectionnumber | |
| course_modinfo | $modinfo | Object returned from { |
Definition at line 1738 of file navigationlib.php.


| load_stealth_activity | ( | navigation_node $ | coursenode, |
| $ | modinfo | ||
| ) | [protected] |
Loads a stealth module from unavailable section
| navigation_node | $coursenode | |
| stdClass | $modinfo |
Definition at line 1800 of file navigationlib.php.


| static module_extends_navigation | ( | $ | modname | ) | [static, protected] |
This method simply checks to see if a given module can extend the navigation.
TODO: A shared caching solution should be used to save details on what extends navigation
| string | $modname |
Definition at line 2129 of file navigationlib.php.
| set_expansion_limit | ( | $ | type | ) |
Sets an expansion limit for the navigation
The expansion limit is used to prevent the display of content that has a type greater than the provided $type.
Can be used to ensure things such as activities or activity content don't get shown on the navigation. They are still generated in order to ensure the navbar still makes sense.
| int | $type | One of navigation_node::TYPE_* |
Definition at line 2404 of file navigationlib.php.
| set_userid_for_parent_checks | ( | $ | userid | ) |
Mutator to set userid to allow parent to see child's profile page navigation. See MDL-25805 for initial issue. Linked to it is an issue explaining why this is a REALLY UGLY HACK thats not for you to use!
| int | $userid | userid of profile page that parent wants to navigate around. |
Definition at line 1004 of file navigationlib.php.
| show_categories | ( | ) | [protected] |
Returns true is courses should be shown within categories on the navigation.
Definition at line 1347 of file navigationlib.php.

$addedcategories = array() [protected] |
Definition at line 951 of file navigationlib.php.
$addedcourses = array() [protected] |
Definition at line 949 of file navigationlib.php.
$cache [protected] |
Definition at line 947 of file navigationlib.php.
$expansionlimit = 0 [protected] |
Definition at line 953 of file navigationlib.php.
$extendforuser = array() [protected] |
Definition at line 945 of file navigationlib.php.
$initialised = false [protected] |
Definition at line 935 of file navigationlib.php.
$mycourses = array() [protected] |
Definition at line 937 of file navigationlib.php.
$page [protected] |
Definition at line 933 of file navigationlib.php.
$rootnodes = array() [protected] |
Definition at line 939 of file navigationlib.php.
$showcategories = null [protected] |
Definition at line 943 of file navigationlib.php.
$showemptysections = false [protected] |
Definition at line 941 of file navigationlib.php.
$useridtouseforparentchecks = 0 [protected] |
Definition at line 955 of file navigationlib.php.