function notifications_nodetype_template in Notifications 6.4
Build single template
1 call to notifications_nodetype_template()
- notifications_nodetype_notifications_templates in notifications_nodetype/
notifications_nodetype.module - Implementation of hook_notifications_templates()
File
- notifications_nodetype/
notifications_nodetype.module, line 206 - Notifications content type extension
Code
function notifications_nodetype_template($type_info, $action) {
$variables = array(
'@name' => $type_info->name,
);
$type = $type_info->type;
$key = 'notifications-content-' . $type . ($action ? '-' . $action : '');
switch ($action) {
case 'insert':
$template = array(
'name' => t('Notifications for @name creation', $variables),
'description' => t('Notifications produced when a @name is created.', $variables),
'fallback' => 'notifications-event-node-insert',
);
break;
case 'update':
$template = array(
'name' => t('Notifications for @name updates', $variables),
'description' => t('Notifications produced when a @name is updated.', $variables),
'fallback' => 'notifications-event-node-update',
);
break;
case 'comment':
$template = array(
'name' => t('Notifications for @name comments', $variables),
'description' => t('Notifications produced when a comment is posted to a @name.', $variables),
'fallback' => 'notifications-event-node-comment',
);
break;
default:
$template = array(
'name' => t('Notifications for @name events', $variables),
'description' => t('Defaults for all notifications related to content of type @name.', $variables),
'fallback' => 'notifications-event-node',
);
break;
}
$template['module'] = 'notifications_nodetype';
return array(
$key => $template,
);
}