Moodle  2.2.1
http://www.collinsharper.com
settings_navigation Class Reference
Inheritance diagram for settings_navigation:
Collaboration diagram for settings_navigation:

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

Detailed Description

Definition at line 2825 of file navigationlib.php.


Constructor & Destructor Documentation

__construct ( moodle_page &$  page)

Sets up the object with basic settings and preparse it for use

Parameters:
moodle_page$page

Definition at line 2844 of file navigationlib.php.

Here is the call graph for this function:


Member Function Documentation

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

Parameters:
string$text
sting | moodle_url$url
string$shorttext
string | int$key
int$type
string$icon
Returns:
navigation_node

Reimplemented from navigation_node.

Definition at line 2953 of file navigationlib.php.

Here is the caller graph for this function:

add_course_editing_links ( course) [protected]

Adds branches and links to the settings navigation to add course activities and resources.

Parameters:
stdClass$course

Definition at line 3324 of file navigationlib.php.

Here is the call graph for this function:

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)

Parameters:
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

Parameters:
int$courseidThe current course' id
int$useridThe user id to load for
string$gstitleThe string to pass to get_string for the branch title
Returns:
navigation_node|false

Definition at line 3585 of file navigationlib.php.

Here is the call graph for this function:

get_by_path ( array path) [protected]

Gets a navigation node given an array of keys that represent the path to the desired node.

Parameters:
array$path
Returns:
navigation_node|false

Definition at line 3085 of file navigationlib.php.

get_course_modules ( course) [protected]

Generate the list of modules for the given course.

Parameters:
stdClass$courseThe course to get modules for

Definition at line 3098 of file navigationlib.php.

Here is the call graph for this function:

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.

Returns:
bool|int The role(int) if the user is in another role, false otherwise

Definition at line 3896 of file navigationlib.php.

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.

Here is the call graph for this function:

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

Parameters:
navigation_node$referencebranchA reference to a branch in the settings navigation tree
part_of_admin_tree$adminbranchThe branch to add, if null generate the admin tree and start at the beginning
Returns:
mixed A key to access the admin tree by

Definition at line 2992 of file navigationlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

load_block_settings ( ) [protected]

Loads block specific settings in the navigation

Returns:
navigation_node

Definition at line 3800 of file navigationlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

load_category_settings ( ) [protected]

Loads category specific settings in the navigation

Returns:
navigation_node

Definition at line 3829 of file navigationlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

load_course_settings ( forceopen = false) [protected]

This function loads the course settings that are available for the user

Parameters:
bool$forceopenIf set to true the course node will be forced open
Returns:
navigation_node|false

Definition at line 3149 of file navigationlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
navigation_node

Definition at line 3916 of file navigationlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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()

Returns:
navigation_node|false

Definition at line 3415 of file navigationlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
int$courseidThe course id of the current course
Returns:
navigation_node|false

Definition at line 3511 of file navigationlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
string$text
sting | moodle_url$url
string$shorttext
string | int$key
int$type
string$icon
Returns:
navigation_node

Definition at line 2971 of file navigationlib.php.

Here is the call graph for this function:

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.

Parameters:
navigation_node$node

Definition at line 3070 of file navigationlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$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.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations