Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/messagelib.php File Reference

Go to the source code of this file.

Namespaces

namespace  core

Functions

 message_send ($eventdata)
 message_update_providers ($component='moodle')
 message_update_processors ($processorname)
 message_set_default_message_preference ($component, $messagename, $fileprovider, $processorname='')
 message_get_my_providers ()
 message_get_providers_for_user ($userid)
 message_get_providers_from_db ($component)
 message_get_providers_from_file ($component)
 message_provider_uninstall ($component)
 message_processor_uninstall ($name)

Function Documentation

Returns the active providers for the current user, based on capability

This function has been deprecated please use {

See also:
message_get_providers_for_user()} instead.
Deprecated:
since 2.1
Todo:
Remove in 2.2
Returns:
array of message providers

Definition at line 375 of file messagelib.php.

Here is the call graph for this function:

Returns the active providers for the user specified, based on capability

Parameters:
int$useridid of user
Returns:
array of message providers

Definition at line 386 of file messagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Gets the message providers that are in the database for this component.

Parameters:
$component- examples: 'moodle', 'mod/forum', 'block/quiz_results'
Returns:
array of message providers

INTERNAL - to be used from messagelib only

Definition at line 417 of file messagelib.php.

Here is the caller graph for this function:

Loads the messages definitions for the component (from file). If no messages are defined for the component, we simply return an empty array.

Parameters:
$component- examples: 'moodle', 'mod_forum', 'block_quiz_results'
Returns:
array of message providerss or empty array if not exists

INTERNAL - to be used from messagelib only

Definition at line 432 of file messagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Remove message processor

Parameters:
string$name- examples: 'email', 'jabber'
Returns:
void

Definition at line 475 of file messagelib.php.

Here is the caller graph for this function:

message_provider_uninstall ( component)

Remove all message providers for particular plugin and corresponding settings

Parameters:
string$component- examples: 'moodle', 'mod_forum', 'block_quiz_results'
Returns:
void

Definition at line 459 of file messagelib.php.

Here is the caller graph for this function:

message_send ( eventdata)

Called when a message provider wants to send a message. This functions checks the user's processor configuration to send the given type of message, then tries to send it.

Required parameter $eventdata structure: component string component name. must exist in message_providers name string message type name. must exist in message_providers userfrom object|int the user sending the message userto object|int the message recipient subject string the message subject fullmessage - the full message in a given format fullmessageformat - the format if the full message (FORMAT_MOODLE, FORMAT_HTML, ..) fullmessagehtml - the full version (the message processor will choose with one to use) smallmessage - the small version of the message contexturl - if this is a notification then you can specify a url to view the event. For example the forum post the user is being notified of. contexturlname - the display text for contexturl

Parameters:
object$eventdatainformation about the message (component, userfrom, userto, ...)
Returns:
int|false the ID of the new message or false if there was a problem with a processor

Definition at line 52 of file messagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

message_set_default_message_preference ( component,
messagename,
fileprovider,
processorname = '' 
)

Setting default messaging preference for particular message provider

Parameters:
string$componentThe name of component (e.g. moodle, mod_forum, etc.)
string$messagenameThe name of message provider
array$fileproviderThe value of $messagename key in the array defined in plugin messages.php
string$processornameThe optinal name of message processor
Returns:
void

Definition at line 302 of file messagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

message_update_processors ( processorname)

This function populates default message preferences for all existing providers when the new message processor is added.

Parameters:
string$processornameThe name of message processor plugin (e.g. 'email', 'jabber')
Returns:
void
Exceptions:
invalid_parameter_exceptionif $processorname does not exist

Definition at line 271 of file messagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

message_update_providers ( component = 'moodle')

This code updates the message_providers table with the current set of providers

Parameters:
$component- examples: 'moodle', 'mod_forum', 'block_quiz_results'
Returns:
boolean

Definition at line 213 of file messagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations