Created
April 10, 2016 15:17
-
-
Save flayder/562019da58b59bc75f7373eadbeead78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? if (!empty($arResult)) { ?> | |
<ul class="open"> | |
<? | |
$previousLevel = 0; | |
$i = 0; | |
foreach ($arResult as $arItem) { | |
if ($previousLevel && $arItem["DEPTH_LEVEL"] < $previousLevel) | |
echo str_repeat('</ul><div class="btn"></div></li>', ($previousLevel - $arItem["DEPTH_LEVEL"])); | |
?> | |
<? if ($arItem["IS_PARENT"]) { ?> | |
<li class="parent<?=($arItem['SELECTED'])?' general curr open':''?>"> | |
<a href="<?=$arItem['LINK']?>"><?=$arItem['TEXT']?></a> | |
<ul> | |
<? } else { ?> | |
<li class="<?=($arItem['SELECTED'])?' general curr open':''?>"> | |
<a href="<?=$arItem['LINK']?>"><?=$arItem['TEXT']?></a> | |
</li> | |
<? } ?> | |
<? $previousLevel = $arItem["DEPTH_LEVEL"] ?> | |
<? } ?> | |
<? if ($previousLevel > 1) echo str_repeat('</ul><div class="btn"></div></li>', ($previousLevel-1)); ?> | |
</ul> | |
<? } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment