You are here

function pm_block_user_settings_submit in Privatemsg 6

Same name and namespace in other branches
  1. 6.2 pm_block_user/pm_block_user.admin.inc \pm_block_user_settings_submit()
  2. 7.2 pm_block_user/pm_block_user.admin.inc \pm_block_user_settings_submit()
  3. 7 pm_block_user/pm_block_user.admin.inc \pm_block_user_settings_submit()

Submit handler for admin form.

File

pm_block_user/pm_block_user.module, line 234
Allows users to block other users from sending them any messages

Code

function pm_block_user_settings_submit($form, &$form_state) {

  // We don't want it to submit when we're adding/removing actions.
  if ($form_state['clicked_button']['#id'] == 'edit-submit-form') {

    // If the form's 'block_actions' aren't set, the user has deleted all the
    // rows in the table, so we save an empty array to stop errors in the form
    // builder.
    if (isset($form_state['values']['block_actions'])) {
      variable_set('pm_block_user_actions', _pm_block_user_settings_filter($form_state['values']['block_actions']));
    }
    else {
      variable_set('pm_block_user_actions', array());
    }
    drupal_set_message(t('The configuration options have been saved.'));
  }
}