<li class="catalog__category-item">
<label>
<input type="radio" name="category" value="">
<span><?=$section['NAME']?></span>
</label>
<?php if($section['CHILD']):?>
<div class="catalog__category-list-box">
<button type="button" class="catalog__category-back-link back-link" value="">
<svg width="19" height="35" viewBox="0 0 19 35" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 1L6.66667 17.5L18 34H12.7798L1 17.5L12.7798 1H18Z" fill="#D62214" stroke="#D62214"/>
</svg>
<span><?=$section['NAME']?></span>
</button>
<ul class="catalog__category-list">
<?=$output?>
</ul>
</div>
<?php endif;?>
</li>
//Файл contactspropertytable.php
//Обязательно наследует DataManager
class ContactsPropertyTable extends DataManager
{
// Не обязательно
private static int $tableID, $propertyID;
// Не обязательно
public function __construct($tableID, $propertyID)
{
self::$propertyID = $propertyID;
self::$tableID = $tableID;
}
public static function getTableName()
{
return 'b_iblock_element_prop_s'.self::$tableID;
}
public static function getMap()
{
return [
(new IntegerField('IBLOCK_ELEMENT_ID'))
->configurePrimary(true),
new StringField('PROPERTY_'.self::$propertyID),
];
}
}
//Файл contacts.php своего модуля
protected function runtimeElements(): array
{
new ContactsPropertyTable($this->iblockId, $this->getPropertyLinkId());
return [
new Entity\ReferenceField(
"LINK",
ContactsPropertyTable::class,
Query\Join::on('this.ID', 'ref.IBLOCK_ELEMENT_ID')
),
];
}
function ShowTree($ParentID, $lvl) {
global $link;
global $lvl;
$lvl++;
$sSQL="SELECT * FROM chapters WHERE parent_id = '$ParentID' ";
$result = $link->query($sSQL);
if (mysqli_num_rows($result) > 0) {
echo("<ul class='parent_ul'>\n");
while ( $row = mysqli_fetch_array($result) ) {
$ID1 = $row["id"];
echo("<li class='parent_li'>\n");
echo("<a href=\""."?ID=".$ID1."\">".$row["name"]."</a>"." \n");
ShowTree($ID1, $lvl);
$lvl--;
}
echo("</ul>\n");
}
}
ShowTree(0, 0);