Сделал
Аналогично меняем функцию getmenulink
Спойлер (Показать)function getmenulink($menu,$class_sfx='',$menutype='')
{
global $lm_website,$lm_type,$conn;
$addon='';
switch ($menu['link_type']) {
case 'separator':
break;
case 'url':
if (eregi( "index.php\?", $menu['link'] )) {
if (!eregi( "Itemid=", $menu['link'] )) {
$menu['link'] .= "&Itemid=".$menu['id'];
}
}
if(!strstr($menu['link'],"index.php") && !strstr($menu['link'],"http://"))$menu['link']=$lm_website.$menu['link'];
break;
case 'cl':
{
$crow=$conn->GetRow("SELECT * FROM #__menu WHERE id=".$menu['link']." AND published=1");
if($crow){
$menu['link']=getmenulink($crow,$class_sfx,$menutype);
return $menu['link'];
}
}
break;
case 'cc':
{
$catid = explode('=', $menu['link']);
$crow=$conn->GetRow("SELECT count FROM #__categories WHERE id=".$catid[3]);
$addon=' ('.$crow['count'].')';
$menu['link'] .= "&Itemid=".$menu['id'];
break;
}
case 'component':
{
$catid = explode('=', $menu['link']);
if ($catid[1] == 'frontpage')
{
$crow = $conn->Execute("SELECT * FROM #__content_frontpage");
$cnt = $crow->RecordCount();
$addon=' ('.$cnt.')';
}
$menu['link'] .= "&Itemid=".$menu['id'];
break;
}
case 'wrapper':
$menu['link'] = "index.php?option=wrapper&Itemid=".$menu['id'];
break;
default:
$menu['link'] .= "&Itemid=".$menu['id'];
break;
}
if($lm_type=="html")
{
$menuclass = "mainlevel$class_sfx";
if ($menu['parent'] > 0) { $menuclass = "sublevel$class_sfx"; }
} else if ($lm_type=="xhtml")
{
$menuclass="";
}
$class=(strlen($menuclass)>0)?"class=\"$menuclass\"":"";
$link=$menu['link'];
$name=$menu['name'];
$active="";
global $Itemid;
if(isset($Itemid) && $Itemid==$menu['id'] && $menutype=="mainmenu") $active = "id=\"active_menu\"";
switch ($menu['browsernav']) {
case 1:
$txt = "<a href=\"$link\" target=\"_blank\" $class $active>$name</a>";
break;
case 2:
$txt = "<a href=\"#\" onClick=\"javascript: window.open('$link', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\" $class $active>$name</a>";
break;
case 3:
$txt = "<span $class $active>$name</span>";
break;
default:
$txt = "<a href=\"$link\" $class $active>$name $addon</a>";
break;
}
return $txt;
} |