Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
report_log

Namespaces

namespace  report_log\event
  
 
namespace  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.
 
 report_log_extend_navigation_module ($navigation, $cm)
 This function extends the module navigation with the report items.
 
 report_log_extend_navigation_user ($navigation, $user, $course)
 This function extends the course navigation with the report items.
 
 report_log_myprofile_navigation (core_user\output\myprofile\tree $tree, $user, $iscurrentuser, $course)
 Add nodes to myprofile page.
 
 report_log_page_type_list ($pagetype, $parentcontext, $currentcontext)
 Return a list of page types.
 
stdClass report_log_print_graph ($course, $user, $typeormode, $date=0, $logreader='')
 This function is used to generate and display the log activity graph.
 
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.
 
 report_log_supports_logstore ($instance)
 Callback to verify if the given instance of store is supported by this report or not.
 
 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.
 
 report_log_usercourse ($userid, $courseid, $coursestart, $logreader='')
 Select all log records for a given course and user.
 
 report_log_userday ($userid, $courseid, $daystart, $logreader='')
 Select all log records for a given course, user, and day.
 
 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.
 
moodle_database xmldb_report_log_install ()
 Contains codes to be run during installation of report/logs.
 

Variables

 $capabilities
 
global $CFG
 
 $plugin = 2024041600
 
 $settings = null
 
$plugin component = 'report_log'
 
 if (!defined( 'REPORT_LOG_MAX_DISPLAY'))
 
$plugin version = 2024042200
 

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',
)
)
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_PERSONAL
Capability allows access to personal user information - see
Definition accesslib.php:145