You are here

function acquia_lift_page_variation_delete_complete_callback in Acquia Lift Connector 7

Ctools form processing complete handler for deletion of a page variation.

See also

acquia_lift_create_ctools_form().

1 string reference to 'acquia_lift_page_variation_delete_complete_callback'
acquia_lift_page_variation_delete_modal_callback in ./acquia_lift.admin.unibar.inc
Page callback to generate a page variation delete confirm modal window.

File

./acquia_lift.admin.unibar.inc, line 777
acquia_lift.admin.unibar.inc

Code

function acquia_lift_page_variation_delete_complete_callback($form, $form_state) {
  $settings = array();
  $option_sets = personalize_option_set_load_multiple(FALSE, array(
    'decision_name' => $form_state['values']['variation_set_name'],
  ));
  if (empty($option_sets)) {
    $settings['empty'] = $form_state['values']['agent_name'];
  }
  else {
    $option_set_settings = array_map('_personalize_convert_option_set_to_js_setting', $option_sets);
    foreach ($option_set_settings as $option_set_setting) {
      $settings[key($option_set_setting)] = reset($option_set_setting);
    }
  }
  $campaign_settings['acquia_lift']['campaigns'] = acquia_lift_get_campaign_details(variable_get('acquia_lift_unibar_allow_status_change', TRUE));
  $commands = array(
    ajax_command_settings($campaign_settings, TRUE),
    ctools_modal_command_dismiss(),
    acquia_lift_command_messagebox(t('The variation has been deleted.'), 10),
    acquia_lift_command_option_set_updates($settings),
    acquia_lift_command_process_queue(),
  );
  return $commands;
}