Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
core_role_allow_role_page Class Reference

Base class for managing the data in the grid of checkboxes on the role allow allow/overrides/switch editing pages (allow.php). More...

Inheritance diagram for core_role_allow_role_page:
core_role_allow_assign_page core_role_allow_override_page core_role_allow_switch_page core_role_allow_view_page

Public Member Functions

 __construct ($tablename, $targetcolname)
 Constructor. More...
 
 get_intro_text ()
 Snippet of text displayed above the table, telling the admin what to do. More...
 
 get_table ()
 Returns structure that can be passed to print_table, containing one cell for each checkbox. More...
 
 load_current_settings ()
 Load the current allows from the database.
 
 process_submission ()
 Update the data with the new settings submitted by the user.
 

Protected Member Functions

 get_eventclass ()
 Returns the allow class respective event class name. More...
 
 is_allowed_target ($targetroleid)
 Is target allowed? More...
 
 load_required_roles ()
 Load information about all the roles we will need information about.
 
 set_allow ($fromroleid, $targetroleid)
 Set one allow in the database. More...
 

Protected Attributes

 $allowed = null
 
 $roles
 
 $tablename
 
 $targetcolname
 

Detailed Description

Base class for managing the data in the grid of checkboxes on the role allow allow/overrides/switch editing pages (allow.php).

Constructor & Destructor Documentation

◆ __construct()

core_role_allow_role_page::__construct (   $tablename,
  $targetcolname 
)

Constructor.

Parameters
string$tablenamethe table where our data is stored.
string$targetcolnamethe name of the target role id column.

Member Function Documentation

◆ get_eventclass()

core_role_allow_role_page::get_eventclass ( )
abstractprotected

Returns the allow class respective event class name.

Return values
string

Reimplemented in core_role_allow_view_page, core_role_allow_switch_page, core_role_allow_override_page, and core_role_allow_assign_page.

◆ get_intro_text()

core_role_allow_role_page::get_intro_text ( )
abstract

Snippet of text displayed above the table, telling the admin what to do.

Return values
string

Reimplemented in core_role_allow_view_page, core_role_allow_switch_page, core_role_allow_override_page, and core_role_allow_assign_page.

◆ get_table()

core_role_allow_role_page::get_table ( )

Returns structure that can be passed to print_table, containing one cell for each checkbox.

Return values
html_tablea table

◆ is_allowed_target()

core_role_allow_role_page::is_allowed_target (   $targetroleid)
protected

Is target allowed?

Parameters
integer$targetroleida role id.
Return values
booleanwhether the user should be allowed to select this role as a target role.

Reimplemented in core_role_allow_switch_page.

◆ set_allow()

core_role_allow_role_page::set_allow (   $fromroleid,
  $targetroleid 
)
abstractprotected

Set one allow in the database.

Parameters
int$fromroleid
int$targetroleid

Reimplemented in core_role_allow_view_page, core_role_allow_switch_page, core_role_allow_override_page, and core_role_allow_assign_page.


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