Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Files | Namespaces | Classes | Functions | Variables
tool_policy

Files

file  accept_policy.php
 Provides tool_policy::form::accept_policy class.
 
file  acceptance_base.php
 Provides tool_policy::event::acceptance_base class.
 
file  acceptance_created.php
 Provides tool_policy::event::acceptance_created class.
 
file  acceptance_updated.php
 Provides tool_policy::event::acceptance_updated class.
 
file  acceptances.php
 Provides tool_policy::output::acceptances class.
 
file  acceptances_filter.php
 Provides tool_policy::output::acceptances_filter class.
 
file  acceptances_table.php
 View user acceptances to the policies.
 
file  access.php
 Plugin capabilities are defined here.
 
file  api.php
 Provides tool_policy::output::renderer class.
 
file  behat_tool_policy.php
 Step definition for tool_policy.
 
file  caches.php
 Defined caches used internally by the plugin.
 
file  events.php
 This file defines observers needed by the plugin.
 
file  external.php
 Class containing the external API functions functions for the Policy tool.
 
file  guestconsent.php
 Provides tool_policy::output::renderer class.
 
file  handler.php
 Site policy handler class.
 
file  helper.php
 Provides the tool_policy::test::helper class.
 
file  lib.php
 Plugin version and other meta-data are defined here.
 
file  page_agreedocs.php
 Provides tool_policy::output::renderer class.
 
file  page_managedocs_list.php
 Provides tool_policy::output::page_managedocs_list class.
 
file  page_nopermission.php
 Provides tool_policy::output::renderer class.
 
file  page_viewalldoc.php
 Provides tool_policy::output::renderer class.
 
file  page_viewdoc.php
 Provides tool_policy::output::renderer class.
 
file  policy_exporter.php
 Provides the tool_policy::policy_exporter class.
 
file  policy_version.php
 Provides the tool_policy::policy_version persistent.
 
file  policy_version_exporter.php
 Provides the tool_policy::policy_version_exporter class.
 
file  policydoc.php
 Provides tool_policy::form::policydoc class.
 
file  provider.php
 Privacy Subsystem implementation for tool_policy.
 
file  renderer.php
 Provides tool_policy::output::renderer class.
 
file  services.php
 Tool policy external functions and service definitions.
 
file  settings.php
 Plugin administration pages are defined here.
 
file  upgrade.php
 Plugin upgrade steps are defined here.
 
file  user_agreement.php
 Provides tool_policy::output::user_agreement class.
 
file  version.php
 Plugin version and other meta-data are defined here.
 

Namespaces

namespace  tool_policy
  
 
namespace  tool_policy\event
  
 
namespace  tool_policy\form
  
 
namespace  tool_policy\output
  
 
namespace  tool_policy\privacy
  
 
namespace  tool_policy\privacy\local\sitepolicy
  
 
namespace  tool_policy\test
  
 

Classes

class  behat_tool_policy
 
class  tool_policy\acceptances_table
 Class acceptances_table. More...
 
class  tool_policy\api
 Provides the API of the policies plugin. More...
 
class  tool_policy\event\acceptance_base
 Base class for acceptance_created and acceptance_updated events. More...
 
class  tool_policy\event\acceptance_created
 Event acceptance_created. More...
 
class  tool_policy\event\acceptance_updated
 Event acceptance_updated. More...
 
class  tool_policy\external
 Class external. More...
 
class  tool_policy\form\accept_policy
 Represents the form for accepting or revoking a policy. More...
 
class  tool_policy\form\policydoc
 Defines the form for editing a policy document version. More...
 
class  tool_policy\output\acceptances
 List of users and their acceptances. More...
 
class  tool_policy\output\acceptances_filter
 Implements the widget allowing to filter the acceptance records. More...
 
class  tool_policy\output\guestconsent
 Renderer for the policies plugin. More...
 
class  tool_policy\output\page_agreedocs
 Represents a page for showing all the policy documents which a user has to agree to. More...
 
class  tool_policy\output\page_managedocs_list
 Represents a management page with the list of policy documents. More...
 
class  tool_policy\output\page_nopermission
 Represents a page for showing the error messages. More...
 
class  tool_policy\output\page_viewalldoc
 Represents a page for showing all the policy documents with a current version. More...
 
class  tool_policy\output\page_viewdoc
 Represents a page for showing the given policy document version. More...
 
class  tool_policy\output\renderer
 Renderer for the policies plugin. More...
 
class  tool_policy\output\user_agreement
 List of users and their acceptances. More...
 
class  tool_policy\policy_exporter
 Exporter of a policy document model. More...
 
class  tool_policy\policy_version
 Persistent model representing a single policy document version. More...
 
class  tool_policy\policy_version_exporter
 Exporter of a single policy document version. More...
 
class  tool_policy\privacy\local\sitepolicy\handler
 Class implementation for a site policy handler. More...
 
class  tool_policy\privacy\provider
 Implementation of the privacy subsystem plugin provider for the policy tool. More...
 
class  tool_policy\test\helper
 Provides some helper methods for unit-tests. More...
 

Functions

 tool_policy_before_standard_html_head ()
 Load policy message for guests. More...
 
 tool_policy_get_fontawesome_icon_map ()
 Map icons for font-awesome themes.
 
 tool_policy_myprofile_navigation (tree $tree, $user, $iscurrentuser, $course)
 Add nodes to myprofile page. More...
 
 tool_policy_output_fragment_accept_on_behalf ($args)
 Serve the new group form as a fragment. More...
 
 tool_policy_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array())
 Serve the embedded files. More...
 
 tool_policy_pre_signup_requests ()
 Hooks redirection to policy acceptance pages before sign up.
 
 tool_policy_standard_footer_html ()
 Callback to add footer elements. More...
 
 xmldb_tool_policy_upgrade ($oldversion)
 Execute the plugin upgrade steps from the given old version. More...
 

Variables

 $capabilities
 
global tool_policy::$CFG
 
 $definitions
 
 $functions
 
if(empty($CFG->sitepolicyhandler)|| $CFG->sitepolicyhandler !=='tool_policy') $managecaps
 
 $observers
 
 $plugin = 2020060900
 
$plugin component = 'tool_policy'
 
$plugin version = 2020061500
 

Detailed Description

Function Documentation

◆ tool_policy_before_standard_html_head()

tool_policy_before_standard_html_head ( )

Load policy message for guests.

Return values
stringThe HTML code to insert before the head.

◆ tool_policy_myprofile_navigation()

tool_policy_myprofile_navigation ( tree  $tree,
  $user,
  $iscurrentuser,
  $course 
)

Add nodes to myprofile page.

Parameters
tree$treeTree object
stdClass$userUser object
bool$iscurrentuser
stdClass$courseCourse object
Return values
bool
Exceptions
coding_exception
dml_exception
moodle_exception

◆ tool_policy_output_fragment_accept_on_behalf()

tool_policy_output_fragment_accept_on_behalf (   $args)

Serve the new group form as a fragment.

Parameters
array$argsList of named arguments for the fragment loader.
Return values
string

◆ tool_policy_pluginfile()

tool_policy_pluginfile (   $course,
  $cm,
  $context,
  $filearea,
  $args,
  $forcedownload,
array  $options = array() 
)

Serve the embedded files.

Parameters
stdClass$coursethe course object
stdClass$cmthe course module object
stdClass$contextthe context
string$fileareathe name of the file area
array$argsextra arguments (itemid, path)
bool$forcedownloadwhether or not force download
array$optionsadditional options affecting the file serving
Return values
boolfalse if the file not found, just send the file otherwise and do not return anything

◆ tool_policy_standard_footer_html()

tool_policy_standard_footer_html ( )

Callback to add footer elements.

Return values
stringHTML footer content

◆ xmldb_tool_policy_upgrade()

xmldb_tool_policy_upgrade (   $oldversion)

Execute the plugin upgrade steps from the given old version.

Parameters
int$oldversion
Return values
bool

Variable Documentation

◆ $definitions

$definitions
Initial value:
= [
'policy_optional' => [
],
]
const MODE_REQUEST
Request caches.
Definition: store.php:146

◆ $functions

$functions
Initial value:
= [
'tool_policy_get_policy_version' => [
'classname' => 'tool_policy\external',
'methodname' => 'get_policy_version',
'classpath' => '',
'description' => 'Fetch the details of a policy version',
'type' => 'read',
'capabilities' => '',
'ajax' => true,
'loginrequired' => false,
],
'tool_policy_submit_accept_on_behalf' => [
'classname' => 'tool_policy\external',
'methodname' => 'submit_accept_on_behalf',
'classpath' => '',
'description' => 'Accept policies on behalf of other users',
'ajax' => true,
'type' => 'write',
],
]

◆ $managecaps

if (empty( $CFG->sitepolicyhandler)||$CFG->sitepolicyhandler !=='tool_policy') $managecaps
Initial value:
= [
'tool/policy:managedocs',
'tool/policy:viewacceptances',
]

◆ $observers

$observers
Initial value:
= [
[
'eventname' => '\core\event\user_created',
'callback' => '\tool_policy\api::create_acceptances_user_created',
],
]