Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
tool_policy

Namespaces

namespace  tool_policy
  
 
namespace  tool_policy\event
  
 
namespace  tool_policy\external
  
 
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
 Step definition for tool_policy. More...
 
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_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\external\get_user_acceptances
 
class  tool_policy\external\set_acceptances_status
 
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\hook_callbacks
 
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_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.
 
 xmldb_tool_policy_upgrade ($oldversion)
 Execute the plugin upgrade steps from the given old version.
 

Variables

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

Detailed Description

Function Documentation

◆ 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

◆ xmldb_tool_policy_upgrade()

xmldb_tool_policy_upgrade ( $oldversion)

Execute the plugin upgrade steps from the given old version.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Parameters
int$oldversion
Return values
bool

Variable Documentation

◆ $callbacks

$callbacks
Initial value:
= [
[
'hook' => core\hook\output\before_standard_top_of_body_html_generation::class,
'callback' => tool_policy\hook_callbacks::class . '::before_standard_top_of_body_html_generation',
'priority' => 0,
],
[
'hook' => core\hook\output\before_standard_footer_html_generation::class,
'callback' => [\tool_policy\hook_callbacks::class, 'before_standard_footer_html_generation'],
'priority' => 0,
],
]

◆ $definitions

$definitions
Initial value:
= [
'policy_optional' => [
'mode' => cache_store::MODE_REQUEST,
],
]

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