You are here

function template_preprocess_ultimenu in Ultimenu 7

Same name and namespace in other branches
  1. 8.2 ultimenu.theme.inc \template_preprocess_ultimenu()
  2. 8 ultimenu.theme.inc \template_preprocess_ultimenu()

Process variables for ultimenu.tpl.php.

See also

ultimenu.tpl.php

File

templates/ultimenu.theme.inc, line 12
Hooks and preprocess functions for the Ultimenu module.

Code

function template_preprocess_ultimenu(&$variables) {
  $element = $variables['element'];
  $variables['config'] = $element['#config'];
  $variables['delta'] = $element['#delta'];

  // Create the $content variable that templates expect.
  $variables['content'] = $element['#content'];

  // Add orientation classes.
  $orientation = $element['#config']['orientation'];
  $variables['classes_array'][] = strpos($orientation, 'v') !== FALSE ? 'vertical' : 'horizontal';
  $variables['classes_array'][] = $element['#config']['orientation'];
  $variables['classes_array'][] = 'ultimenu-' . $element['#delta'];

  // Add skin classes based on safe CSS file name.
  if (($skin = $element['#config']['skin_name']) !== NULL) {
    $variables['classes_array'][] = drupal_html_class($skin);
  }

  // We don't float list by default, but hence to fix possible list floating.
  $variables['classes_array'][] = 'clearfix';
}