Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
message_output Class Reference

Base message processor class for extension by message processors. More...

Inheritance diagram for message_output:
message_output_airnotifier message_output_email

Public Member Functions

 can_send_to_any_users ()
 Returns true if message can be sent to fake/internal user as well.
 
 cleanup_all_notifications (int $notificationdeletetime)
 Allow processors to perform cleanup tasks for all notifications by overriding this method.
 
 cleanup_read_notifications (int $notificationdeletetime)
 Allow processors to perform cleanup tasks for read notifications by overriding this method.
 
 config_form ($preferences)
 Create necessary fields in the config form on the messaging preferences page.
 
 force_process_messages ()
 Determines if this processor should process a message regardless of user preferences or site settings.
 
 get_default_messaging_settings ()
 Returns the message processors default settings Should the processor be enabled in users by default? Is enabling it disallowed, permitted or forced?
 
 has_message_preferences ()
 Returns true if this processor has configurable message preferences.
 
 is_system_configured ()
 Are the message processor's system settings configured?
 
 is_user_configured ($user=null)
 Are the message processor's user specific settings configured?
 
 load_data (&$preferences, $userid)
 Load the config data from database to put on the config form on the messaging preferences page.
 
 process_form ($form, &$preferences)
 Parse the submitted form and save data into an array of user preferences.
 
 send_message ($message)
 Process a message received by a user.
 

Detailed Description

Base message processor class for extension by message processors.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ can_send_to_any_users()

message_output::can_send_to_any_users ( )

Returns true if message can be sent to fake/internal user as well.

If message_output support message to be sent to fake user, then it should return true, like email.

Return values
bool

Reimplemented in message_output_email.

◆ cleanup_all_notifications()

message_output::cleanup_all_notifications ( int $notificationdeletetime)

Allow processors to perform cleanup tasks for all notifications by overriding this method.

Since
Moodle 3.9
Parameters
int$notificationdeletetime
Return values
void

◆ cleanup_read_notifications()

message_output::cleanup_read_notifications ( int $notificationdeletetime)

Allow processors to perform cleanup tasks for read notifications by overriding this method.

Since
Moodle 3.9
Parameters
int$notificationdeletetime
Return values
void

◆ config_form()

message_output::config_form ( $preferences)
abstract

Create necessary fields in the config form on the messaging preferences page.

Parameters
array$preferencesAn array of user preferences

Reimplemented in message_output_airnotifier, and message_output_email.

◆ force_process_messages()

message_output::force_process_messages ( )

Determines if this processor should process a message regardless of user preferences or site settings.

Return values
bool

◆ get_default_messaging_settings()

message_output::get_default_messaging_settings ( )

Returns the message processors default settings Should the processor be enabled in users by default? Is enabling it disallowed, permitted or forced?

Return values
intThe Default message output settings expressed as a bit mask MESSAGE_DEFAULT_ENABLED + MESSAGE_PERMITTED

Reimplemented in message_output_email.

◆ has_message_preferences()

message_output::has_message_preferences ( )

Returns true if this processor has configurable message preferences.

This is distinct from notification preferences.

Return values
bool

◆ is_system_configured()

message_output::is_system_configured ( )

Are the message processor's system settings configured?

Return values
boolTrue if all necessary config settings been entered

Reimplemented in message_output_airnotifier.

◆ is_user_configured()

message_output::is_user_configured ( $user = null)

Are the message processor's user specific settings configured?

Parameters
stdClass$userthe user object, defaults to $USER.
Return values
boolTrue if the user has all necessary settings in their messaging preferences

◆ load_data()

message_output::load_data ( & $preferences,
$userid )
abstract

Load the config data from database to put on the config form on the messaging preferences page.

Parameters
array$preferencesArray of user preferences
int$useridThe user ID

Reimplemented in message_output_airnotifier, and message_output_email.

◆ process_form()

message_output::process_form ( $form,
& $preferences )
abstract

Parse the submitted form and save data into an array of user preferences.

Parameters
stdClass$formpreferences form class
array$preferencespreferences array

Reimplemented in message_output_airnotifier, and message_output_email.

◆ send_message()

message_output::send_message ( $message)
abstract

Process a message received by a user.

See also
message_send()
Parameters
stdClass$messageThe event data submitted by the message provider to message_send() plus $eventdata->savedmessageid

Reimplemented in message_output_airnotifier, and message_output_email.


The documentation for this class was generated from the following file: