diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-10-07 19:25:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-10-07 19:25:57 +0000 |
commit | ca8e9a1e181ed29ab33fbd7a5d665710869e9d23 (patch) | |
tree | 2d20b49d34fda1122eca425efd7990ddb6c1eb03 /modules/comment/comment.install | |
parent | afb7bf85fe940afe86cd1899bd0dbd3d3212ade8 (diff) | |
download | brdo-ca8e9a1e181ed29ab33fbd7a5d665710869e9d23.tar.gz brdo-ca8e9a1e181ed29ab33fbd7a5d665710869e9d23.tar.bz2 |
- Patch #180432 by hunmonk, sun, et al: make comment settings per node type. This is a new feature that slipped in because it is required for the project module on drupal.org.
Diffstat (limited to 'modules/comment/comment.install')
-rw-r--r-- | modules/comment/comment.install | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 898016050..59bf81061 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -32,6 +32,32 @@ function comment_update_6001() { } /** + * Changed comment settings from global to per-node -- copy global + * settings to all node types. + */ +function comment_update_6002() { + $settings = array( + 'comment_default_mode' => COMMENT_MODE_THREADED_EXPANDED, + 'comment_default_order' => COMMENT_ORDER_NEWEST_FIRST, + 'comment_default_per_page' => 50, + 'comment_controls' => COMMENT_CONTROLS_HIDDEN, + 'comment_anonymous' => COMMENT_ANONYMOUS_MAYNOT_CONTACT, + 'comment_subject_field' => 1, + 'comment_preview' => COMMENT_PREVIEW_REQUIRED, + 'comment_form_location' => COMMENT_FORM_SEPARATE_PAGE, + ); + $types = node_get_types(); + foreach ($settings as $setting => $default) { + $value = variable_get($setting, $default); + foreach ($types as $type => $object) { + variable_set($setting .'_'. $type, $value); + } + variable_del($setting); + } + return array(); +} + +/** * Implementation of hook_schema(). */ function comment_schema() { |