You are here

function node_limit_type_node_type in Node Limit 6

Implementation of hook_user().

Delete all rules related to the node type being deleted.

File

node_limit_type/node_limit_type.module, line 13
Module to restrict the number of nodes by content type.

Code

function node_limit_type_node_type($op, $info) {
  switch ($op) {
    case 'delete':
      $sql = "DELETE FROM {node_limit_type} WHERE type = '%s'";
      db_query($sql, $info->type);
      $num = db_affected_rows();
      if ($num > 0) {
        drupal_set_message(t('Deleted !num.', array(
          '!num' => format_plural((int) $num, '1 limit rule', '@count limit rules'),
        )));
      }
      break;
  }
}