Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Base capability table.

Copyright: 1999 onwards Martin Dougiamas (http://dougiamas.com)
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 195 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

core_role_capability_table_base:: (7 methods):
  __construct()
  add_classes()
  display()
  print_heading_row()
  skip_row()
  get_row_classes()
  get_row_attributes()


Class: core_role_capability_table_base  - X-Ref

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.
__construct(context $context, $id)   X-Ref
Constructor.

param: context $context the context this table relates to.
param: string $id what to put in the id="" attribute.

add_classes($classnames)   X-Ref
Use this to add class="" attributes to the table. You get the rolecap by
default.

param: array $classnames of class names.

display()   X-Ref
Display the table.


print_heading_row($capability)   X-Ref
Used to output a heading rows when the context level or component changes.

param: stdClass $capability gives the new component and contextlevel.

skip_row($capability)   X-Ref
For subclasses to override. Allows certain capabilties
to be left out of the table.

param: object $capability the capability this row relates to.
return: boolean. If true, this row is omitted from the table.

get_row_classes($capability)   X-Ref
For subclasses to override. A change to reaturn class names that are added
to the class="" attribute on the <tr> for this capability.

param: stdClass $capability the capability this row relates to.
return: array of class name strings.

get_row_attributes($capability)   X-Ref
For subclasses to override. Additional attributes to be added to
each table row for the capability

param: stdClass $capability the capability this row relates to.
return: array attribute names and their values.