You are here

function notifications_content_node_type in Notifications 6.2

Same name and namespace in other branches
  1. 5 notifications_content/notifications_content.module \notifications_content_node_type()
  2. 6.4 notifications_content/notifications_content.module \notifications_content_node_type()
  3. 6 notifications_content/notifications_content.module \notifications_content_node_type()
  4. 6.3 notifications_content/notifications_content.module \notifications_content_node_type()

Implementation of hook node_type

File

notifications_content/notifications_content.module, line 755
Subscriptions to content events

Code

function notifications_content_node_type($op, $info) {
  switch ($op) {
    case 'delete':

      // Remove all subscriptions for this node type
      notifications_delete_subscriptions(array(
        'event_type' => 'node',
      ), array(
        'type' => $info->type,
      ));
      break;
    case 'update':

      // When changing node type machine name, update all subscriptions
      if (!empty($info->old_type) && $info->old_type != $info->type) {
        db_query("UPDATE {notifications_fields} SET value = '%s' WHERE field = 'type' AND value = '%s'", $info->type, $info->old_type);
      }
      break;
  }
}