You are here

function acquia_lift_campaign_create_modal_callback in Acquia Lift Connector 7

Page callback to start the create a campaign process. The first step is to select the type of

Parameters

bool $ajax: Indicates if form is called with ajax support.

1 string reference to 'acquia_lift_campaign_create_modal_callback'
acquia_lift_menu in ./acquia_lift.module
Implements hook_menu().

File

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

Code

function acquia_lift_campaign_create_modal_callback($ajax) {
  if (!$ajax) {
    drupal_goto('admin/structure/personalize/add');
    return;
  }

  // Show the campaign type selection form in a modal.
  ctools_include('modal');
  ctools_modal_add_js();
  $path = drupal_get_path('module', 'acquia_lift');
  $output = theme('acquia_lift_type_list', array(
    'id' => 'acquia-lift-modal-campaign-type-list',
    'items' => array(
      'ab' => array(
        'title' => t('A/B test'),
        'description' => t('Create and compare content variations.'),
        'path' => 'admin/structure/acquia_lift/add/ab',
        'modal' => TRUE,
        'ctools_style' => 'ctools-modal-acquia-lift-style',
        'logo' => theme('image', array(
          'path' => $path . '/images/campaign-type-ab.png',
          'alt' => t('A/B test'),
          'title' => t('Select this option to create an A/B test.'),
        )),
      ),
      'custom' => array(
        'title' => t('Custom Lift campaign'),
        'description' => t('Create a content targeting or multivariate campaign using the Drupal-integrated campaign tools.'),
        'path' => 'admin/structure/personalize/add/',
        'url_options' => array(
          'query' => array(
            'personalize_agent_type' => 'acquia_lift',
          ),
        ),
        'modal' => FALSE,
        'logo' => theme('image', array(
          'path' => $path . '/images/campaign-type-custom.png',
          'alt' => t('Custom Lift campaign'),
          'title' => t('Select this option to create a custom Lift campaign.'),
        )),
      ),
    ),
  ));
  return ctools_modal_render(t('Create a campaign'), $output);
}