1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
PermissionArticles.php
См. документацию.
1<?php
2
3namespace Bitrix\Catalog\Access\Permission;
4
5use Bitrix\Catalog\Access\Component\PermissionConfig;
6use Bitrix\Main\Localization\Loc;
7
9{
10 private const PERMISSIONS_ARTICLES = [
25 ];
26 private const SECTION_ARTICLES = [
27 PermissionConfig::SECTION_STORE_DOCUMENT_ARRIVAL => 16342676,
28 PermissionConfig::SECTION_STORE_DOCUMENT_STORE_ADJUSTMENT => 16342722,
29 PermissionConfig::SECTION_STORE_DOCUMENT_MOVING => 16342750,
30 PermissionConfig::SECTION_STORE_DOCUMENT_DEDUCT => 16342812,
31 PermissionConfig::SECTION_STORE_DOCUMENT_SALES_ORDER => 16342768,
32 ];
33
34 private function getLinkHtml(int $code): string
35 {
36 $onclick = "top.BX.Helper.show('redirect=detail&code={$code}'); return false;";
37 $text = Loc::getMessage('CATALOG_PERMISSION_DICTIONARY_ARTICLES_LINK_TEXT');
38
39 return '<a href="javascript:;" onclick="' . $onclick . '">' . $text .'</a>';
40 }
41
49 public function getPermissionArticleLink(string $permissionId): ?string
50 {
51 $code = self::PERMISSIONS_ARTICLES[$permissionId] ?? null;
52 if (!$code)
53 {
54 return null;
55 }
56
57 return $this->getLinkHtml($code);
58 }
59
67 public function getSectionArticleLink(string $sectionCode): ?string
68 {
69 $code = self::SECTION_ARTICLES[$sectionCode] ?? null;
70 if (!$code)
71 {
72 return null;
73 }
74
75 return $this->getLinkHtml($code);
76 }
77}
getPermissionArticleLink(string $permissionId)
Определения PermissionArticles.php:49
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$text
Определения template_pdf.php:79