You are here

function heartbeat_messages_edit_submit in Heartbeat 6.2

Same name and namespace in other branches
  1. 6.4 heartbeat.admin.inc \heartbeat_messages_edit_submit()
  2. 6.3 heartbeat.admin.inc \heartbeat_messages_edit_submit()

Accept the form submission heartbeat messages.

File

./heartbeat.admin.inc, line 166

Code

function heartbeat_messages_edit_submit($form, &$form_state) {
  if ($form_state['clicked_button']['#value'] == t('Save')) {
    db_query("UPDATE {heartbeat_messages} SET message ='%s', message_concat ='%s', karma_index = %d \n   WHERE event = '%s'", $form_state['values']['message'], $form_state['values']['message_concat'], $form_state['values']['karma_index'], $form_state['values']['event']);
  }

  // Clear the rules cache to avoid problems
  rules_clear_cache();

  //$form_state['redirect'] = 'admin/settings/heartbeat/messages';
  drupal_set_message('Settings updated');
  return;
}