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 '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 = "$name";
break;
case 2:
$txt = "$name";
break;
case 3:
$txt = "$name";
break;
default:
$txt = "$name";
break;
}
return $txt;
}
function showmenu($menutype='mainmenu',$class='',$type='vertical')
{
global $conn,$lm_website,$lm_absolute_path,$lm_template,$Itemid,$access_sql,$lm_type;
$rs=$conn->Execute("SELECT * FROM #__menu WHERE published=1 AND menutype='$menutype' AND parent=0 $access_sql ORDER BY ordering ASC");
if (file_exists( $lm_absolute_path."templates/$lm_template/images/indent1.png" )) {
$imgpath = $lm_website."templates/$lm_template/images";
} else {
$imgpath = $lm_website."images/M_images";
}
if($lm_type=="html")
{
if($type=='vertical')
{
$indents = array(
// block prefix / item prefix / item suffix / block suffix
array( "\n
" ),
array( '', '
', '
', '' ) );
}else if($type=='horizontal')
{
$indents = array(
array( "" )
);
}else if($type=='flat_list')
{
$indents = array(
array( "\n" )
);
}}
if( $rs && $rs->RecordCount()>0 && $rsa=$rs->GetArray() )
{
echo $indents[0][0];
foreach($rsa as $row){
echo $indents[0][1].getmenulink($row,$class,$menutype);
//as text sql is not balzingly fast :)
if($row['sublevel']>0)
{
$rs1=$conn->Execute("SELECT * FROM #__menu WHERE published=1 AND parent=".$row['id']." $access_sql ORDER BY ordering ASC");
if( $rs1 && $rs1->RecordCount()>0 && $rs1a = $rs1->GetArray() )
{
$show=false;
foreach($rs1a as $row1)if($row1['parent']==$row['id'] && ( $row1['id']==$Itemid || $row['id']==$Itemid ) )$show=true;
if($show)
{
foreach($rs1a as $row1)
{
echo $indents[1][1].getmenulink($row1,$class,$menutype).$indents[1][2];
}
}
}
}
echo $indents[0][2];
}
echo $indents[0][3];
}
}
}
$menutype = @$params->menutype ? $params->menutype : 'mainmenu';
$menu_style = @$params->menu_style ? $params->menu_style : 'vertical';
$class_sfx = @$params->class_sfx ? $params->class_sfx : '';
showmenu($menutype,$class_sfx,$menu_style);
?>