Index: subscriptions_content.install
===================================================================
--- subscriptions_content.install (revision 871)
+++ subscriptions_content.install (working copy)
@@ -47,4 +47,6 @@
* Implementation of hook_uninstall().
*/
function subscriptions_content_uninstall() {
+ variable_del(SUBSCRIPTIONS_CONTENT_DEFAULT_SEND_NOTIFICATIONS_ON_NODE_INSERT);
+ variable_del(SUBSCRIPTIONS_CONTENT_DEFAULT_SEND_NOTIFICATIONS_ON_NODE_UPDATE);
}
Index: subscriptions_content.module
===================================================================
--- subscriptions_content.module (revision 871)
+++ subscriptions_content.module (working copy)
@@ -13,6 +13,9 @@
* by other Subscriptions submodules).
*/
+define('SUBSCRIPTIONS_CONTENT_DEFAULT_SEND_NOTIFICATIONS_ON_NODE_INSERT', 'subscriptions_content_default_send_notifications_on_node_insert');
+define('SUBSCRIPTIONS_CONTENT_DEFAULT_SEND_NOTIFICATIONS_ON_NODE_UPDATE', 'subscriptions_content_default_send_notifications_on_node_update');
+
/**
* Implementation of hook_subscriptions().
*
@@ -189,7 +192,9 @@
switch ($op) {
case 'prepare':
$unpublished_nid = ($node->status ? NULL : $node->nid);
- $node->subscriptions_notify = TRUE;
+ $node->subscriptions_notify = (boolean) variable_get(($node->status
+ ? SUBSCRIPTIONS_CONTENT_DEFAULT_SEND_NOTIFICATIONS_ON_NODE_UPDATE
+ : SUBSCRIPTIONS_CONTENT_DEFAULT_SEND_NOTIFICATIONS_ON_NODE_INSERT), 1);
break;
case 'update':
@@ -370,6 +375,23 @@
'#description' => t('Nodes of %Static_content_types may end up with no %Subscribe options at all. Turn this option on to avoid displaying %Subscribe links in this case. The default is OFF, because this option causes processing overhead for each node view operation.', array('%Static_content_types' => t('Static content types'), '%Subscribe' => t('Subscribe'))),
);
+ $variables = array(
+ '%Send_subscriptions_notifications' => t('Send subscriptions notifications'),
+ 'NOTE' => t('The %Publishing_options are available only to users who have the %administer_nodes permission; for other users, notifications are always sent.', array('%Publishing_options' => $tr('Publishing options'), '%administer_nodes' => $tr('administer nodes'))),
+ );
+ $form['content'][SUBSCRIPTIONS_CONTENT_DEFAULT_SEND_NOTIFICATIONS_ON_NODE_INSERT] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Send notifications on administrator node inserts by default'),
+ '#default_value' => variable_get(SUBSCRIPTIONS_CONTENT_DEFAULT_SEND_NOTIFICATIONS_ON_NODE_INSERT, 1),
+ '#description' => t('Sets the default value of the %Send_subscriptions_notifications checkbox on the node form when creating a node. Default is ON.', $variables) .'
'. $variables['NOTE'],
+ );
+ $form['content'][SUBSCRIPTIONS_CONTENT_DEFAULT_SEND_NOTIFICATIONS_ON_NODE_UPDATE] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Send notifications on administrator node updates by default'),
+ '#default_value' => variable_get(SUBSCRIPTIONS_CONTENT_DEFAULT_SEND_NOTIFICATIONS_ON_NODE_UPDATE, 1),
+ '#description' => t('Sets the default value of the %Send_subscriptions_notifications checkbox on the node form when updating a node. Default is ON.', $variables) .'
'. $variables['NOTE'],
+ );
+
$form['content']['subscriptions_generate_full_node'] = array(
'#type' => 'checkbox',
'#title' => t('Generate the %full_node variable', array('%full_node' => '!full_node')),