You are here

function om_maximenu_links_render in OM Maximenu 7

Same name and namespace in other branches
  1. 8 inc/om_maximenu.render.inc \om_maximenu_links_render()
  2. 6 inc/om_maximenu.render.inc \om_maximenu_links_render()

OM Maximenu links rendering engine

2 calls to om_maximenu_links_render()
om_maximenu_block_load in inc/om_maximenu.render.inc
Load all OM Maximenu blocks
om_maximenu_load in inc/om_maximenu.render.inc
Load all OM Maximenu blocks

File

inc/om_maximenu.render.inc, line 217
OM Maximenu Render

Code

function om_maximenu_links_render($links = array(), $menu_key = 1) {

  // immediately returns nothing if no links
  if (!isset($links['links'])) {
    return NULL;
  }

  // style content
  $style = isset($links['style']) && $links['style'] != '' ? 1 : 0;
  if ($style) {

    // style links
    if ($links['style'] == 'accordion') {
      $out = theme('om_maximenu_accordion', array(
        'links' => $links,
        'menu_key' => $menu_key,
      ));
    }
    elseif ($links['style'] == 'roundabout') {
      $out = theme('om_maximenu_roundabout', array(
        'links' => $links,
        'menu_key' => $menu_key,
      ));
    }
    elseif ($links['style'] == 'modal') {
      $out = theme('om_maximenu_modal', array(
        'links' => $links,
        'menu_key' => $menu_key,
      ));
    }
    else {
      $out = theme('om_maximenu_tabbed', array(
        'links' => $links,
        'menu_key' => $menu_key,
      ));
    }
  }
  else {
    $out = theme('om_maximenu_submenu', array(
      'links' => $links,
      'menu_key' => $menu_key,
    ));
  }

  // access on editing
  if (user_access('administer OM Maximenu')) {
    $out .= '<div class="om-maximenu-edit">' . l(t('Maxedit'), 'admin/structure/om-maximenu/' . $menu_key . '/edit', array(
      'query' => drupal_get_destination(),
    )) . '</div>';
  }
  return theme('om_maximenu_wrapper', array(
    'links' => $links,
    'content' => $out,
  ));
}