You are here

function acquia_lift_personalize_campaign_wizard_help_ajax in Acquia Lift Connector 7.2

Ajax submit handler for any help section dismissal button

3 string references to 'acquia_lift_personalize_campaign_wizard_help_ajax'
acquia_lift_personalize_campaign_wizard_goals_help in ./acquia_lift.admin.wizard.inc
Section help callback for goals section.
acquia_lift_personalize_campaign_wizard_targeting_help in ./acquia_lift.admin.wizard.inc
Section help callback for targeting section.
acquia_lift_personalize_campaign_wizard_variations_help in ./acquia_lift.admin.wizard.inc
Section help callback for variations section.

File

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

Code

function acquia_lift_personalize_campaign_wizard_help_ajax($form, &$form_state) {
  global $user;
  $current_dismiss = !empty($user->data['acquia_lift_help_dismiss']) ? $user->data['acquia_lift_help_dismiss'] : array();

  // #name property is "display_{step}"
  $dismiss = preg_replace('/^dismiss_/', '', $form_state['triggering_element']['#name']);
  if (!in_array($dismiss, $current_dismiss)) {
    $current_dismiss[] = $dismiss;
    user_save($user, array(
      'data' => array(
        'acquia_lift_help_dismiss' => $current_dismiss,
      ),
    ));
  }
}