You are here

function _acquia_lift_personalize_campaign_wizard_change_type_form in Acquia Lift Connector 7.2

Helper function to generate a change type sub-section of a form.

Parameters

string $selected_label: The string to show for the currently selected type.

array $change_options: An array of options to be added to the change submit button. This will generally include the #submit and #ajax properties.

Return value

array The render array for the sub-form.

2 calls to _acquia_lift_personalize_campaign_wizard_change_type_form()
acquia_lift_personalize_campaign_wizard_goals_alter in ./acquia_lift.admin.wizard.inc
Alter the goals form.
acquia_lift_personalize_campaign_wizard_variations_alter in ./acquia_lift.admin.wizard.inc
Alter hook for the variations portions of the campaign wizard.

File

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

Code

function _acquia_lift_personalize_campaign_wizard_change_type_form($selected_label, $change_options = array()) {
  $form = array();
  $form['change_type_container'] = array(
    '#type' => 'container',
    '#attributes' => array(
      'class' => array(
        'container-inline',
      ),
    ),
  );
  $form['change_type_container']['display'] = array(
    '#type' => 'item',
    '#title' => t('Type'),
    '#markup' => $selected_label,
  );
  $form['change_type_container']['change'] = array(
    '#type' => 'submit',
    '#value' => t('Change type'),
    '#limit_validation_errors' => array(),
    '#attributes' => array(
      'class' => array(
        'acquia-lift-link',
      ),
    ),
  );
  $form['change_type_container']['change'] += $change_options;
  $form['change_type_container']['change']['#ajax']['progress'] = array(
    'message' => '',
    'type' => 'throbber',
  );
  return $form;
}