function _handle_form_submit in Shoutbox 7
Same name and namespace in other branches
- 7.2 shoutbox.module \_handle_form_submit()
1 string reference to '_handle_form_submit'
- shoutbox_add_form in ./shoutbox.module
- Generates form for adding shouts.
File
- ./shoutbox.module, line 633
- Shoutbox module displays a block for users to create short
messages for the whole site. Uses AHAH to update the
database and display content.
Code
function _handle_form_submit($form, $form_state) {
$error = form_get_errors();
drupal_get_messages();
if (!empty($error)) {
$errormsg = '';
foreach ($error as $msg) {
$errormsg .= $errormsg != '' ? '<br/>' . $msg : $msg;
}
$commands[] = ajax_command_invoke(NULL, "error_javascript_call");
$commands[] = ajax_command_html('#shoutbox-error', $errormsg);
$commands[] = ajax_command_invoke('#shoutbox-error', 'show');
if (module_exists('captcha')) {
}
return array(
'#type' => 'ajax',
'#commands' => $commands,
);
}
else {
$commands[] = ajax_command_invoke(NULL, "success_javascript_call");
return array(
'#type' => 'ajax',
'#commands' => $commands,
);
}
}