You are here

function om_maximenu_links_render in OM Maximenu 6

Same name and namespace in other branches
  1. 8 inc/om_maximenu.render.inc \om_maximenu_links_render()
  2. 7 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 220
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', $links, $menu_key);
    }
    elseif ($links['style'] == 'roundabout') {
      $out = theme('om_maximenu_roundabout', $links, $menu_key);
    }
    elseif ($links['style'] == 'modal') {
      $out = theme('om_maximenu_modal', $links, $menu_key);
    }
    else {
      $out = theme('om_maximenu_tabbed', $links, $menu_key);
    }
  }
  else {
    $out = theme('om_maximenu_submenu', $links, $menu_key);
  }

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