function subscriptions_content_form_node_type_form_alter in Subscriptions 7
Same name and namespace in other branches
- 6 subscriptions_content.module \subscriptions_content_form_node_type_form_alter()
- 2.0.x subscriptions_content/subscriptions_content.module \subscriptions_content_form_node_type_form_alter()
Implements hook_form_alter().
Adds the 'Send subscriptions notifications' to the Workflow settings on admin/content/types/CONTENT_TYPE,
_state
Parameters
array $form:
File
- ./
subscriptions_content.module, line 440 - Subscriptions to content events
Code
function subscriptions_content_form_node_type_form_alter(array &$form, array &$form_state) {
$tr = 't';
$form['workflow']['subscriptions_workflow'] = array(
'#type' => 'select',
'#title' => t('Default %Send_subscriptions_notifications options for', array(
'%Send_subscriptions_notifications' => t('Send subscriptions notifications'),
)),
'#default_value' => subscriptions_content_get_default_workflow($form['#node_type']->type),
'#options' => array(
'n_new' => t('New nodes'),
'n_unpub' => t('Unpublished nodes (as new)'),
'n_pub' => t('Published nodes (as update)'),
'c_new' => t('New comments'),
'c_unpub' => t('Unpublished comments (as new)'),
'c_pub' => t('Published comments (as update)'),
),
'#multiple' => TRUE,
'#description' => t('Select all situations where generation of notifications should be ON.') . '<br />' . t('Items that are created in unpublished state create notifications to administrators only; when they are later published, "new" notifications are generated.') . '<br />' . t('Users with the %administer_nodes / %administer_comments permissions will be able to override these options.', array(
'%administer_nodes' => $tr('administer nodes'),
'%administer_comments' => $tr('administer comments'),
)),
);
$form['#submit'][] = 'subscriptions_content_node_type_form_submit';
}