<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?> <?if (!empty($arResult)):?> <ul id="horizontal-multilevel-menu" class="menu"> <? $previousLevel = 0; foreach($arResult as $arItem): $strImg = ''; if(intval($arItem["PARAMS"]["PICTURE"])>0 && $arItem["DEPTH_LEVEL"]==2){ $img = CFile::ResizeImageGet($arItem["PARAMS"]["PICTURE"], array('width'=>100, 'height'=>100), BX_RESIZE_IMAGE_PROPORTIONAL, false); $strImg = '<img alt="" src="'.$img['src'].'" />'; } ?> <?if ($previousLevel && $arItem["DEPTH_LEVEL"] < $previousLevel):?> <?=str_repeat("</ul></li>", ($previousLevel - $arItem["DEPTH_LEVEL"]));?> <?endif?> <?if ($arItem["IS_PARENT"]):?> <?if ($arItem["DEPTH_LEVEL"] == 1):?> <li class="<?if ($arItem["SELECTED"]):?>active menu-item<?else:?>menu-item<?endif?>"><a href="<?=$arItem["LINK"]?>" class="item"><?=$strImg?><?=$arItem["TEXT"]?></a> <ul class="sub-menu"> <?else:?> <li<?if ($arItem["SELECTED"]):?> class="sub-item item-selected"<?endif?>><a href="<?=$arItem["LINK"]?>" class="parent"><?=$strImg?><?=$arItem["TEXT"]?></a> <?endif?> <li class="sub-item"> <a class="all-item" href="<?=$arItem["LINK"]?>"> Все категории </a> </li> <?else:?> <?if ($arItem["PERMISSION"] > "D"):?> <?if ($arItem["DEPTH_LEVEL"] == 1):?> <li class="<?if ($arItem["SELECTED"]):?>active menu-item<?else:?>menu-item<?endif?>"><a href="<?=$arItem["LINK"]?>" class="item"><?=$strImg?><?=$arItem["TEXT"]?></a></li> <?else:?> ****** <li<?if ($arItem["SELECTED"]):?><?endif?> class="sub-item"><a href="<?=$arItem["LINK"]?>"><?=$strImg?><?=$arItem["TEXT"]?></a></li> ********* <?endif?> <?else:?> <?if ($arItem["DEPTH_LEVEL"] == 1):?> <li class="menu-item"><a href="" class="<?if ($arItem["SELECTED"]):?>root-item-selected<?else:?>root-item item<?endif?>" title="<?=GetMessage("MENU_ITEM_ACCESS_DENIED")?>"><?=$strImg?><?=$arItem["TEXT"]?></a></li> <?else:?> <li class="menu-item"><a href="" class="denied" title="<?=GetMessage("MENU_ITEM_ACCESS_DENIED")?>"><?=$strImg?><?=$arItem["TEXT"]?></a></li> <?endif?> <?endif?> <?endif?> <?$previousLevel = $arItem["DEPTH_LEVEL"];?> <?endforeach?> <?if ($previousLevel > 1)://close last item tags?> <?=str_repeat("</ul></li>", ($previousLevel-1) );?> <?endif?> </ul> <div class="menu-clear-left"></div> <?endif?> Good afternoon, ladies and gentlemen.
Tell me how to limit the output of the li item in a complex array; I marked the point with asterisks on both sides. There is a sample from the array, when I try to wrap the string with asterisks in one more array, in general, nothing happens.