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

Implements the widget allowing to filter the acceptance records. More...

Inheritance diagram for tool_policy\output\acceptances_filter:
templatable renderable

Public Member Functions

 __construct ($policyid, $versionid, $filtersapplied)
 Constructor. More...
 
 export_for_template (\renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template. More...
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template. More...
 
 get_avaliable_policies ()
 Returns all policies that have versions with possible acceptances (excl. More...
 
 get_capability_accept_filter ()
 Is there a filter by capability (can accept/cannot accept). More...
 
 get_policy_id_filter ()
 Is there a filter by policy. More...
 
 get_role_filters ()
 Are there filters by role. More...
 
 get_search_strings ()
 Are there filters by search strings. More...
 
 get_single_version ()
 If policyid or versionid is specified return one single policy that needs to be shown. More...
 
 get_status_filter ()
 Is there a filter by status (agreed/not agreed). More...
 
 get_url ()
 Returns URL of the acceptances page with all current filters applied. More...
 
 get_version_id_filter ()
 Is there a filter by version. More...
 
 get_versions ()
 List of policies that match current filters. More...
 
 validate_ids ()
 Validates if policyid and versionid are valid (if specified)
 

Public Attributes

int const FILTER_CAPABILITY_ACCEPT = 3
 
int const FILTER_POLICYID = 1
 
int const FILTER_ROLE = 5
 
int const FILTER_SEARCH_STRING = 0
 
int const FILTER_STATUS = 4
 
int const FILTER_VERSIONID = 2
 

Protected Member Functions

 add_filter ($key, $value, $allowmultiple=false)
 Adds an applied filter. More...
 
 build_available_filters ()
 Build list of filters available for this page. More...
 
 get_filter_value ($filtername, $default=null)
 Get one value of the applied filter. More...
 
 get_filter_values ($filtername)
 Get all values of the applied filter. More...
 
 get_version_option_for_filter ($version)
 Creates an option name for the smart select for the version. More...
 

Protected Attributes

array $filtersapplied
 $filtersapplied The list of selected filter options.
 
array $policies
 cached list of all available policies, to retrieve use self::get_avaliable_policies()
 
array $roles
 list of available roles for the filter
 
string $searchstrings
 $searchstring
 
array $versions = null
 list of available versions
 

Detailed Description

Implements the widget allowing to filter the acceptance records.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

tool_policy\output\acceptances_filter::__construct (   $policyid,
  $versionid,
  $filtersapplied 
)

Constructor.

Parameters
array$policyidSpecified policy id
array$versionidSpecified version id
array$filtersappliedThe list of selected filter option values.

Member Function Documentation

◆ add_filter()

tool_policy\output\acceptances_filter::add_filter (   $key,
  $value,
  $allowmultiple = false 
)
protected

Adds an applied filter.

Parameters
mixed$key
mixed$value
bool$allowmultiple

◆ build_available_filters()

tool_policy\output\acceptances_filter::build_available_filters ( )
protected

Build list of filters available for this page.

Return values
array[$availablefilters, $selectedoptions]

◆ export_for_template() [1/2]

tool_policy\output\acceptances_filter::export_for_template ( \renderer_base  $output)

Function to export the renderer data in a format that is suitable for a mustache template.

Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

◆ export_for_template() [2/2]

templatable::export_for_template ( renderer_base  $output)
inherited

Function to export the renderer data in a format that is suitable for a mustache template.

This means:

  1. No complex types - only stdClass, array, int, string, float, bool
  2. Any additional info that is required for the template is pre-calculated (e.g. capability checks).
Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

Implemented in forumreport_summary\output\filters, core_user\output\unified_filter, core_user\output\status_field, core_tag\output\taglist, core_tag\output\tagindex, core_tag\output\tagfeed, core_tag\output\tagcloud, core_tag\output\tag, report_competency\output\user_course_navigation, report_competency\output\report, core_privacy\output\exported_navigation_page, core_privacy\output\exported_html_page, MoodleQuickForm_wikieditor, mod_lti\output\tool_configure_page, mod_lti\output\external_registration_return_page, mod_forum\output\quick_search_form, mod_forum\output\big_search_form, mod_feedback\output\summary, booktool_print\output\print_book_page, booktool_print\output\print_book_chapter_page, assign_attempt_history_chooser, mod_assign\output\grading_app, login_signup_form, progress_bar, action_menu, tabtree, tabobject, custom_menu_item, initials_bar, paging_bar, url_select, single_select, pix_icon, pix_icon_font, help_icon, component_action, MoodleQuickForm_warning, MoodleQuickForm_url, MoodleQuickForm_textarea, MoodleQuickForm_tags, MoodleQuickForm_submit, MoodleQuickForm_static, MoodleQuickForm_selectwithlink, MoodleQuickForm_selectgroups, MoodleQuickForm_select, MoodleQuickForm_recaptcha, MoodleQuickForm_passwordunmask, MoodleQuickForm_group, MoodleQuickForm_grading, MoodleQuickForm_filepicker, MoodleQuickForm_filemanager, MoodleQuickForm_editor, MoodleQuickForm_date_time_selector, MoodleQuickForm_date_selector, MoodleQuickForm_checkbox, MoodleQuickForm_autocomplete, MoodleQuickForm_advcheckbox, core\output\chooser_section, core\output\chooser_item, core\output\chooser, core\output\checkbox_toggleall, core_group\output\index_page, core_group\output\group_details, enrol_lti\output\registration, core_course\output\modchooser, block_timeline\output\main, block_starredcourses\output\main, block_search_forums\output\search_form, block_recentlyaccesseditems\output\main, block_recentlyaccessedcourses\output\main, block_myprofile\output\myprofile, block_myoverview\output\main, block_lp\output\summary, block_lp\output\plans_to_review_page, block_lp\output\competencies_to_review_page, core_auth\output\verify_age_location_page, core_auth\output\login, core_auth\output\digital_minor_page, tool_templatelibrary\output\list_templates_page, tool_policy\output\page_viewdoc, tool_policy\output\page_viewalldoc, tool_policy\output\page_nopermission, tool_policy\output\page_managedocs_list, tool_policy\output\page_agreedocs, tool_policy\output\guestconsent, tool_policy\output\acceptances, tool_lp\output\user_evidence_list_page, tool_lp\output\user_competency_summary_in_course, tool_lp\output\user_competency_summary, tool_lp\output\user_competency_course_navigation, tool_lp\output\template_competencies_page, tool_lp\output\related_competencies, tool_lp\output\plans_page, tool_lp\output\module_navigation, tool_lp\output\manage_templates_page, tool_lp\output\manage_competency_frameworks_page, tool_lp\output\manage_competencies_page, tool_lp\output\course_competencies_page, tool_lp\output\competency_summary, tool_lp\output\competency_plan_navigation, tool_langimport\output\langimport_page, tool_dataprivacy\output\summary_page, tool_dataprivacy\output\request_filter, tool_dataprivacy\output\purposes, tool_dataprivacy\output\my_data_requests_page, tool_dataprivacy\output\defaults_page, tool_dataprivacy\output\data_requests_page, tool_dataprivacy\output\data_registry_page, tool_dataprivacy\output\data_registry_compliance_page, tool_dataprivacy\output\data_deletion_page, tool_dataprivacy\output\categories, and tool_customlang\output\translator.

◆ get_avaliable_policies()

tool_policy\output\acceptances_filter::get_avaliable_policies ( )

Returns all policies that have versions with possible acceptances (excl.

drafts and guest-only versions)

Return values
array|null

◆ get_capability_accept_filter()

tool_policy\output\acceptances_filter::get_capability_accept_filter ( )

Is there a filter by capability (can accept/cannot accept).

Return values
null|0|1null if there is no filter, 0/1 if there is a filter by capability

◆ get_filter_value()

tool_policy\output\acceptances_filter::get_filter_value (   $filtername,
  $default = null 
)
protected

Get one value of the applied filter.

Parameters
string$filtername
string$default
Return values
mixed

◆ get_filter_values()

tool_policy\output\acceptances_filter::get_filter_values (   $filtername)
protected

Get all values of the applied filter.

Parameters
string$filtername
Return values
array

◆ get_policy_id_filter()

tool_policy\output\acceptances_filter::get_policy_id_filter ( )

Is there a filter by policy.

Return values
null|intnull if there is no filter, otherwise the policy id

◆ get_role_filters()

tool_policy\output\acceptances_filter::get_role_filters ( )

Are there filters by role.

Return values
arraylist of role ids

◆ get_search_strings()

tool_policy\output\acceptances_filter::get_search_strings ( )

Are there filters by search strings.

Return values
string[]array of string filters

◆ get_single_version()

tool_policy\output\acceptances_filter::get_single_version ( )

If policyid or versionid is specified return one single policy that needs to be shown.

If neither policyid nor versionid is specified this method returns null.

When versionid is specified this method will always return an object (this is validated in self::validate_ids() When only policyid is specified this method either returns the current version of the policy or null if there is no current version (for example, it is an old policy).

Return values
mixed|null

◆ get_status_filter()

tool_policy\output\acceptances_filter::get_status_filter ( )

Is there a filter by status (agreed/not agreed).

Return values
null|0|1null if there is no filter, 0/1 if there is a filter by status

◆ get_url()

tool_policy\output\acceptances_filter::get_url ( )

Returns URL of the acceptances page with all current filters applied.

Return values
moodle_url

◆ get_version_id_filter()

tool_policy\output\acceptances_filter::get_version_id_filter ( )

Is there a filter by version.

Return values
null|intnull if there is no filter, otherwise the version id

◆ get_version_option_for_filter()

tool_policy\output\acceptances_filter::get_version_option_for_filter (   $version)
protected

Creates an option name for the smart select for the version.

Parameters
stdClass$version
Return values
string

◆ get_versions()

tool_policy\output\acceptances_filter::get_versions ( )

List of policies that match current filters.

Return values
arrayof versions to display indexed by versionid

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