function notifications_messaging in Notifications 6.4
Same name and namespace in other branches
- 5 notifications.module \notifications_messaging()
- 6 notifications.module \notifications_messaging()
- 6.2 notifications.module \notifications_messaging()
- 6.3 notifications.module \notifications_messaging()
- 7 notifications.module \notifications_messaging()
Implementation of hook_messaging()
This hook provides information about the mensaje templates this module uses and related tokens.
Depending on $op, this hook takes different parameters and returns different pieces of information:
- 'message groups' Get array of message groups, each of which will have one or more keys for different templates Each group should have a unique key, so it should start with the module name
- 'message keys' Get message template parts for a given group ($arg1) Return array of key => name for each part
- 'messages' Get default message templates for a given group ($arg1). It should return default texts, indexed by message key that will be the default templates These templates may be edited on the 'Messaging templates' page
- 'tokens' Get available tokens for a given message group and key ($arg1). Return array of token keys that will be available for this message templates The tokens themselves may be default tokens (provided by token module) or we can add new tokens implementing hook_token_list() and hook_token_value()
Parameters
$op: Operation, type of information to retrieve
$arg1, $arg2...: Different parameters depending on $op
File
- ./
notifications.module, line 1228 - Notifications module
Code
function notifications_messaging($op, $arg1 = NULL, $arg2 = NULL) {
switch ($op) {
case 'message types':
$info['notifications'] = array(
'name' => t('Notifications'),
'description' => t('Messages coming from user subscriptions and system events'),
);
return $info;
case 'message groups':
case 'message keys':
case 'messages':
case 'tokens':
notifications_include('templates.inc');
return notifications_messaging_templates($op, $arg1, $arg2);
case 'method update':
// A messaging method has been disabled ($arg1) and replaced by the new one ($arg2)
notifications_include('destination.inc');
notifications_destination_method_replace($arg1, $arg2);
break;
}
}