Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | List of all members
parentable_part_of_admin_tree Interface Reference

Interface implemented by any part_of_admin_tree that has children. More...

Inheritance diagram for parentable_part_of_admin_tree:
part_of_admin_tree admin_category admin_root

Public Member Functions

 add ($destinationname, $something, $beforesibling=null)
 Adds a part_of_admin_tree object to the admin tree. More...
 
 check_access ()
 Verifies current user's access to this part_of_admin_tree. More...
 
 is_hidden ()
 Mostly useful for removing of some parts of the tree in admin tree block. More...
 
 locate ($name)
 Finds a named part_of_admin_tree. More...
 
 prune ($name)
 Removes named part_of_admin_tree. More...
 
 search ($query)
 Search using query. More...
 
 show_save ()
 Show we display Save button at the page bottom? More...
 

Detailed Description

Interface implemented by any part_of_admin_tree that has children.

The interface implemented by any part_of_admin_tree that can be a parent to other part_of_admin_tree's. (For now, this only includes admin_category.) Apart from ensuring part_of_admin_tree compliancy, it also ensures inheriting methods include an add method for adding other part_of_admin_tree objects as children.

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

Member Function Documentation

◆ add()

parentable_part_of_admin_tree::add (   $destinationname,
  $something,
  $beforesibling = null 
)

Adds a part_of_admin_tree object to the admin tree.

Used to add a part_of_admin_tree object to this object or a child of this object. $something should only be added if $destinationname matches $this->name. If it doesn't, add should be called on child objects that are also parentable_part_of_admin_tree's.

$something should be appended as the last child in the $destinationname. If the $beforesibling is specified, $something should be prepended to it. If the given sibling is not found, $something should be appended to the end of $destinationname and a developer debugging message should be displayed.

Parameters
string$destinationnameThe internal name of the new parent for $something.
part_of_admin_tree$somethingThe object to be added.
Return values
boolTrue on success, false on failure.

Implemented in admin_category.

◆ check_access()

part_of_admin_tree::check_access ( )
inherited

Verifies current user's access to this part_of_admin_tree.

Used to check if the current user has access to this part of the admin tree or not. If a class only inherits part_of_admin_tree and not parentable_part_of_admin_tree, then this method is usually just a call to has_capability() in the site context.

If a class inherits parentable_part_of_admin_tree, this method should return the logical OR of the return of check_access() on all child objects.

Return values
boolTrue if the user has access, false if she doesn't.

Implemented in admin_category, admin_externalpage, and admin_settingpage.

◆ is_hidden()

part_of_admin_tree::is_hidden ( )
inherited

Mostly useful for removing of some parts of the tree in admin tree block.

Return values
Trueis hidden from normal list view

Implemented in admin_category, admin_externalpage, and admin_settingpage.

◆ locate()

part_of_admin_tree::locate (   $name)
inherited

Finds a named part_of_admin_tree.

Used to find a part_of_admin_tree. If a class only inherits part_of_admin_tree and not parentable_part_of_admin_tree, then this function should only check if $this->name matches $name. If it does, it should return a reference to $this, otherwise, it should return a reference to NULL.

If a class inherits parentable_part_of_admin_tree, this method should be called recursively on all child objects (assuming, of course, the parent object's name doesn't match the search criterion).

Parameters
string$nameThe internal name of the part_of_admin_tree we're searching for.
Return values
mixedAn object reference or a NULL reference.

◆ prune()

part_of_admin_tree::prune (   $name)
inherited

Removes named part_of_admin_tree.

Parameters
string$nameThe internal name of the part_of_admin_tree we want to remove.
Return values
boolsuccess.

Implemented in admin_category, admin_externalpage, and admin_settingpage.

◆ search()

part_of_admin_tree::search (   $query)
inherited

◆ show_save()

part_of_admin_tree::show_save ( )
inherited

Show we display Save button at the page bottom?

Return values
bool

Implemented in admin_category, admin_externalpage, and admin_settingpage.


The documentation for this interface was generated from the following file: