You are here

function activity_actions_delete_form_submit in Activity 7

Same name and namespace in other branches
  1. 6.2 activity.admin.inc \activity_actions_delete_form_submit()

Process activity_actions_delete form submissions.

Post-deletion operations for activity action deletion.

File

./activity.admin.inc, line 259
activity.admin.inc Contains administrative forms for activity.module

Code

function activity_actions_delete_form_submit($form, &$form_state) {
  $aid = $form_state['values']['aid'];
  $action = actions_load($aid);
  actions_delete($aid);
  if ($form_state['values']['delete']) {
    $batch = array(
      'title' => t('Deleting activities'),
      'operations' => array(
        array(
          'activity_batch_delete',
          array(
            $aid,
          ),
        ),
      ),
      'file' => drupal_get_path('module', 'activity') . '/activity.batch.inc',
    );
    batch_set($batch);
  }
  watchdog('activity', 'Deleted action %aid (%action)', array(
    '%aid' => $aid,
    '%action' => $action->label,
  ));
  drupal_set_message(t('Action %action was deleted', array(
    '%action' => $action->label,
  )));
  $form_state['redirect'] = 'admin/structure/activity';
}