You are here

function acquia_lift_personalize_campaign_wizard_blocks_ajax in Acquia Lift Connector 7.2

Callback to for AJAX to generate the personalize block wrapper form.

1 string reference to 'acquia_lift_personalize_campaign_wizard_blocks_ajax'
_acquia_lift_personalize_campaign_wizard_variations_block in ./acquia_lift.admin.wizard.inc
Generate the blocks portion of the campaign wizard form.

File

./acquia_lift.admin.wizard.inc, line 1591
acquia_lift.admin.wizard.inc Functions specific to the Acquia Lift alteration of the campaign creation wizard.

Code

function acquia_lift_personalize_campaign_wizard_blocks_ajax($form, &$form_state) {
  drupal_get_messages();

  // Both the add and remove buttons have the osid as the last in a "_"
  // delimited list.
  $value_parts = explode('_', $form_state['triggering_element']['#value']);
  $osid = end($value_parts);
  if ($osid === 'add') {
    $delta = _acquia_lift_personalize_campaign_wizard_next_element($form_state, 'new');
    return $form['variations']['editing']['new'][$delta]['block']['content']['pblock_wrapper']['blocks'];
  }
  else {
    return $form['variations']['editing']['option_sets']['option_set_' . $osid]['content']['pblock_wrapper']['blocks'];
  }
}