You are here

function mb_comment_admin_submit in More Buttons 7

Save settings from admin form.

File

mb_comment/mb_comment.admin.inc, line 124

Code

function mb_comment_admin_submit($form, &$form_state) {
  $module = 'mb_comment';
  $mappings = $form['#mappings'];
  if ($form_state['clicked_button']['#id'] == 'edit-save') {

    // Save the MB Comment button settings.
    foreach ($mappings as $type => $maps) {
      if ($type == 'panel') {
        continue;
      }
      variable_set($module . '_cancel_' . $type, $form_state['values'][$module . '_cancel_' . $type]);
    }
    drupal_set_message(t('The %module settings have been saved.', array(
      '%module' => t('More Buttons Comment'),
    )), 'status');
  }
  elseif ($form_state['clicked_button']['#id'] == 'edit-reset') {
    $form_state['redirect'] = 'admin/config/mb/buttons/more-buttons-comment/reset';
  }
}