summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
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/comment/comment.module
parent9c0e6e92426a061f78e6dfe685c7c37c7f72bc62 (diff)
downloadbrdo-84afe0d9275834a716edd826e8224e40cafa3746.tar.gz
brdo-84afe0d9275834a716edd826e8224e40cafa3746.tar.bz2
#545306 by alexanderpas: De-op hook_node_type().
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module56
1 files changed, 28 insertions, 28 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 06f13dea1..1681f7ea6 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -211,38 +211,38 @@ function comment_fieldable_info() {
return $return;
}
-
/**
- * Implement hook_node_type().
+ * Implement hook_node_type_insert().
*/
-function comment_node_type($op, $info) {
- switch ($op) {
- case 'insert':
- field_attach_create_bundle('comment_node_' . $info->type);
- break;
+function comment_node_type_insert($info) {
+ field_attach_create_bundle('comment_node_' . $info->type);
+}
- case 'update':
- if (!empty($info->old_type) && $info->type != $info->old_type) {
- field_attach_rename_bundle('comment_node_' . $info->old_type, 'comment_node_' . $info->type);
- }
- break;
+/**
+ * Implement hook_node_type_update().
+ */
+function comment_node_type_update($info) {
+ if (!empty($info->old_type) && $info->type != $info->old_type) {
+ field_attach_rename_bundle('comment_node_' . $info->old_type, 'comment_node_' . $info->type);
+ }
+}
- case 'delete':
- field_attach_delete_bundle('comment_node_' . $info->type);
-
- $settings = array(
- 'comment',
- 'comment_default_mode',
- 'comment_default_per_page',
- 'comment_anonymous',
- 'comment_subject_field',
- 'comment_preview',
- 'comment_form_location',
- );
- foreach ($settings as $setting) {
- variable_del($setting . '_' . $info->type);
- }
- break;
+/**
+ * Implement hook_node_type_delete().
+ */
+function comment_node_type_delete($info) {
+ field_attach_delete_bundle('comment_node_' . $info->type);
+ $settings = array(
+ 'comment',
+ 'comment_default_mode',
+ 'comment_default_per_page',
+ 'comment_anonymous',
+ 'comment_subject_field',
+ 'comment_preview',
+ 'comment_form_location',
+ );
+ foreach ($settings as $setting) {
+ variable_del($setting . '_' . $info->type);
}
}