<?php
$str = '';
foreach ($conf['sys_pmenus'] as $k => $v)
{
    if (!in_array('main', $v['show']))
        continue;
    if ($v['mod'] == 'home_')
    {
        $str .= '<li ' . (IS_HOME ? 'class="current"' : '') . '><a href="' . (LANG == $conf['sys_lang'] ?
            ROOTPATH : url(RP)) . '">' . htmlxlang($v['name']) . '</a></li>';
    } else
        if ($v['mod'] == 'fun_')
        {
            $str .= '<li ' . (MID == $k ? 'class="current"' : '') . '><a href="' . url(RP .
                $v['fun_'] . '/') . '">' . htmlxlang($v['name']) . '</a></li>';
        } else
            if ($v['mod'] == 'page_')
            {
                $str .= '<li ' . (MID == $k ? 'class="current"' : '') . '><a href="' . url(RP .
                    $v['page_'] . '/') . '">' . htmlxlang($v['name']) . '</a></li>';
            } else
                if ($v['mod'] == 'link_')
                {
                    $current_f = false;
                    if ($v['current_mid'] && $v['current_mod'])
                    {
                        MID == $k && $v['current_mod'] == MOD && $current_f = true;
                    } elseif ($v['current_mod'])
                    {
                        $v['current_mod'] == MOD && $current_f = true;
                    } else
                        if ($v['current_mid'])
                        {
                            MID == $k && $current_f = true;
                        }
                    $str .= '<li ' . ($current_f ? 'class="current"' : '') . '><a ' . (empty($v['blank']) ?
                        '' : 'target="_blank"') . ' href="' . $v['link_'] . '">' . htmlxlang($v['name']) .
                        '</a></li>';
                } else
                {
                    $str .= '<li ' . (!GID && (MID == $k || $k == $v['pid']) ? 'class="current"' :
                        '') . '><a ' . (empty($v['blank']) ? '' : 'target="_blank"') . ' href="' . url(RP .
                        $v['mod'] . '/' . ($conf['sys_modules'][$v['mod']]['action'] == 'index' ? '' : ($conf['sys_modules'][$v['mod']]['action'] .
                        '/')) . $k . '/') . '">' . htmlxlang($v['name']) . '</a></li>';
                }
}
return $str;
?>