function _acquia_lift_personalize_campaign_wizard_form_state_blocks_alter in Acquia Lift Connector 7.2
Adds values to form_state as expected by personalize blocks form handlers.
Parameters
$form_state: The form state to update (by reference).
$block_content: The array that is the root of the blocks content values.
$key: The key used for this particular option set in the form state.
$option_set: The currently referenced option set data.
2 calls to _acquia_lift_personalize_campaign_wizard_form_state_blocks_alter()
- _acquia_lift_personalize_campaign_wizard_block_single_save in ./
acquia_lift.admin.wizard.inc - Helper submit function to save a single block variation.
- _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 2800 - acquia_lift.admin.wizard.inc Functions specific to the Acquia Lift alteration of the campaign creation wizard.
Code
function _acquia_lift_personalize_campaign_wizard_form_state_blocks_alter(&$form_state, $block_content = array(), $key, $option_set = NULL) {
if (!empty($block_content)) {
$form_state['values'] = $block_content;
if (!empty($block_content['pblock_wrapper']['blocks'])) {
$form_state['values']['blocks'] = $block_content['pblock_wrapper']['blocks'];
}
}
else {
unset($form_state['values']);
}
if (!empty($form_state['values']['blocks'])) {
foreach ($form_state['values']['blocks'] as $delta => $block_info) {
// Set the "add" indicator if the user is creating a new block.
if (!empty($block_info['block']['add']['info']) && !empty($block_info['block']['add']['body']['value'])) {
$form_state['values']['blocks'][$delta]['block']['bid'] = 'add';
unset($form_state['values']['blocks'][$delta]['osid']);
}
}
}
if (!empty($form_state['option_set_num_blocks'][$key])) {
$form_state['num_blocks'] = $form_state['option_set_num_blocks'][$key];
}
else {
unset($form_state['num_blocks']);
}
if (!empty($form_state['option_set_pblock'][$key])) {
$form_state['pblock'] = $form_state['option_set_pblock'][$key];
}
else {
unset($form_state['pblock']);
}
if (isset($form_state['option_set_to_remove'][$key])) {
$form_state['to_remove'] = $form_state['option_set_to_remove'][$key];
}
else {
unset($form_state['to_remove']);
}
}