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

Public Member Functions

 __construct ($name, $visiblename, $hidden=false)
 locate ($name, $findpath=false)
 search ($query)
 prune ($name)
 add ($parentname, $something)
 check_access ()
 is_hidden ()
 show_save ()

Data Fields

 $children
 $name
 $visiblename
 $hidden
 $path
 $visiblepath

Protected Attributes

 $category_cache

Detailed Description

The object used to represent folders (a.k.a. categories) in the admin tree block.

Each admin_category object contains a number of part_of_admin_tree objects.

http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Definition at line 775 of file adminlib.php.


Constructor & Destructor Documentation

__construct ( name,
visiblename,
hidden = false 
)

Constructor for an empty admin category

Parameters:
string$nameThe internal name for this category. Must be unique amongst ALL part_of_admin_tree objects
string$visiblenameThe displayed named for this category. Usually obtained through get_string()
bool$hiddenhide category in admin tree block, defaults to false

Definition at line 800 of file adminlib.php.


Member Function Documentation

add ( parentname,
something 
)

Adds a part_of_admin_tree to a child or grandchild (or great-grandchild, and so forth) of this object.

Parameters:
string$destinationameThe internal name of the immediate parent that we want for $something.
mixed$somethingA part_of_admin_tree or setting instance to be added.
Returns:
bool True if successfully added, false if $something can not be added.

Implements parentable_part_of_admin_tree.

Definition at line 905 of file adminlib.php.

Here is the call graph for this function:

Checks if the user has access to anything in this category.

Returns:
bool True if the user has access to at least one child in this category, false otherwise.

Implements part_of_admin_tree.

Definition at line 951 of file adminlib.php.

is_hidden ( )

Is this category hidden in admin tree block?

Returns:
bool True if hidden

Implements part_of_admin_tree.

Definition at line 965 of file adminlib.php.

locate ( name,
findpath = false 
)

Returns a reference to the part_of_admin_tree object with internal name $name.

Parameters:
string$nameThe internal name of the object we want.
bool$findpathinitialize path and visiblepath arrays
Returns:
mixed A reference to the object with internal name $name if found, otherwise a reference to NULL. defaults to false

Definition at line 815 of file adminlib.php.

Here is the caller graph for this function:

prune ( name)

Removes part_of_admin_tree object with internal name $name.

Parameters:
string$nameThe internal name of the object we want to remove.
Returns:
bool success

Implements part_of_admin_tree.

Definition at line 874 of file adminlib.php.

search ( query)

Search using query

Parameters:
stringquery
Returns:
mixed array-object structure of found settings and pages

Implements part_of_admin_tree.

Definition at line 855 of file adminlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

show_save ( )

Show we display Save button at the page bottom?

Returns:
bool

Implements part_of_admin_tree.

Definition at line 973 of file adminlib.php.


Field Documentation

$category_cache [protected]

Definition at line 791 of file adminlib.php.

$children

Definition at line 778 of file adminlib.php.

$hidden

Definition at line 784 of file adminlib.php.

$name

Definition at line 780 of file adminlib.php.

$path

Definition at line 786 of file adminlib.php.

$visiblename

Definition at line 782 of file adminlib.php.

$visiblepath

Definition at line 788 of file adminlib.php.


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