Files
vinoteca/local/components/jinove/personal.nav/class.php
T

32 lines
805 B
PHP

<?php
declare(strict_types=1);
use Bitrix\Main\Localization\Loc;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
Loc::loadMessages(__FILE__);
class JinovePersonalNavComponent extends CBitrixComponent
{
private const SECTIONS = ["profile" => "", "orders" => "orders/", "reviews" => "reviews/"];
public function executeComponent(): array
{
$items = [];
foreach (self::SECTIONS as $code => $path) {
$items[] = [
"CODE" => $code,
"URL" => SITE_DIR . "personal/" . $path,
"ACTIVE" => ($this->arParams["ACTIVE"] ?? "") === $code,
];
}
$this->arResult = ["ITEMS" => $items];
$this->includeComponentTemplate();
return $this->arResult;
}
}