1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
uploadercontextgenerator.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\UserField\File;
4
5use Bitrix\Main\UI\FileInputUtility;
6
8{
9 public function __construct(
10 private readonly FileInputUtility $fileInputUtility,
11 private readonly array $userField
12 )
13 {
14 }
15
16 public function getContextInEditMode(string $cid): array
17 {
18 return array_merge(
19 $this->getBaseOptions(),
20 [
21 'cid' => $cid,
22 ]
23 );
24 }
25
26 public function getContextForFileInViewMode(int $fileId): array
27 {
28 return array_merge(
29 $this->getBaseOptions(),
30 [
31 'signedFileId' => (new UploaderFileSigner(
32 (string)($this->userField['ENTITY_ID'] ?? ''),
33 (string)($this->userField['FIELD_NAME'] ?? '')
34 ))->sign($fileId),
35 ]
36 );
37 }
38
39 public function getControlId(): string
40 {
41 return $this->fileInputUtility->getUserFieldCid($this->userField);
42 }
43
44 private function getBaseOptions(): array
45 {
46 return [
47 'id' => (int)($this->userField['ID'] ?? 0),
48 'entityId' => (string)($this->userField['ENTITY_ID'] ?? ''),
49 'fieldName' => (string)($this->userField['FIELD_NAME'] ?? ''),
50 'multiple' => ($this->userField['MULTIPLE'] ?? '') === 'Y',
51 ];
52 }
53}
__construct(private readonly FileInputUtility $fileInputUtility, private readonly array $userField)
Определения uploadercontextgenerator.php:9
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804