Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
tool_policy

Topics

 access
 
 
 cache
 
 
 external
 
 
 output
 
 
 test
 
 
 upgrade
 
 

Directories

directory local
  
 

Namespaces

namespace  tool_policy
 View user acceptances to the policies.
 
namespace  tool_policy\event
 Provides tool_policy::event::acceptance_base class.
 
namespace  tool_policy\form
 Provides tool_policy::form::accept_policy class.
 
namespace  tool_policy\privacy
 Privacy Subsystem implementation for tool_policy.
 
namespace  tool_policy\privacy\local\sitepolicy
 Site policy handler class.
 

Classes

class  tool_policy\acceptances_table
 Class acceptances_table. 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\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...
 

Functions

 tool_policy_before_standard_html_head ()
 Load policy message for guests.
 
 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.
 
 tool_policy_output_fragment_accept_on_behalf ($args)
 Serve the new group form as a fragment.
 
 tool_policy_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array())
 Serve the embedded files.
 
 tool_policy_pre_signup_requests ()
 Hooks redirection to policy acceptance pages before sign up.
 
 tool_policy_standard_footer_html ()
 Callback to add footer elements.
 

Variables

global tool_policy::$CFG
 
if(empty($CFG->sitepolicyhandler)|| $CFG->sitepolicyhandler !=='tool_policy') $managecaps
 
 $observers
 
 $plugin = 2023100400
 
$plugin component = 'tool_policy'
 
$plugin version = 2023100900
 

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

Variable Documentation

◆ $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',
],
]