function subscriptions_content_form_alter in Subscriptions 6
Same name and namespace in other branches
- 5.2 subscriptions_content.module \subscriptions_content_form_alter()
- 7 subscriptions_content.module \subscriptions_content_form_alter()
- 2.0.x subscriptions_content/subscriptions_content.module \subscriptions_content_form_alter()
Implementation of hook_form_alter().
Add the Send Subscriptions Notifications checkbox to the Publishing Options fieldset on the node edit form.
File
- ./
subscriptions_content.module, line 432 - Subscriptions to content events
Code
function subscriptions_content_form_alter(&$form, &$form_state, $form_id) {
global $user;
if (isset($form['type']['#value']) && $form['type']['#value'] . '_node_form' == $form_id) {
if (isset($form['options'])) {
$tr = 't';
$form['options']['subscriptions_notify'] = array(
'#type' => 'checkbox',
'#title' => t('Send subscriptions notifications'),
'#description' => t('You may want to turn this OFF when you only change %Promoted_to_front_page or %Sticky_at_top_of_lists, otherwise Subscriptions will send out "update" notifications; this option is not saved.<br />Subscriptions does not send notifications for unpublished nodes (except to users who have the %administer_nodes permission), but when you set %Published to ON, Subscriptions will send out "new" notifications, unless you turn this off here.', array(
'%Promoted_to_front_page' => $tr('Promoted to front page'),
'%Sticky_at_top_of_lists' => $tr('Sticky at top of lists'),
'%administer_nodes' => $tr('administer nodes'),
'%Published' => $tr('Published'),
)),
'#weight' => 5,
'#default_value' => isset($form['#node']->subscriptions_notify) ? $form['#node']->subscriptions_notify : TRUE,
);
}
}
}