Vinoteca: модуль, шаблон и компоненты интернет-магазина вина на 1С-Битрикс

This commit is contained in:
jimagie committed 2026-10-22 19:28:52 +05:00
commit bb7d8af290
469 files changed
+26426

No files matched your search

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Jinove\Vinoteca;
use Bitrix\Main\Engine\CurrentUser;
use Bitrix\Main\Localization\Loc;
class Account
{
public static function isAuthorized(): bool
{
return (int)CurrentUser::get()->getId() > 0;
}
public static function url(): string
{
return SITE_DIR . (self::isAuthorized() ? "personal/" : "login/");
}
public static function label(string $accountCode, string $loginCode): string
{
$code = self::isAuthorized() ? $accountCode : $loginCode;
$text = (string)Loc::getMessage($code);
return $text !== "" ? $text : (string)Loc::getMessage($accountCode);
}
}