You are here

function acquia_lift_goal_create_modal_callback in Acquia Lift Connector 7

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

Page callback to create a new goal by selecting the type of goal to create.

Parameters

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

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

File

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

Code

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

  // Show the goal 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-goal-type-list',
    'items' => array(
      'existing' => array(
        'title' => t('Predefined goal'),
        'description' => t('Visitor actions already defined by Acquia Lift'),
        'path' => 'admin/structure/acquia_lift/goal/add/existing',
        'modal' => TRUE,
        'ctools_style' => 'ctools-modal-acquia-lift-style',
        'logo' => theme('image', array(
          'path' => $path . '/images/goal-type-predefined.png',
          'alt' => t('Pre-existing goal'),
          'title' => t('Select this option to create a goal from a pre-existing visitor action.'),
        )),
      ),
      'element' => array(
        'title' => t('New element goal'),
        'description' => t('Element-level visitor action, such as clicking a link or hovering over an image'),
        'path' => 'admin/structure/visitor_actions',
        'modal' => FALSE,
        'logo' => theme('image', array(
          'path' => $path . '/images/goal-type-element.png',
          'alt' => t('Element goal'),
          'title' => t('Select this option to create an element goal.'),
        )),
      ),
      'page' => array(
        'title' => t('New page goal'),
        'description' => t('Page-level visitor action, such as scrolling to the bottom of the page'),
        'path' => 'admin/structure/acquia_lift/goal/add/page',
        'modal' => TRUE,
        'ctools_style' => 'ctools-modal-acquia-lift-style',
        'logo' => theme('image', array(
          'path' => $path . '/images/goal-type-page.png',
          'alt' => t('Page goal'),
          'title' => t('Select this option to create a page goal.'),
        )),
      ),
    ),
  ));
  return ctools_modal_render(t('Add a goal'), $output);
}