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

Public Member Functions

 __construct ($context, $id, $roleid)
 read_submitted_permissions ()
 save_changes ()
 display ()
 get_risk_icon ($type)

Protected Member Functions

 load_current_permissions ()
 load_parent_permissions ()
 add_header_cells ()
 num_extra_columns ()
 get_row_classes ($capability)
 add_permission_cells ($capability)
 add_row_cells ($capability)

Protected Attributes

 $allrisks
 $allpermissions
 $strperms
 $risksurl
 $riskicons = array()
 $parentpermissions
 $displaypermissions
 $permissions
 $changed
 $roleid

Detailed Description

This subclass is the bases for both the define roles and override roles pages. As well as adding the risks columns, this also provides generic facilities for showing a certain number of permissions columns, and recording the current and submitted permissions for each capability.

Definition at line 376 of file lib.php.


Constructor & Destructor Documentation

__construct ( context,
id,
roleid 
)

Fill in any blank permissions with an explicit CAP_INHERIT, and init a locked field.

Reimplemented in override_permissions_table_advanced.

Definition at line 389 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

add_header_cells ( ) [protected]

For subclasses to override, output header cells, after the initial capability one.

Reimplemented from capability_table_base.

Definition at line 485 of file lib.php.

add_permission_cells ( capability) [abstract, protected]

Reimplemented in override_permissions_table_advanced, view_role_definition_table, define_role_table_basic, and define_role_table_advanced.

Here is the caller graph for this function:

add_row_cells ( capability) [protected]

For subclasses to override. Output the data cells for this capability. The capability name cell will already have been output.

You can rely on get_row_classes always being called before add_row_cells.

Parameters:
object$capabilitythe capability this row relates to.

One cell for each possible risk.

Reimplemented from capability_table_base.

Definition at line 508 of file lib.php.

Here is the call graph for this function:

display ( )

Display the table.

Loop over capabilities.

Prints a breaker if component or name or context level has changed

Start the row.

Table cell for the capability name.

Add the cells specific to this table.

End the row.

End of the table.

Reimplemented from capability_table_base.

Reimplemented in define_role_table_advanced.

Definition at line 475 of file lib.php.

Here is the call graph for this function:

get_risk_icon ( type)

Print a risk icon, as a link to the Risks page on Moodle Docs.

Parameters:
string$typethe type of risk, will be one of the keys from the get_all_risks array. Must start with 'risk'.

Definition at line 526 of file lib.php.

Here is the caller graph for this function:

get_row_classes ( capability) [protected]

For subclasses to override. A change to reaturn class names that are added to the class="" attribute on the <tr> for this capability.

Parameters:
object$capabilitythe capability this row relates to.
Returns:
array of class name strings.

Reimplemented from capability_table_base.

Definition at line 496 of file lib.php.

load_current_permissions ( ) [protected]

Load the overrides/definition in this context.

Reimplemented in define_role_table_advanced.

Definition at line 419 of file lib.php.

Here is the caller graph for this function:

load_parent_permissions ( ) [abstract, protected]

Reimplemented in override_permissions_table_advanced, and define_role_table_advanced.

Here is the caller graph for this function:

num_extra_columns ( ) [protected]

For subclasses to override, return the number of cells that add_header_cells/add_row_cells output.

Reimplemented from capability_table_base.

Definition at line 492 of file lib.php.

Update $this->permissions based on submitted data, while making a list of changed capabilities in $this->changed.

The user is not allowed to change the permission for this capability

A permission was not specified in submitted data.

If the permission has changed, update $this->permissions and Record the fact there is data to save.

Reimplemented in define_role_table_advanced.

Definition at line 437 of file lib.php.

Here is the call graph for this function:

Save the new values of any permissions that have been changed.

Set the permissions.

Force accessinfo refresh for users visiting this context.

Reimplemented in view_role_definition_table, and define_role_table_advanced.

Definition at line 464 of file lib.php.

Here is the call graph for this function:


Field Documentation

$allpermissions [protected]

Definition at line 378 of file lib.php.

$allrisks [protected]

Definition at line 377 of file lib.php.

$changed [protected]

Definition at line 386 of file lib.php.

$displaypermissions [protected]

Definition at line 384 of file lib.php.

$parentpermissions [protected]

The capabilities to highlight as default/inherited.

Definition at line 383 of file lib.php.

$permissions [protected]

Definition at line 385 of file lib.php.

$riskicons = array() [protected]

Definition at line 381 of file lib.php.

$risksurl [protected]

Definition at line 380 of file lib.php.

$roleid [protected]

Definition at line 387 of file lib.php.

$strperms [protected]

Definition at line 379 of file lib.php.


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