You are here

function acquia_lift_option_set_add_modal_callback in Acquia Lift Connector 7

Same name and namespace in other branches
  1. 7.2 acquia_lift.admin.unibar.inc \acquia_lift_option_set_add_modal_callback()

Page callback to create a new option set.

Parameters

string $agent_name: The machine name of the current camaign.

string $ajax: Indicates if request is from 'ajax' or 'nojs' support.

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

File

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

Code

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

  // Show the option set 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-option-set-type-list',
    'items' => array(
      'personalize-element' => array(
        'title' => t('Webpage elements'),
        'description' => t('Create a variation set of personalized webpage elements, including a base and control version. Useful for quick tests and personalization on individual webpages.'),
        'path' => 'admin/structure/personalize/variations/personalize-elements/add',
        'modal' => FALSE,
        'logo' => theme('image', array(
          'path' => $path . '/images/variation-type-element.png',
          'alt' => t('Webpage element'),
          'title' => t('Select this option to create a variation set from web page elements.'),
        )),
      ),
      'personalize-block' => array(
        'title' => t('Drupal blocks'),
        'description' => t('Create a variation set of personalized Drupal blocks of content. Useful for personalization and testing across your website where this block appears.'),
        'path' => 'admin/structure/personalize/variations/personalize-blocks/add',
        'modal' => FALSE,
        'logo' => theme('image', array(
          'path' => $path . '/images/variation-type-block.png',
          'alt' => t('Drupal block'),
          'title' => t('Select this option to create a variation set from Drupal content blocks.'),
        )),
      ),
    ),
  ));
  return ctools_modal_render(t('Add a variation set'), $output);
}