﻿Index: node_limit.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_limit/node_limit.module,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 node_limit.module
--- node_limit.module	9 Apr 2009 04:49:56 -0000	1.1.2.2
+++ node_limit.module	9 Apr 2009 18:52:22 -0000
@@ -96,6 +96,24 @@
 }
 
 /**
+ * Implementation of hook_node_type().
+ *
+ * Delete all rules related to the node type being deleted.
+ */
+function node_limit_node_type($op, $type) {
+  switch ($op) {
+    case 'delete':
+      $sql = "DELETE FROM {node_limit} WHERE type = '%s'";
+      db_query($sql, $type->type);
+      $num = db_affected_rows();
+      if ($num > 0) {
+        drupal_set_message(t('Deleted !num limit rules.', array('!num' => $num)));
+      }
+      break;
+  }
+}
+
+/**
  * returns t/f depending on whther the $node violates a limit
  * always returns false for user 1
  */
