function forward_js_submit in Forward 7.2
Same name and namespace in other branches
- 7.3 forward.module \forward_js_submit()
1 string reference to 'forward_js_submit'
- forward_form_alter in ./
forward.module - Implements hook_form_alter().
File
- ./
forward.module, line 1142
Code
function forward_js_submit($form, &$form_state) {
// If there were errors, need to re-display the form
if (form_get_errors()) {
return $form;
}
// Notify next page that a message is waiting - this is needed because Ajax can't set the message queue
$recipient_list = forward_recipient_list($form_state);
$_SESSION['forward_message_pending'] = $recipient_list['token'];
// Form passed validation, so redirect to a good landing page
$returnurl = isset($form['message']['path']['#value']) ? $form['message']['path']['#value'] : '';
$markup = '
<script type="text/javascript">
(function ($) {
$(document).ready(function() {
$.fn.colorbox.close();
window.location = "' . url($returnurl, array(
'absolute' => TRUE,
)) . '";
});
})(jQuery);
</script>';
// Return our markup.
$confirmation = array(
'#type' => 'markup',
'#markup' => $markup,
);
return $confirmation;
}