Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Files | |
file | access.php |
Plugin capabilities. | |
file | activity.php |
Search area for mod_chat activities. | |
file | activity_base.php |
Activity base class. | |
file | backup_chat_activity_task.class.php |
Defines backup_chat_activity_task class. | |
file | backup_chat_stepslib.php |
@subpackage backup-moodle2 | |
file | cognitive_depth.php |
Cognitive depth indicator - chat. | |
file | course_module_instance_list_viewed.php |
The mod_chat instance list viewed event. | |
file | course_module_viewed.php |
The mod_chat course module viewed event. | |
file | cron_task.php |
A scheduled task for chat cron. | |
file | events.php |
Event observers definition. | |
file | external.php |
Chat external API. | |
file | lib.php |
Library of functions and constants for module chat. | |
file | lib.php |
Provides support for the conversion of moodle1 backup to the moodle2 format Based off of a template @ http://docs.moodle.org/dev/Backup_1.9_conversion_for_developers. | |
file | locallib.php |
Library of functions for chat outside of the core api. | |
file | log.php |
Definition of log events. | |
file | provider.php |
Data provider. | |
file | renderer.php |
Chat module rendering methods. | |
file | restore_chat_activity_task.class.php |
@subpackage backup-moodle2 | |
file | restore_chat_stepslib.php |
@subpackage backup-moodle2 | |
file | services.php |
Chat external functions and service definitions. | |
file | sessions_viewed.php |
The mod_chat sessions viewed event. | |
file | social_breadth.php |
Social breadth indicator - chat. | |
file | tasks.php |
Definition of chat scheduled tasks. | |
file | upgrade.php |
Upgrade code for the chat activity. | |
file | version.php |
Version information. | |
Namespaces | |
mod_chat\analytics\indicator | |
| |
mod_chat\event | |
| |
mod_chat\external | |
| |
mod_chat\privacy | |
| |
mod_chat\search | |
| |
mod_chat\task | |
| |
Classes | |
class | backup_chat_activity_structure_step |
Define all the backup steps that will be used by the backup_chat_activity_task. More... | |
class | backup_chat_activity_task |
Provides the steps to perform one complete backup of the Chat instance. More... | |
class | chat_portfolio_caller |
class | event_message |
A chat event such a user entering or leaving a chat activity. More... | |
class | mod_chat\analytics\indicator\activity_base |
Activity base class. More... | |
class | mod_chat\analytics\indicator\cognitive_depth |
Cognitive depth indicator - chat. More... | |
class | mod_chat\analytics\indicator\social_breadth |
Social breadth indicator - chat. More... | |
class | mod_chat\event\course_module_instance_list_viewed |
The mod_chat instance list viewed event class. More... | |
class | mod_chat\event\course_module_viewed |
The mod_chat course module viewed event class. More... | |
class | mod_chat\event\message_sent |
The mod_chat message sent event class. More... | |
class | mod_chat\event\sessions_viewed |
class | mod_chat\external\chat_message_exporter |
Class for exporting a chat message. More... | |
class | mod_chat\privacy\provider |
Data provider class. More... | |
class | mod_chat\search\activity |
Search area for mod_chat activities. More... | |
class | mod_chat\task\cron_task |
The main schedule task for the chat module. More... | |
class | mod_chat_external |
class | mod_chat_renderer |
Chat module renderer class. More... | |
class | moodle1_mod_chat_handler |
Chat conversion handler. More... | |
class | restore_chat_activity_structure_step |
Define all the restore steps that will be used by the restore_chat_activity_task. More... | |
class | restore_chat_activity_task |
chat restore task that provides all the settings and steps to perform one complete restore of the activity More... | |
class | user_message |
A chat message from a user. More... | |
Functions | |
object | chat_add_instance ($chat) |
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will create a new instance and return the id number of the new instance. More... | |
object | chat_delete_instance ($id) |
Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it. More... | |
object | chat_delete_old_users () |
Delete the old and in the way. More... | |
chat_extend_navigation ($navigation, $course, $module, $cm) | |
chat_extend_settings_navigation (settings_navigation $settings, navigation_node $chatnode) | |
Adds module specific settings to the settings block. More... | |
object | chat_format_message ($message, $courseid, $currentuser, $chatlastrow=null) |
Given a message object this function formats it appropriately into text and html then returns the formatted data. More... | |
object | chat_format_message_manually ($message, $courseid, $sender, $currentuser, $chatlastrow=null) |
@global object More... | |
object | chat_format_message_theme ($message, $chatuser, $currentuser, $groupingid, $theme='bubble') |
object | chat_format_userlist ($users, $course) |
$DB @global object $CFG @global object $COURSE @global object $OUTPUT More... | |
object | chat_get_latest_message ($chatid, $groupid=0) |
chat_get_latest_messages ($chatuser, $chatlasttime) | |
Return a list of the latest messages in the given chat session. More... | |
chat_get_post_actions () | |
List the actions that correspond to a post of this module. More... | |
chat_get_session_messages ($chatid, $group=false, $start=0, $end=0, $sort='') | |
Return the messages of the given chat session. More... | |
chat_get_sessions ($messages, $showall=false) | |
Given a set of messages for a chat, return the completed chat sessions (including optionally not completed ones). More... | |
object | chat_get_users ($chatid, $groupid=0, $groupingid=0) |
chat_get_view_actions () | |
List the actions that correspond to a view of this module. More... | |
object | chat_login_user ($chatid, $version, $groupid, $course) |
login if not already logged in More... | |
chat_page_type_list ($pagetype, $parentcontext, $currentcontext) | |
Return a list of page types. More... | |
chat_prepare_update_events ($chat, $cm=null) | |
Updates both the normal and completion calendar events for chat. More... | |
chat_print_error ($level, $msg) | |
Print json format error. More... | |
chat_print_overview () | |
object | chat_print_recent_activity ($course, $viewfullnames, $timestart) |
Given a course and a date, prints a summary of all chat rooms past and present This function is called from block_recent_activity. More... | |
object | chat_refresh_events ($courseid=0, $instance=null, $cm=null) |
This standard function will check all instances of this module and make sure there are up-to-date events created for each of them. More... | |
chat_reset_course_form_defaults ($course) | |
Course reset form defaults. More... | |
chat_reset_course_form_definition (&$mform) | |
Implementation of the function for printing the form elements that control whether the course reset functionality affects the chat. More... | |
object | chat_reset_userdata ($data) |
Actual implementation of the reset course functionality, delete all the chat messages for course $data->courseid. More... | |
chat_send_chatmessage ($chatuser, $messagetext, $issystem=false, $cm=null) | |
Send a message on the chat. More... | |
chat_supports ($feature) | |
object | chat_update_chat_times ($chatid=0) |
Updates chat records so that the next chat time is correct. More... | |
object | chat_update_instance ($chat) |
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data. More... | |
chat_user_logout (\core\event\user_loggedout $event) | |
user logout event handler More... | |
chat_view ($chat, $course, $cm, $context) | |
Mark the activity completed (if required) and trigger the course_module_viewed event. More... | |
mod_chat_core_calendar_provide_event_action (calendar_event $event, core_calendar\action_factory $factory, int $userid=0) | |
This function receives a calendar event and returns the action associated with it, or null if there is none. More... | |
padding ($n) | |
xmldb_chat_upgrade ($oldversion) | |
Variables | |
$capabilities | |
global | $CHAT_DUMMY_DATA = padding(200) |
global | $CHAT_HTMLHEAD |
$CHAT_HTMLHEAD_JS = | |
$CHAT_HTMLHEAD_MSGINPUT | |
$CHAT_HTMLHEAD_MSGINPUT_JS = | |
global | $CHAT_HTMLHEAD_OUT |
$functions | |
$logs | |
$observers | |
$tasks | |
const | CHAT_EVENT_TYPE_CHATTIME 'chattime' |
const | CHAT_SESSION_GAP 300 |
$plugin | component = 'mod_chat' |
$plugin | requires = 2019111200 |
$plugin | version = 2019111800 |
object chat_add_instance | ( | $chat | ) |
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will create a new instance and return the id number of the new instance.
object | $chat |
int |
object chat_delete_instance | ( | $id | ) |
Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.
int | $id |
bool |
object chat_delete_old_users | ( | ) |
Delete the old and in the way.
@global object
chat_extend_settings_navigation | ( | settings_navigation | $settings, |
navigation_node | $chatnode | ||
) |
Adds module specific settings to the settings block.
settings_navigation | $settings | The settings navigation object |
navigation_node | $chatnode | The node to add module settings to |
object chat_format_message | ( | $message, | |
$courseid, | |||
$currentuser, | |||
$chatlastrow = null |
|||
) |
Given a message object this function formats it appropriately into text and html then returns the formatted data.
object | $message | |
int | $courseid | |
object | $currentuser | |
string | $chatlastrow |
bool|string | Returns HTML or false |
object chat_format_message_manually | ( | $message, | |
$courseid, | |||
$sender, | |||
$currentuser, | |||
$chatlastrow = null |
|||
) |
@global object
object | $message | |
int | $courseid | |
object | $sender | |
object | $currentuser | |
string | $chatlastrow |
bool|string | Returns HTML or false |
object chat_format_message_theme | ( | $message, | |
$chatuser, | |||
$currentuser, | |||
$groupingid, | |||
$theme = 'bubble' |
|||
) |
object | $message | message to be displayed. |
mixed | $chatuser | user chat data |
object | $currentuser | current user for whom the message should be displayed. |
int | $groupingid | course module grouping id |
string | $theme | name of the chat theme. |
bool|string | Returns HTML or false |
object chat_format_userlist | ( | $users, | |
$course | |||
) |
$DB @global object $CFG @global object $COURSE @global object $OUTPUT
object | $users | |
object | $course |
array | return formatted user list |
object chat_get_latest_message | ( | $chatid, | |
$groupid = 0 |
|||
) |
int | $chatid | |
int | $groupid |
array |
chat_get_latest_messages | ( | $chatuser, | |
$chatlasttime | |||
) |
Return a list of the latest messages in the given chat session.
stdClass | $chatuser | chat user session data |
int | $chatlasttime | last time messages were retrieved |
array | list of messages |
chat_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.
array |
chat_get_session_messages | ( | $chatid, | |
$group = false , |
|||
$start = 0 , |
|||
$end = 0 , |
|||
$sort = '' |
|||
) |
Return the messages of the given chat session.
int | $chatid | the chat id |
mixed | $group | false if groups not used, int if groups used, 0 means all groups |
int | $start | the session start timestamp (0 to not filter by time) |
int | $end | the session end timestamp (0 to not filter by time) |
string | $sort | an order to sort the results in (optional, a valid SQL ORDER BY parameter) |
array | session messages |
chat_get_sessions | ( | $messages, | |
$showall = false |
|||
) |
Given a set of messages for a chat, return the completed chat sessions (including optionally not completed ones).
array | $messages | list of messages from a chat. It is assumed that these are sorted by timestamp in DESCENDING order. |
bool | $showall | whether to include incomplete sessions or not |
array | the list of sessions |
object chat_get_users | ( | $chatid, | |
$groupid = 0 , |
|||
$groupingid = 0 |
|||
) |
int | $chatid | |
int | $groupid | |
int | $groupingid |
array |
chat_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.
array |
object chat_login_user | ( | $chatid, | |
$version, | |||
$groupid, | |||
$course | |||
) |
login if not already logged in
@global object
int | $chatid | |
string | $version | |
int | $groupid | |
object | $course |
bool|int | Returns the chat users sid or false |
chat_page_type_list | ( | $pagetype, | |
$parentcontext, | |||
$currentcontext | |||
) |
Return a list of page types.
string | $pagetype | current page type |
stdClass | $parentcontext | Block's parent context |
stdClass | $currentcontext | Current context of block |
chat_prepare_update_events | ( | $chat, | |
$cm = null |
|||
) |
Updates both the normal and completion calendar events for chat.
stdClass | $chat | The chat object (from the DB) |
stdClass | $cm | The course module object. |
chat_print_error | ( | $level, | |
$msg | |||
) |
Print json format error.
string | $level | |
string | $msg |
chat_print_overview | ( | ) |
object chat_print_recent_activity | ( | $course, | |
$viewfullnames, | |||
$timestart | |||
) |
Given a course and a date, prints a summary of all chat rooms past and present This function is called from block_recent_activity.
@global object @global object
object | $course | |
bool | $viewfullnames | |
int | string | $timestart | Timestamp |
bool |
object chat_refresh_events | ( | $courseid = 0 , |
|
$instance = null , |
|||
$cm = null |
|||
) |
This standard function will check all instances of this module and make sure there are up-to-date events created for each of them.
If courseid = 0, then every chat event in the site is checked, else only chat events belonging to the course specified are checked. This function is used, in its new format, by restore_refresh_events()
int | $courseid | |
int | stdClass | $instance | Chat module instance or ID. |
int | stdClass | $cm | Course module object or ID. |
bool |
chat_reset_course_form_defaults | ( | $course | ) |
Course reset form defaults.
object | $course |
array |
chat_reset_course_form_definition | ( | & | $mform | ) |
Implementation of the function for printing the form elements that control whether the course reset functionality affects the chat.
object | $mform | form passed by reference |
object chat_reset_userdata | ( | $data | ) |
Actual implementation of the reset course functionality, delete all the chat messages for course $data->courseid.
@global object
object | $data | the data submitted from the reset course. |
array | status array |
chat_send_chatmessage | ( | $chatuser, | |
$messagetext, | |||
$issystem = false , |
|||
$cm = null |
|||
) |
Send a message on the chat.
object | $chatuser | The chat user record. |
string | $messagetext | The message to be sent. |
bool | $issystem | False for non-system messages, true for system messages. |
object | $cm | The course module object, pass it to save a database query when we trigger the event. |
int | The message ID. |
chat_supports | ( | $feature | ) |
string | $feature | FEATURE_xx constant for requested feature |
mixed | True if module supports feature, null if doesn't know |
object chat_update_chat_times | ( | $chatid = 0 | ) |
Updates chat records so that the next chat time is correct.
int | $chatid |
void |
object chat_update_instance | ( | $chat | ) |
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data.
object | $chat |
bool |
chat_user_logout | ( | \core\event\user_loggedout | $event | ) |
user logout event handler
core\event\user_loggedout | $event | The event. |
void |
chat_view | ( | $chat, | |
$course, | |||
$cm, | |||
$context | |||
) |
Mark the activity completed (if required) and trigger the course_module_viewed event.
stdClass | $chat | chat object |
stdClass | $course | course object |
stdClass | $cm | course module object |
stdClass | $context | context object |
mod_chat_core_calendar_provide_event_action | ( | calendar_event | $event, |
core_calendar\action_factory | $factory, | ||
int | $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.
calendar_event | $event | |
core_calendar\action_factory | $factory | |
int | $userid | User id to use for all capability checks, etc. Set to 0 for current user (default). |
core_calendar |
padding | ( | $n | ) |
int | $n |
string |
$CHAT_HTMLHEAD |
$CHAT_HTMLHEAD_MSGINPUT |
$CHAT_HTMLHEAD_OUT |
$logs |
$observers |
$tasks |