You are here

function acquia_lift_edit_mode_personalize_in_context in Acquia Lift Connector 7

Builds controls for an in-context personalization mode.

Based on visitor_actions_ui_edit_mode_action_in_context().

Return value

String The rendered string for display.

1 call to acquia_lift_edit_mode_personalize_in_context()
acquia_lift_build_page in ./acquia_lift.ui.inc
Attaches the front-end controls to the page.

File

./acquia_lift.ui.inc, line 161
acquia_lift.ui.inc Provides functions needed for the front-end UI.

Code

function acquia_lift_edit_mode_personalize_in_context() {
  $build = array(
    'message' => array(
      '#markup' => '<p>' . t('To personalize content in context, navigate to the page where the content you wish to personalize is, then press the %link link.', array(
        '%link' => 'Personalize',
      )) . '</p>',
    ),
    'actions' => array(
      '#theme' => 'acquia_lift_edit_mode_personalize_in_context_links',
      '#attributes' => array(
        'class' => array(
          'visitor-actions-ui-actions',
        ),
      ),
      'launch' => array(
        '#type' => 'link',
        '#title' => t('Personalize'),
        '#href' => drupal_get_normal_path('admin/structure/personalize'),
        '#options' => array(
          'attributes' => array(
            'title' => t('Highlight content that can be personalized'),
            'role' => 'button',
            'aria-pressed' => 'false',
            'class' => array(
              'acquia-lift-ignore',
              'acquia-lift-personalize-trigger',
            ),
            'data-acquia-lift-personalize-mode' => 'content-variation',
          ),
        ),
      ),
      'cancel' => array(
        '#type' => 'link',
        '#title' => t('Cancel'),
        '#href' => drupal_get_normal_path('acquia_lift/personalize_in_context/stop'),
        '#options' => array(
          'attributes' => array(
            'title' => t('Home page'),
            'class' => array(
              'acquia-lift-ignore',
            ),
          ),
        ),
      ),
    ),
  );

  // Allow other modules to modify the message markup.
  drupal_alter('acquia_lift_edit_mode_actions', $build);
  return drupal_render($build);
}