Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Popup message processor

Copyright: 2008 Luis Rodrigues
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later
File Size: 143 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: message_output_popup  - X-Ref

The popup message processor

send_message($eventdata)   X-Ref
Adds notifications to the 'message_popup_notifications' table if applicable.

The reason for this is because we may not want to show all notifications in the notification popover. This
can happen if the popup processor was disabled when the notification was sent. If the processor is disabled this
function is never called so the notification will never be added to the 'message_popup_notifications' table.
Essentially this table is used to filter what notifications to display from the 'notifications' table.

param: object $eventdata the event data submitted by the message sender plus $eventdata->savedmessageid
return: true if ok, false if error

config_form($preferences)   X-Ref
Creates necessary fields in the messaging config form.

param: array $preferences An array of user preferences

process_form($form, &$preferences)   X-Ref
Parses the submitted form data and saves it into preferences array.

param: stdClass $form preferences form class
param: array $preferences preferences array

load_data(&$preferences, $userid)   X-Ref
Loads the config data from database to put on the form during initial form display

param: array $preferences preferences array
param: int $userid the user id

has_message_preferences()   X-Ref
Don't show this processor on the message preferences page. The user can't disable
the notifications for user-to-user messaging.

return: bool

force_process_messages()   X-Ref
Determines if this processor should process a message regardless of user preferences or site settings.

return: bool

cleanup_all_notifications(int $notificationdeletetime)   X-Ref
Remove all popup notifications up to specified time

param: int $notificationdeletetime
return: void

cleanup_read_notifications(int $notificationdeletetime)   X-Ref
Remove read popup notifications up to specified time

param: int $notificationdeletetime
return: void