You are here

function deploy_ui_empty_plan_form_submit in Deploy - Content Staging 7.2

Same name and namespace in other branches
  1. 7.3 modules/deploy_ui/deploy_ui.pages.inc \deploy_ui_empty_plan_form_submit()

Submit handler for empty plan form.

File

modules/deploy_ui/deploy_ui.pages.inc, line 182
Deploy UI page functions.

Code

function deploy_ui_empty_plan_form_submit($form, &$form_state) {
  $plan = $form_state['values']['deploy_plan'];

  // Get the entity keys from the aggregator.
  $entity_keys = $plan
    ->getEntities();
  foreach ($entity_keys as $entity_key) {
    $entity = entity_load_single($entity_key['type'], $entity_key['id']);
    deploy_manager_delete_from_plan($plan->name, $entity_key['type'], $entity);
  }
  drupal_set_message(t('All items were removed from the @plan plan.', array(
    '@plan' => $plan->title,
  )));
  $form_state['redirect'] = 'admin/structure/deploy';
}