Utility function for writing a menu link in Joomla
< ?php /*** Utility function for writing a menu link */ function mosGetMenuLink( $mitem, $level=0, &$params, $open=null ) { global $Itemid, $mosConfig_live_site, $mainframe; $txt = ''; $image_link = 0; switch ($mitem->type) { case 'separator': case 'component_item_link': break; case 'url': if ( eregi( 'index.php\?', $mitem->link ) ) { if ( !eregi( 'Itemid=', $mitem->link ) ) { $mitem->link .= '&Itemid='. $mitem->id; } } break; case 'content_item_link': case 'content_typed': // load menu params $menuparams = new mosParameters( $mitem->params, $mainframe->getPath( 'menu_xml', $mitem->type ), 'men