function FillMenuItems($arMenuItems) { if (is_array($arMenuItems) and !empty($arMenuItems)) { $bCurrentFinded = false; foreach ($arMenuItems as $k => $arItem) { if (Permitions::CheckPathPerms($arItem[1])) { $arMenuItem = array(); $arMenuItem["NAME"] = $arItem[0]; $arMenuItem["URL"] = $arItem[1]; $arMenuItem["PARAM"] = $arItem[2]; $arUrls[$k] = $arMenuItem["URL"]; if (getCurDir() == $arItem[1] or getCurPage() == $arItem[1]) { $arMenuItem["CURRENT"] = "Y"; $bCurrentFinded = true; } else { $arMenuItem["CURRENT"] = "N"; } $arMenuResultItems[$k] = $arMenuItem; } } if (!empty($arUrls) and !$bCurrentFinded) { $cur_url = ''; $cur = ''; foreach ($arUrls as $n => $url) { if (strstr(getCurPage(), $url) or strstr(getCurDir(), $url)) { if (strlen($cur_url) < strlen($url)) { $cur = $n; $cur_url = $url; } } } if ($cur != '') { $arMenuResultItems[$cur]["CURRENT"] = "Y"; } } return $arMenuResultItems; } }
<h1><a href="/"><img class="logo" src="img/logo1.png" alt="wimps logo"/></a></h1> <nav> <ul> <li><a <?php getCurPage('shows', $pageName); ?> href="index.php">Shows</a></li> <li><a <?php getCurPage('tunes', $pageName); ?> href="tunes.php">Tunes</a></li> <!-- <li><a <?php getCurPage('tunes', $pageName); ?> href="records.php">Records</a></li> --> <li><a <?php getCurPage('videos', $pageName); ?> href="videos.php">Videos</a></li> <li><a <?php getCurPage('contact', $pageName); ?> href="contact.php">Contact/Photos</a></li> </ul> </nav> <div id="<?php echo $pageName; ?> " class="page">