From 84afe0d9275834a716edd826e8224e40cafa3746 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 11 Aug 2009 15:50:56 +0000 Subject: #545306 by alexanderpas: De-op hook_node_type(). --- modules/comment/comment.module | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'modules/comment/comment.module') 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); } } -- cgit v1.2.3