<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?function cmp_s($a, $b) {
if ($a["PROPERTIES"]["ABR_COUNTRY"]["SORT"] == $b["PROPERTIES"]["ABR_COUNTRY"]["SORT"]) return 0;
return ($a["PROPERTIES"]["ABR_COUNTRY"]["SORT"] < $b["PROPERTIES"]["ABR_COUNTRY"]["SORT"]) ? -1 : 1;
}?>
<?function cmp_id($a, $b) {
if ($a["PROPERTIES"]["ABR_COUNTRY"]["VALUE"] == $b["PROPERTIES"]["ABR_COUNTRY"]["VALUE"]) return 0;
return ($a["PROPERTIES"]["ABR_COUNTRY"]["VALUE"] < $b["PROPERTIES"]["ABR_COUNTRY"]["VALUE"]) ? -1 : 1;
}?>
<?usort($arResult["ITEMS"], "cmp_s");?>
<?usort($arResult["ITEMS"], "cmp_id");?>
<ul>
<?foreach($arResult["ITEMS"] as $arItem):?>
<?$XarIBlockElement = GetIBlockElement($arItem["PROPERTIES"]["ABR_COUNTRY"]["VALUE"]);?>
<?if($ID_country<>$XarIBlockElement["ID"]):?>
<p class="infoLink"><?=$XarIBlockElement["NAME"];?>:</p><br />
<?endif?>
<?
$this->AddEditAction($arItem['ID'], $arItem['EDIT_LINK'], CIBlock::GetArrayByID($arItem["IBLOCK_ID"], "ELEMENT_EDIT"));
$this->AddDeleteAction($arItem['ID'], $arItem['DELETE_LINK'], CIBlock::GetArrayByID($arItem["IBLOCK_ID"], "ELEMENT_DELETE"), array("CONFIRM" => GetMessage('CT_BNL_ELEMENT_DELETE_CONFIRM')));
?>
<li><a href="<?=$arItem["DETAIL_PAGE_URL"];?>"><b><?=$arItem["NAME"];?></b></a><br /></li>
<?$ID_country=$XarIBlockElement["ID"];?>
<?endforeach;?>
</ul> |