You are here

function theme_acquia_lift_wizard_section_help in Acquia Lift Connector 7.2

Section level help for the campaign wizard.

Parameters

$variables: Array of theme variables including the "element" to be themed. The element may include properties:

  • #image: An option image to display
  • #alt: The alt text for the above image
  • #text: The help text to display
3 theme calls to theme_acquia_lift_wizard_section_help()
acquia_lift_personalize_campaign_wizard_goals_help in ./acquia_lift.admin.wizard.inc
Section help callback for goals section.
acquia_lift_personalize_campaign_wizard_targeting_help in ./acquia_lift.admin.wizard.inc
Section help callback for targeting section.
acquia_lift_personalize_campaign_wizard_variations_help in ./acquia_lift.admin.wizard.inc
Section help callback for variations section.

File

theme/acquia_lift.wizard.theme.inc, line 219
acquia_lift.wizard.theme.inc Provides theme functions for Acquia Lift's version of the campaign creation wizard workflow.

Code

function theme_acquia_lift_wizard_section_help($variables) {
  $element = $variables['element'];

  // Currently just supports a single image and simple html text.
  $help_image = isset($element['#image']) ? $element['#image'] : '';
  $help_alt = isset($element['#alt']) ? $element['#alt'] : t('Help image for this section');
  $help_text = isset($element['#text']) ? $element['#text'] : '';
  $trigger_text = t('Help?');
  $collapsed = isset($element['#collapsed']) ? $element['#collapsed'] : TRUE;
  $container_classes = array(
    'clearfix',
  );
  if ($collapsed) {
    $container_classes[] = 'is-collapsed';
  }
  else {
    $container_classes[] = 'is-expanded';
  }
  $html = '';
  $html .= '<div id="acquia-lift-campaign-wizard-section-help" class="' . implode(' ', $container_classes) . '">';
  $html .= '<a class="acquia-lift-section-help-trigger" title="' . $trigger_text . '">' . $trigger_text . '</a>';
  $html .= '<div class="acquia-lift-section-help-expanded">';
  $html .= '<div class="acquia-lift-section-help clearfix">';
  if (!empty($help_image)) {
    $html .= theme('image', array(
      'path' => $help_image,
      'alt' => $help_alt,
      'attributes' => array(
        'class' => 'acquia-lift-section-help',
      ),
    ));
  }
  $html .= '<div class="acquia-lift-section-help">' . $help_text . '</div>';
  $html .= '</div>';
  $element['dismiss']['#attributes']['class'][] = 'acquia-lift-submit-button';
  $element['dismiss']['#attributes']['class'][] = 'action-item-primary-active';
  $element['dismiss']['#attributes']['class'][] = 'acquia-lift-section-help-collapse';
  $html .= drupal_render($element['dismiss']);
  $html .= '</div>';
  return $html;
}