You are here

function sharebar_button_confirm_delete_submit in ShareBar 7

Same name and namespace in other branches
  1. 6 sharebar.admin.inc \sharebar_button_confirm_delete_submit()
  2. 7.2 sharebar.admin.inc \sharebar_button_confirm_delete_submit()

Submit handler for hook_button_confirm_delete().

File

./sharebar.admin.inc, line 192
Admin page callbacks for the block module.

Code

function sharebar_button_confirm_delete_submit($form, &$form_state) {
  $mname = arg(4);
  if ($form_state['values']['machine_name']) {
    $buttons = unserialize(variable_get('sharebar_buttons', sharebar_buttons_def()));
    if (is_array($buttons) && count($buttons)) {
      unset($buttons[$form_state['values']['machine_name']]);
      variable_set('sharebar_buttons', serialize($buttons));
    }
  }
  drupal_set_message(t('Deleted buttons %name.', array(
    '%name' => $form_state['values']['name'],
  )));
  watchdog('ShareBar', 'Deleted buttons %name.', array(
    '%name' => $form_state['values']['name'],
  ), WATCHDOG_NOTICE);
  $form_state['redirect'] = 'admin/config/sharebar/settings';
  cache_clear_all();

  // return;
}