Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
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. More...
Public Member Functions | |
__construct (context $context, $id) | |
Constructor. More... | |
add_classes ($classnames) | |
Use this to add class="" attributes to the table. More... | |
display () | |
Display the table. | |
Public Attributes | |
const | NUM_CAPS_FOR_SEARCH = 12 |
Default number of capabilities in the table for the search UI to be shown. | |
Protected Member Functions | |
add_header_cells () | |
For subclasses to override, output header cells, after the initial capability one. | |
add_row_cells ($capability) | |
For subclasses to override. More... | |
get_row_attributes ($capability) | |
For subclasses to override. More... | |
get_row_classes ($capability) | |
For subclasses to override. More... | |
num_extra_columns () | |
For subclasses to override, return the number of cells that add_header_cells/add_row_cells output. | |
print_heading_row ($capability) | |
Used to output a heading rows when the context level or component changes. More... | |
skip_row ($capability) | |
For subclasses to override. More... | |
Protected Attributes | |
$capabilities = array() | |
The capabilities to display. More... | |
$classes = array('rolecap') | |
Added to the class="" attribute on output. | |
$context | |
The context this table relates to. | |
$id | |
Added as an id="" attribute to the table on output. | |
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.
core_role_capability_table_base::__construct | ( | context | $context, |
$id | |||
) |
Constructor.
context | $context | the context this table relates to. |
string | $id | what to put in the id="" attribute. |
core_role_capability_table_base::add_classes | ( | $classnames | ) |
Use this to add class="" attributes to the table.
You get the rolecap by default.
array | $classnames | of class names. |
|
abstractprotected |
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.
stdClass | $capability | the capability this row relates to. |
string | html of row cells |
Reimplemented in core_role_permissions_table, core_role_check_capability_table, and core_role_capability_table_with_risks.
|
protected |
For subclasses to override.
Additional attributes to be added to each table row for the capability
stdClass | $capability | the capability this row relates to. |
array | attribute names and their values. |
Reimplemented in core_role_permissions_table, and core_role_override_permissions_table_advanced.
|
protected |
For subclasses to override.
A change to reaturn class names that are added to the class="" attribute on the <tr> for this capability.
stdClass | $capability | the capability this row relates to. |
array | of class name strings. |
Reimplemented in core_role_check_capability_table, and core_role_capability_table_with_risks.
|
protected |
Used to output a heading rows when the context level or component changes.
stdClass | $capability | gives the new component and contextlevel. |
|
protected |
For subclasses to override.
Allows certain capabilties to be left out of the table.
object | $capability | the capability this row relates to. |
boolean. | If true, this row is omitted from the table. |
Reimplemented in core_role_view_role_definition_table.
|
protected |
The capabilities to display.
Initialised as $context->get_capabilities().