Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Files | Namespaces | Classes | Functions | Variables
report_log

Files

file  access.php
 Capabilities.
 
file  install.php
 Post installation and migration code.
 
file  lib.php
 Public API of the log report.
 
file  locallib.php
 This file contains functions used by the log reports.
 
file  provider.php
 Privacy Subsystem implementation for report_log.
 
file  renderable.php
 Log report renderer.
 
file  renderer.php
 Log report renderer.
 
file  report_viewed.php
 The report_log report viewed event.
 
file  settings.php
 Links and settings.
 
file  table_log.php
 Table log for displaying logs.
 
file  user_report_viewed.php
 The report_log user report viewed event.
 
file  version.php
 Version info.
 

Namespaces

 report_log\event
  
 
 report_log\privacy
  
 

Classes

class  report_log\event\report_viewed
 
class  report_log\event\user_report_viewed
 
class  report_log\privacy\provider
 Privacy Subsystem for report_log implementing null_provider. More...
 
class  report_log_renderable
 Report log renderable class. More...
 
class  report_log_renderer
 Report log renderer's for printing reports. More...
 
class  report_log_table_log
 Table log class for displaying logs. More...
 

Functions

 report_log_extend_navigation_course ($navigation, $course, $context)
 This function extends the navigation with the report items. More...
 
 report_log_extend_navigation_module ($navigation, $cm)
 This function extends the module navigation with the report items. More...
 
 report_log_extend_navigation_user ($navigation, $user, $course)
 This function extends the course navigation with the report items. More...
 
 report_log_myprofile_navigation (core_user\output\myprofile\tree $tree, $user, $iscurrentuser, $course)
 Add nodes to myprofile page. More...
 
 report_log_page_type_list ($pagetype, $parentcontext, $currentcontext)
 Return a list of page types. More...
 
stdClass report_log_print_graph ($course, $user, $typeormode, $date=0, $logreader='')
 This function is used to generate and display the log activity graph. More...
 
stdClass report_log_print_mnet_selector_form ($hostid, $course, $selecteduser=0, $selecteddate='today', $modname="", $modid=0, $modaction='', $selectedgroup=-1, $showcourses=0, $showusers=0, $logformat='showashtml')
 This function is used to generate and display Mnet selector form. More...
 
 report_log_supports_logstore ($instance)
 Callback to verify if the given instance of store is supported by this report or not. More...
 
 report_log_userall_data ($course, $user, $logreader)
 Fetch logs since the start of the courses and structure in series and labels to be sent to Chart API. More...
 
 report_log_usercourse ($userid, $courseid, $coursestart, $logreader='')
 Select all log records for a given course and user. More...
 
 report_log_userday ($userid, $courseid, $daystart, $logreader='')
 Select all log records for a given course, user, and day. More...
 
 report_log_usertoday_data ($course, $user, $date, $logreader)
 Fetch logs of the current day and structure in series and labels to be sent to Chart API. More...
 
moodle_database xmldb_report_log_install ()
 Contains codes to be run during installation of report/logs. More...
 

Variables

 $capabilities
 
 $settings = null
 
$plugin component = 'report_log'
 
 if (!defined( 'REPORT_LOG_MAX_DISPLAY'))
 
$plugin requires = 2019111200
 
$plugin version = 2019111800
 

Detailed Description

Function Documentation

◆ report_log_extend_navigation_course()

report_log_extend_navigation_course (   $navigation,
  $course,
  $context 
)

This function extends the navigation with the report items.

Parameters
navigation_node$navigationThe navigation node to extend
stdClass$courseThe course to object for the report
stdClass$contextThe context of the course

◆ report_log_extend_navigation_module()

report_log_extend_navigation_module (   $navigation,
  $cm 
)

This function extends the module navigation with the report items.

Parameters
navigation_node$navigationThe navigation node to extend
stdClass$cm

◆ report_log_extend_navigation_user()

report_log_extend_navigation_user (   $navigation,
  $user,
  $course 
)

This function extends the course navigation with the report items.

Parameters
navigation_node$navigationThe navigation node to extend
stdClass$user
stdClass$courseThe course to object for the report

◆ report_log_myprofile_navigation()

report_log_myprofile_navigation ( core_user\output\myprofile\tree  $tree,
  $user,
  $iscurrentuser,
  $course 
)

Add nodes to myprofile page.

Parameters
core_user\output\myprofile\tree$treeTree object
stdClass$useruser object
bool$iscurrentuser
stdClass$courseCourse object
Return values
bool

◆ report_log_page_type_list()

report_log_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
Return values
arraya list of page types

◆ report_log_print_graph()

stdClass report_log_print_graph (   $course,
  $user,
  $typeormode,
  $date = 0,
  $logreader = '' 
)

This function is used to generate and display the log activity graph.

$CFG

Parameters
stdClass$coursecourse instance
int | stdClass$userid/object of the user whose logs are needed
string$typeormodetype of logs graph needed (usercourse.png/userday.png) or the mode (today, all).
int$datetimestamp in GMT (seconds since epoch)
string$logreaderLog reader.
Return values
void

◆ report_log_print_mnet_selector_form()

stdClass report_log_print_mnet_selector_form (   $hostid,
  $course,
  $selecteduser = 0,
  $selecteddate = 'today',
  $modname = "",
  $modid = 0,
  $modaction = '',
  $selectedgroup = -1,
  $showcourses = 0,
  $showusers = 0,
  $logformat = 'showashtml' 
)

This function is used to generate and display Mnet selector form.

$USER @global stdClass $CFG @global stdClass $SITE @global moodle_database $DB @global core_renderer $OUTPUT @global stdClass $SESSION @uses CONTEXT_SYSTEM @uses COURSE_MAX_COURSES_PER_DROPDOWN @uses CONTEXT_COURSE @uses SEPARATEGROUPS

Parameters
int$hostidhost id
stdClass$coursecourse instance
int$selecteduserid of the selected user
string$selecteddateDate selected
string$modnamecourse_module->id
string$modidnumber or 'site_errors'
string$modactionan action as recorded in the logs
int$selectedgroupGroup to display
int$showcourseswhether to show courses if we're over our limit.
int$showuserswhether to show users if we're over our limit.
string$logformatFormat of the logs (downloadascsv, showashtml, downloadasods, downloadasexcel)
Return values
void

◆ report_log_supports_logstore()

report_log_supports_logstore (   $instance)

Callback to verify if the given instance of store is supported by this report or not.

Parameters
string$instancestore instance.
Return values
boolreturns true if the store is supported by the report, false otherwise.

◆ report_log_userall_data()

report_log_userall_data (   $course,
  $user,
  $logreader 
)

Fetch logs since the start of the courses and structure in series and labels to be sent to Chart API.

Parameters
stdClass$coursethe course object
stdClass$useruser object
string$logreaderthe log reader where the logs are.
Return values
arraystructured array to be sent to chart API, split in two indexes (series and labels).

◆ report_log_usercourse()

report_log_usercourse (   $userid,
  $courseid,
  $coursestart,
  $logreader = '' 
)

Select all log records for a given course and user.

Parameters
int$useridThe id of the user as found in the 'user' table.
int$courseidThe id of the course as found in the 'course' table.
string$coursestartunix timestamp representing course start date and time.
string$logreaderlog reader to use.
Return values
array

◆ report_log_userday()

report_log_userday (   $userid,
  $courseid,
  $daystart,
  $logreader = '' 
)

Select all log records for a given course, user, and day.

Parameters
int$useridThe id of the user as found in the 'user' table.
int$courseidThe id of the course as found in the 'course' table.
string$daystartunix timestamp of the start of the day for which the logs needs to be retrived
string$logreaderlog reader to use.
Return values
array

◆ report_log_usertoday_data()

report_log_usertoday_data (   $course,
  $user,
  $date,
  $logreader 
)

Fetch logs of the current day and structure in series and labels to be sent to Chart API.

Parameters
stdClass$coursethe course object
stdClass$useruser object
int$dateA time of a day (in GMT).
string$logreaderthe log reader where the logs are.
Return values
array::$logsstructured array to be sent to chart API, split in two indexes (series and labels).

◆ xmldb_report_log_install()

moodle_database xmldb_report_log_install ( )

Contains codes to be run during installation of report/logs.

$DB

Return values
void

Variable Documentation

◆ $capabilities

$capabilities
Initial value:
= array(
'report/log:view' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'coursereport/log:view',
),
'report/log:viewtoday' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'coursereport/log:viewtoday',
)
)
RISK_PERSONAL
const RISK_PERSONAL
Capability allows access to personal user information - see http://docs.moodle.org/dev/Hardening_new_...
Definition: accesslib.php:145
CONTEXT_COURSE
const CONTEXT_COURSE
Course context level - one instances for each course.
Definition: accesslib.php:128
CAP_ALLOW
const CAP_ALLOW
Allow permission, overrides CAP_PREVENT defined in parent contexts.
Definition: accesslib.php:115