function messaging_admin_message_form_submit in Messaging 6.2
Same name and namespace in other branches
- 5 messaging.module \messaging_admin_message_form_submit()
- 6 messaging.admin.inc \messaging_admin_message_form_submit()
- 6.3 messaging.admin.inc \messaging_admin_message_form_submit()
Process and save message parts
File
- ./
messaging.admin.inc, line 217 - Messaging Framework - Admin UI
Code
function messaging_admin_message_form_submit($form, &$form_state) {
$group = $form_state['values']['group'];
foreach ($form_state['values']['messages'] as $key => $messages) {
foreach ($messages as $method => $text) {
db_query("DELETE FROM {messaging_message_parts} WHERE type = '%s' AND msgkey = '%s' AND method = '%s'", $group, $key, $method);
if (trim($text)) {
db_query("INSERT INTO {messaging_message_parts} (type, msgkey, method, module, message) VALUES('%s', '%s', '%s', '', '%s')", $group, $key, $method, $text);
}
}
}
drupal_set_message('The message templates have been updated');
}