function notifications_subscription_destination_subform_submit in Notifications 6.4
Same name and namespace in other branches
- 7 notifications_account/notifications_account.module \notifications_subscription_destination_subform_submit()
Create submitted destination
1 string reference to 'notifications_subscription_destination_subform_submit'
- notifications_subscription_destination_subform in ./
notifications.module - Add destination subform
File
- ./
notifications.module, line 532 - Notifications module
Code
function notifications_subscription_destination_subform_submit($form, &$form_state) {
notifications_include('destination.inc');
// Get destination from form and add method / destination to form values
$dest = notifications_destination_parse_submitted($form_state['values'], FALSE);
if ($destination = Messaging_Destination::create($dest)) {
$form_state['values']['send_method'] = $dest['method'];
$form_state['values']['destination'] = $destination;
$form_state['values']['subscription_fields'][] = 'send_method';
$form_state['values']['subscription_fields'][] = 'destination';
}
else {
// We should have trapped this on validation. Just in case print an error message.
drupal_set_message(t('Cannot create a destination for this subscription.'), 'error');
}
}