You are here

function acquia_lift_element_info in Acquia Lift Connector 7.2

Same name and namespace in other branches
  1. 7 acquia_lift.module \acquia_lift_element_info()

Implements hook_element_info().

See also

navbar_element_info().

File

./acquia_lift.module, line 383
acquia_lift.module Provides Acquia Lift-specific personalization functionality.

Code

function acquia_lift_element_info() {
  $elements = array();

  // A percentage input element for entering percentage values and seeing
  // the resultant percent left.
  $elements['acquia_lift_percentage'] = array(
    '#input' => TRUE,
    '#element_validate' => array(
      'element_validate_number',
      'acquia_lift_percentage_validate',
    ),
    '#theme' => 'acquia_lift_percentage',
  );

  // Elements necessary for the unified navbar.
  // Note that we keep the CSS selectors the same as those used by navbar
  // in order to use the same set of CSS.
  $elements['acquia_lift_navbar'] = array(
    '#pre_render' => array(
      'acquia_lift_navbar_pre_render',
    ),
    '#theme' => 'acquia_lift_navbar',
    '#attached' => array(
      'library' => array(
        array(
          'acquia_lift',
          'acquia_lift.unified.navbar',
        ),
      ),
    ),
    // Metadata for the navbar wrapping element.
    '#attributes' => array(
      // The id cannot be simply "navbar" or it will clash with the simpletest
      // tests listing which produces a checkbox with attribute id="navbar"
      'id' => 'navbar-administration',
      // The 'overlay-displace-top' class is necessary in overlay-parent so that
      // the drupalOverlayResize and drupalOverlayClose events will be bound
      // to the document. The navbar does not use this class. It is present
      // to enable compatibility with the Overlay module.
      'class' => array(
        'drupal-navbar',
        'overlay-displace-top',
      ),
      'role' => 'navigation',
    ),
    // Metadata for the administration bar.
    '#bar' => array(
      '#heading' => t('Acquia Lift Navigation'),
      '#attributes' => array(
        'id' => 'navbar-bar',
        'class' => array(
          'navbar-bar',
          'clearfix',
        ),
      ),
    ),
  );

  // A navbar item is wrapped in markup for common styling.  The 'tray'
  // property contains a renderable array. theme_acquia_lift_navbar_tab() is a light
  // wrapper around the l() function. The contents of tray are rendered in
  // theme_acquia_lift_navbar_tab().
  $elements['acquia_lift_navbar_item'] = array(
    '#pre_render' => array(
      'acquia_lift_navbar_pre_render_item',
    ),
    '#theme' => 'acquia_lift_navbar_item',
  );
  return $elements;
}