function notifications_content_node_event_enabled in Notifications 7
Check whether a specific event type is enabled for this node type
Parameters
$action: Action name: 'post', 'update', 'comment'
$node: Node object or node type name
2 calls to notifications_content_node_event_enabled()
- notifications_content_form_comment_form_alter in notifications_content/
notifications_content.module - Implements hook_form_BASE_FORM_ID_alter().
- notifications_content_form_node_form_alter in notifications_content/
notifications_content.module - Implements hook_form_BASE_FORM_ID_alter().
File
- notifications_content/
notifications_content.module, line 547 - Subscriptions to content events
Code
function notifications_content_node_event_enabled($action, $node) {
$type = is_object($node) ? $node->type : $node;
if (!notifications_content_type_enabled($type)) {
// If not enabled subscriptions to this content type, we assume not enabled events either
return FALSE;
}
elseif (notifications_event_type('node-' . $type . '-' . $action)) {
return notifications_event_enabled('node-' . $type . '-' . $action);
}
else {
return notifications_event_enabled('node-' . $action);
}
}