You are here

function render_menu_item in Special menu items 6

Returns menu item rendered.

2 calls to render_menu_item()
special_menu_itemsoverwrite_menu_item_link in ./special_menu_items.module
Override of theme_menu_item_link() This function will render link if it is "nolink" or "separator". Otherwise it will call originally overwriten menu_item_link function.
special_menu_items_init in ./special_menu_items.module
Implementation of hook_init().

File

./special_menu_items.module, line 136
Module to enable placeholder or separator menu items.Placeholder is a menu item which is actually not a link. Something like this is useful with drop down menus where we want to have a parent link which is actually not linking to a page but which is…

Code

function render_menu_item($tag, $value, $css = null) {
  $length = strlen($tag);

  //Validate the tags
  if ($tag[0] == '<' && $tag[$length - 1] == '>') {
    $closingtag = str_replace('<', '</', $tag);
    if ($css) {
      $tag = str_replace('>', ' class="' . $css . '">', $tag);
    }
  }
  else {
    if ($css) {
      $classtag = '<' . $tag . ' class="' . $css . '">';
      $tag = '<' . $tag . '>';
      $closingtag = str_replace('<', '</', $tag);
      $tag = $classtag;
    }
    else {
      $tag = '<' . $tag . '>';
      $closingtag = str_replace('<', '</', $tag);
    }
  }
  return $tag . $value . $closingtag;
}