summaryrefslogtreecommitdiff
path: root/modules/comment/comment.install
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-10-07 19:25:57 +0000
committerDries Buytaert <dries@buytaert.net>2007-10-07 19:25:57 +0000
commitca8e9a1e181ed29ab33fbd7a5d665710869e9d23 (patch)
tree2d20b49d34fda1122eca425efd7990ddb6c1eb03 /modules/comment/comment.install
parentafb7bf85fe940afe86cd1899bd0dbd3d3212ade8 (diff)
downloadbrdo-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.install26
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() {