diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-11 15:50:56 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-11 15:50:56 +0000 |
commit | 84afe0d9275834a716edd826e8224e40cafa3746 (patch) | |
tree | 120beeede2cb7ad5d220927ba1aae56e44a98ad7 /modules/comment/comment.module | |
parent | 9c0e6e92426a061f78e6dfe685c7c37c7f72bc62 (diff) | |
download | brdo-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.module | 56 |
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); } } |