Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Renderable class to display a set of rules in the manage subscriptions page.

Copyright: 2014 onwards Ankit Agarwal <ankit.agrr@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 227 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

rules:: (10 methods):
  __construct()
  col_name()
  col_description()
  col_course()
  col_plugin()
  col_eventname()
  col_filters()
  col_select()
  query_db()
  get_user_courses_select()


Class: rules  - X-Ref

Renderable class to display a set of rules in the manage subscriptions page.

__construct($uniqueid, \moodle_url $url, $courseid = 0, $perpage = 100)   X-Ref
Sets up the table_log parameters.

param: string $uniqueid unique id of form.
param: \moodle_url $url url where this table is displayed.
param: int $courseid course id.
param: int $perpage Number of rules to display per page.

col_name(\tool_monitor\rule $rule)   X-Ref
Generate content for name column.

param: \tool_monitor\rule $rule rule object
return: string html used to display the rule name.

col_description(\tool_monitor\rule $rule)   X-Ref
Generate content for description column.

param: \tool_monitor\rule $rule rule object
return: string html used to display the description.

col_course(\tool_monitor\rule $rule)   X-Ref
Generate content for course column.

param: \tool_monitor\rule $rule rule object
return: string html used to display the course name.

col_plugin(\tool_monitor\rule $rule)   X-Ref
Generate content for plugin column.

param: \tool_monitor\rule $rule rule object
return: string html used to display the plugin name.

col_eventname(\tool_monitor\rule $rule)   X-Ref
Generate content for eventname column.

param: \tool_monitor\rule $rule rule object
return: string html used to display the event name.

col_filters(\tool_monitor\rule $rule)   X-Ref
Generate content for filters column.

param: \tool_monitor\rule $rule rule object
return: string html used to display the filters.

col_select(\tool_monitor\rule $rule)   X-Ref
Generate content for select column.

param: \tool_monitor\rule $rule rule object
return: string html used to display the select field.

query_db($pagesize, $useinitialsbar = true)   X-Ref
Query the reader. Store results in the object for use by build_table.

param: int $pagesize size of page for paginated displayed table.
param: bool $useinitialsbar do you want to use the initials bar.

get_user_courses_select($choose = false)   X-Ref
Gets a list of courses where the current user can subscribe to rules as a dropdown.

param: bool $choose A flag for whether to show the 'choose...' option in the select box.
return: \single_select|bool returns the list of courses, or false if the select box