summaryrefslogtreecommitdiff
path: root/modules/node/node.api.php
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-11 15:50:56 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-11 15:50:56 +0000
commit84afe0d9275834a716edd826e8224e40cafa3746 (patch)
tree120beeede2cb7ad5d220927ba1aae56e44a98ad7 /modules/node/node.api.php
parent9c0e6e92426a061f78e6dfe685c7c37c7f72bc62 (diff)
downloadbrdo-84afe0d9275834a716edd826e8224e40cafa3746.tar.gz
brdo-84afe0d9275834a716edd826e8224e40cafa3746.tar.bz2
#545306 by alexanderpas: De-op hook_node_type().
Diffstat (limited to 'modules/node/node.api.php')
-rw-r--r--modules/node/node.api.php50
1 files changed, 30 insertions, 20 deletions
diff --git a/modules/node/node.api.php b/modules/node/node.api.php
index 818528082..24ccf1ffa 100644
--- a/modules/node/node.api.php
+++ b/modules/node/node.api.php
@@ -626,35 +626,45 @@ function hook_ranking() {
/**
+ * Act on node type creation.
+ *
+ * This hook allows modules to take action when a node type is created.
+ *
+ * @param $info
+ * The node type object which is being created.
+ */
+function hook_node_type_insert($info) {
+}
+
+/**
* Act on node type changes.
*
* This hook allows modules to take action when a node type is modified.
*
- * @param $op
- * What is being done to $info. Possible values:
- * - "delete"
- * - "insert"
- * - "update"
* @param $info
- * The node type object on which $op is being performed.
- */
-function hook_node_type($op, $info) {
-
- switch ($op) {
- case 'delete':
- variable_del('comment_' . $info->type);
- break;
- case 'update':
- if (!empty($info->old_type) && $info->old_type != $info->type) {
- $setting = variable_get('comment_' . $info->old_type, COMMENT_NODE_OPEN);
- variable_del('comment_' . $info->old_type);
- variable_set('comment_' . $info->type, $setting);
- }
- break;
+ * The node type object which is being modified.
+ */
+function hook_node_type_update($info) {
+ if (!empty($info->old_type) && $info->old_type != $info->type) {
+ $setting = variable_get('comment_' . $info->old_type, COMMENT_NODE_OPEN);
+ variable_del('comment_' . $info->old_type);
+ variable_set('comment_' . $info->type, $setting);
}
}
/**
+ * Act on node type deletion.
+ *
+ * This hook allows modules to take action when a node type is deleted.
+ *
+ * @param $info
+ * The node type object which is being deleted.
+ */
+function hook_node_type_delete($info) {
+ variable_del('comment_' . $info->type);
+}
+
+/**
* Define access restrictions.
*
* This hook allows node modules to limit access to the node types they