You are here

function theme_smartmenus_menu in Smartmenus.js 7

Theme function definition.

1 theme call to theme_smartmenus_menu()
smartmenus_block_view in ./smartmenus.module
Implements hook_block_view().

File

./smartmenus.theme.inc, line 10
Smartmenus theme fnctions.

Code

function theme_smartmenus_menu($variables = array()) {

  // Build the menu.
  $tree = $variables['tree'];

  // Create menu attributes.
  $attributes = array(
    'id' => $variables['attributes']['id'],
    'class' => $class = implode(' ', array_filter($variables['attributes']['class'])),
  );

  // Add a menu toggle button.
  $output = '';
  if ($variables['toggle']) {
    $output .= theme('smartmenus_toggle', array(
      'menu_id' => $variables['attributes']['id'],
      'text' => t('Toggle main menu visibility'),
    ));
  }

  // Recursively build menu outpout.
  $menu_tree = smartmenus_format_menu_tree($tree, $attributes);
  $output .= drupal_render($menu_tree);
  return $output;
}