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

Public Member Functions

 __construct ($context, $id)
 add_classes ($classnames)
 display ()

Data Fields

const NUM_CAPS_FOR_SEARCH = 12

Protected Member Functions

 print_heading_row ($capability)
 add_header_cells ()
 num_extra_columns ()
 skip_row ($capability)
 get_row_classes ($capability)
 add_row_cells ($capability)

Protected Attributes

 $context
 $capabilities = array()
 $id
 $classes = array('rolecap')

Detailed Description

This class represents a table with one row for each of a list of capabilities where the first cell in the row contains the capability name, and there is arbitrary stuff in the rest of the row. This class is used by admin/roles/manage.php, override.php and check.php.

An ajaxy search UI shown at the top, if JavaScript is on.

Definition at line 46 of file lib.php.


Constructor & Destructor Documentation

__construct ( context,
id 
)

Constructor

Parameters:
object$contextthe context this table relates to.
string$idwhat to put in the id="" attribute.

Reimplemented in view_role_definition_table, define_role_table_basic, and define_role_table_advanced.

Definition at line 67 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

add_classes ( classnames)

Use this to add class="" attributes to the table. You get the rolecap by default.

Parameters:
array$classnamesof class names.

Definition at line 78 of file lib.php.

add_header_cells ( ) [abstract, protected]

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

Reimplemented in capability_table_with_risks, permissions_table, and check_capability_table.

Here is the caller graph for this function:

add_row_cells ( capability) [abstract, 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.

Reimplemented in capability_table_with_risks, permissions_table, and check_capability_table.

Here is the caller 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 in define_role_table_advanced, and capability_table_with_risks.

Definition at line 85 of file lib.php.

Here is the call 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 in capability_table_with_risks, and check_capability_table.

Definition at line 165 of file lib.php.

Here is the caller graph for this function:

num_extra_columns ( ) [abstract, protected]

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

Reimplemented in capability_table_with_risks, permissions_table, and check_capability_table.

Here is the caller graph for this function:

print_heading_row ( capability) [protected]

Used to output a heading rows when the context level or component changes.

Parameters:
object$capabilitygives the new component and contextlevel.

Definition at line 134 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

skip_row ( capability) [protected]

For subclasses to override. Allows certain capabilties to be left out of the table.

Parameters:
object$capabilitythe capability this row relates to.
Returns:
boolean. If true, this row is omitted from the table.

Definition at line 154 of file lib.php.

Here is the caller graph for this function:


Field Documentation

$capabilities = array() [protected]

The capabilities to display. Initialised as fetch_context_capabilities($context).

Definition at line 51 of file lib.php.

$classes = array('rolecap') [protected]

Added to the class="" attribute on output.

Definition at line 57 of file lib.php.

$context [protected]

The context this table relates to.

Definition at line 48 of file lib.php.

$id [protected]

Added as an id="" attribute to the table on output.

Definition at line 54 of file lib.php.

const NUM_CAPS_FOR_SEARCH = 12

Default number of capabilities in the table for the search UI to be shown.

Definition at line 60 of file lib.php.


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