Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
PermissionArticles.php
1<?php
2
4
7
9{
10 private const PERMISSIONS_ARTICLES = [
25 ];
26 private const SECTION_ARTICLES = [
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}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29