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 (form_get_errors()) {
return $form;
}
$recipient_list = forward_recipient_list($form_state);
$_SESSION['forward_message_pending'] = $recipient_list['token'];
$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>';
$confirmation = array(
'#type' => 'markup',
'#markup' => $markup,
);
return $confirmation;
}