<?php
$str = '';
foreach ($conf['sys_menus'] as $k => $v)
{
    if (!in_array('foot', $v['show']))
        continue;
    if ($v['mod'] == 'home_')
    {
        $str .= '<a ' . (IS_HOME ? 'class="current"' : '') . ' ' . (empty($v['blank']) ?
            '' : 'target="_blank"') . ' href="' . (LANG == $conf['sys_lang'] ? ROOTPATH :
            url(RP)) . '">' . htmlxlang($v['name']) . '</a>';
    } else
        if ($v['mod'] == 'fun_')
        {
            $str .= '<a ' . (MID == $k ? 'class="current"' : '') . ' ' . (empty($v['blank']) ?
                '' : 'target="_blank"') . ' href="' . url(RP . $v['fun_'] . '/') . '">' .
                htmlxlang($v['name']) . '</a>';
        } else
            if ($v['mod'] == 'page_')
            {
                $str .= '<a ' . (MID == $k ? 'class="current"' : '') . ' ' . (empty($v['blank']) ?
                    '' : 'target="_blank"') . ' href="' . url(RP . $v['page_'] . '/') . '">' .
                    htmlxlang($v['name']) . '</a>';
            } 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 .= '<a ' . ($current_f ? 'class="current"' : '') . ' ' . (empty($v['blank']) ?
                        '' : 'target="_blank"') . ' href="' . $v['link_'] . '">' . htmlxlang($v['name']) .
                        '</a>';
                } else
                {
                    $str .= '<a ' . (!GID && (MID == $k || $k == $v['pid']) ? 'class="current"' : '') .
                        ' ' . (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>';
                }
}
return $str;
