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

Files

file  access.php
 Page module capability definition.
 
file  activity.php
 Search area for mod_page activities.
 
file  activity_base.php
 Activity base class.
 
file  backup_page_activity_task.class.php
 Defines backup_page_activity_task class.
 
file  backup_page_stepslib.php
 
file  cognitive_depth.php
 Cognitive depth indicator - page.
 
file  course_module_instance_list_viewed.php
 The mod_page instance list viewed event.
 
file  course_module_viewed.php
 The mod_page course module viewed event.
 
file  external.php
 Page external API.
 
file  install.php
 Page module post install function.
 
file  lib.php
 Provides support for the conversion of moodle1 backup to the moodle2 format.
 
file  lib.php
 
file  lib.php
 mod_page data generator
 
file  locallib.php
 Private page module utility functions.
 
file  log.php
 Definition of log events.
 
file  mod_form.php
 Page configuration form.
 
file  provider.php
 Privacy Subsystem implementation for mod_page.
 
file  restore_page_activity_task.class.php
 
file  restore_page_stepslib.php
 
file  services.php
 Page external functions and service definitions.
 
file  settings.php
 Page module admin settings and defaults.
 
file  social_breadth.php
 Social breadth indicator - page.
 
file  upgrade.php
 Page module upgrade code.
 
file  version.php
 Page module version information.
 

Namespaces

namespace  mod_page\analytics\indicator
  
 
namespace  mod_page\event
  
 
namespace  mod_page\privacy
  
 
namespace  mod_page\search
  
 

Classes

class  backup_page_activity_structure_step
 Define all the backup steps that will be used by the backup_page_activity_task. More...
 
class  backup_page_activity_task
 Provides the steps to perform one complete backup of the Page instance. More...
 
class  mod_page\analytics\indicator\activity_base
 Activity base class. More...
 
class  mod_page\analytics\indicator\cognitive_depth
 Cognitive depth indicator - page. More...
 
class  mod_page\analytics\indicator\social_breadth
 Social breadth indicator - page. More...
 
class  mod_page\event\course_module_instance_list_viewed
 The mod_page instance list viewed event class. More...
 
class  mod_page\event\course_module_viewed
 The mod_page course module viewed event class. More...
 
class  mod_page\privacy\provider
 The mod_page module does not store any data. More...
 
class  mod_page\search\activity
 Search area for mod_page activities. More...
 
class  mod_page_external
 
class  mod_page_generator
 
class  mod_page_mod_form
 
class  moodle1_mod_page_handler
 Page conversion handler. More...
 
class  page_content_file_info
 File browsing support class. More...
 
class  restore_page_activity_structure_step
 Define all the restore steps that will be used by the restore_page_activity_task. More...
 
class  restore_page_activity_task
 page restore task that provides all the settings and steps to perform one complete restore of the activity More...
 

Functions

 mod_page_core_calendar_provide_event_action (calendar_event $event, core_calendar\action_factory $factory, $userid=0)
 This function receives a calendar event and returns the action associated with it, or null if there is none. More...
 
 mod_page_get_path_from_pluginfile (string $filearea, array $args)
 Given an array with a file path, it returns the itemid and the filepath for the defined filearea. More...
 
 page_add_instance ($data, $mform=null)
 Add page instance. More...
 
 page_check_updates_since (cm_info $cm, $from, $filter=array())
 Check if the module has any update that affects the current user since a given time. More...
 
 page_delete_instance ($id)
 Delete page instance. More...
 
 page_dndupload_handle ($uploadinfo)
 Handle a file that has been uploaded. More...
 
 page_dndupload_register ()
 Register the ability to handle drag and drop file uploads. More...
 
 page_export_contents ($cm, $baseurl)
 Export page resource contents. More...
 
 page_get_coursemodule_info ($coursemodule)
 Given a course_module object, this function returns any "extra" information that may be needed when printing this activity in a course listing. More...
 
 page_get_editor_options ($context)
 
 page_get_file_areas ($course, $cm, $context)
 
 page_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename)
 
 page_get_post_actions ()
 List the actions that correspond to a post of this module. More...
 
 page_get_view_actions ()
 List the actions that correspond to a view of this module. More...
 
 page_page_type_list ($pagetype, $parentcontext, $currentcontext)
 Return a list of page types. More...
 
 page_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array())
 
 page_reset_userdata ($data)
 This function is used by the reset_course_userdata function in moodlelib. More...
 
 page_supports ($feature)
 List of features supported in Page module. More...
 
 page_update_instance ($data, $mform)
 Update page instance. More...
 
 page_view ($page, $course, $cm, $context)
 Mark the activity completed (if required) and trigger the course_module_viewed event. More...
 
 xmldb_page_install ()
 
 xmldb_page_upgrade ($oldversion)
 

Variables

 $capabilities
 
 $functions
 
 $logs
 
 $plugin = 2020060900
 
$plugin component = 'mod_page'
 
$plugin cron = 0
 
$plugin version = 2020061500
 

Detailed Description

Function Documentation

◆ mod_page_core_calendar_provide_event_action()

mod_page_core_calendar_provide_event_action ( calendar_event  $event,
core_calendar\action_factory  $factory,
  $userid = 0 
)

This function receives a calendar event and returns the action associated with it, or null if there is none.

This is used by block_myoverview in order to display the event appropriately. If null is returned then the event is not displayed on the block.

Parameters
calendar_event$event
core_calendar::action_factory$factory
Return values
core_calendar::local::event::entities::action_interface|null

◆ mod_page_get_path_from_pluginfile()

mod_page_get_path_from_pluginfile ( string  $filearea,
array  $args 
)

Given an array with a file path, it returns the itemid and the filepath for the defined filearea.

Parameters
string$fileareaThe filearea.
array$argsThe path (the part after the filearea and before the filename).
Return values
arrayThe itemid and the filepath inside the $args path, for the defined filearea.

◆ page_add_instance()

page_add_instance (   $data,
  $mform = null 
)

Add page instance.

Parameters
stdClass$data
mod_page_mod_form$mform
Return values
intnew page instance id

◆ page_check_updates_since()

page_check_updates_since ( cm_info  $cm,
  $from,
  $filter = array() 
)

Check if the module has any update that affects the current user since a given time.

Parameters
cm_info$cmcourse module data
int$fromthe time to check updates from
array$filterif we need to check only specific updates
Return values
stdClassan object with the different type of areas indicating if they were updated or not
Since
Moodle 3.2

◆ page_delete_instance()

page_delete_instance (   $id)

Delete page instance.

Parameters
int$id
Return values
booltrue

◆ page_dndupload_handle()

page_dndupload_handle (   $uploadinfo)

Handle a file that has been uploaded.

Parameters
object$uploadinfodetails of the file / content that has been uploaded
Return values
intinstance id of the newly created mod

◆ page_dndupload_register()

page_dndupload_register ( )

Register the ability to handle drag and drop file uploads.

Return values
arraycontaining details of the files / types the mod can handle

◆ page_export_contents()

page_export_contents (   $cm,
  $baseurl 
)

Export page resource contents.

Return values
arrayof file content

◆ page_get_coursemodule_info()

page_get_coursemodule_info (   $coursemodule)

Given a course_module object, this function returns any "extra" information that may be needed when printing this activity in a course listing.

See get_array_of_activities() in course/lib.php

Parameters
stdClass$coursemodule
Return values
cached_cm_infoInfo to customise main page display

◆ page_get_post_actions()

page_get_post_actions ( )

List the actions that correspond to a post of this module.

This is used by the participation report.

Note: This is not used by new logging system. Event with crud = ('c' || 'u' || 'd') and edulevel = LEVEL_PARTICIPATING will be considered as post action.

Return values
array

◆ page_get_view_actions()

page_get_view_actions ( )

List the actions that correspond to a view of this module.

This is used by the participation report.

Note: This is not used by new logging system. Event with crud = 'r' and edulevel = LEVEL_PARTICIPATING will be considered as view action.

Return values
array

◆ page_page_type_list()

page_page_type_list (   $pagetype,
  $parentcontext,
  $currentcontext 
)

Return a list of page types.

Parameters
string$pagetypecurrent page type
stdClass$parentcontextBlock's parent context
stdClass$currentcontextCurrent context of block

◆ page_reset_userdata()

page_reset_userdata (   $data)

This function is used by the reset_course_userdata function in moodlelib.

Parameters
$datathe data submitted from the reset course.
Return values
arraystatus array

◆ page_supports()

page_supports (   $feature)

List of features supported in Page module.

Parameters
string$featureFEATURE_xx constant for requested feature
Return values
mixedTrue if module supports feature, false if not, null if doesn't know

◆ page_update_instance()

page_update_instance (   $data,
  $mform 
)

Update page instance.

Parameters
object$data
object$mform
Return values
booltrue

◆ page_view()

page_view (   $page,
  $course,
  $cm,
  $context 
)

Mark the activity completed (if required) and trigger the course_module_viewed event.

Parameters
stdClass$pagepage object
stdClass$coursecourse object
stdClass$cmcourse module object
stdClass$contextcontext object
Since
Moodle 3.0

Variable Documentation

◆ $capabilities

$capabilities
Initial value:
= array(
'mod/page:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'guest' => CAP_ALLOW,
'user' => CAP_ALLOW,
)
),
'mod/page:addinstance' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),
)
const CONTEXT_COURSE
Course context level - one instances for each course.
Definition: accesslib.php:128
const CAP_ALLOW
Allow permission, overrides CAP_PREVENT defined in parent contexts.
Definition: accesslib.php:115
const RISK_XSS
Capability allows user to add scripted content - see
Definition: accesslib.php:143
const CONTEXT_MODULE
Course module context level - one instance for each course module.
Definition: accesslib.php:130

◆ $functions

$functions
Initial value:
= array(
'mod_page_view_page' => array(
'classname' => 'mod_page_external',
'methodname' => 'view_page',
'description' => 'Simulate the view.php web interface page: trigger events, completion, etc...',
'type' => 'write',
'capabilities' => 'mod/page:view',
'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
),
'mod_page_get_pages_by_courses' => array(
'classname' => 'mod_page_external',
'methodname' => 'get_pages_by_courses',
'description' => 'Returns a list of pages in a provided list of courses, if no list is provided all pages that the user
can view will be returned.',
'type' => 'read',
'capabilities' => 'mod/page:view',
'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
),
)
const MOODLE_OFFICIAL_MOBILE_SERVICE
Moodle mobile app service name.
Definition: moodlelib.php:501

◆ $logs

$logs
Initial value:
= array(
array('module'=>'page', 'action'=>'view', 'mtable'=>'page', 'field'=>'name'),
array('module'=>'page', 'action'=>'view all', 'mtable'=>'page', 'field'=>'name'),
array('module'=>'page', 'action'=>'update', 'mtable'=>'page', 'field'=>'name'),
array('module'=>'page', 'action'=>'add', 'mtable'=>'page', 'field'=>'name'),
)