1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
disk.php
См. документацию.
1<?php
2namespace Bitrix\Im\Controller\Call;
3
4use Bitrix\Disk\Controller\File,
5 Bitrix\Main\Engine\Controller,
6 Bitrix\Disk\Controller\Content,
7 Bitrix\Main\Engine\ActionFilter,
8 Bitrix\Im\Controller\Call\Filter;
9use Bitrix\Main\Engine\Action;
10use Bitrix\Main\Loader;
11
18class Disk extends Controller
19{
20 protected function getDefaultPreFilters(): array
21 {
22 return [
23 new ActionFilter\HttpMethod(['POST']),
24 new Filter\Authorization(),
25 new Filter\DiskFolderAccessCheck(),
26 ];
27 }
28
29 public function configureActions(): array
30 {
31 return [
32 'upload' => [
33 '-prefilters' => [
34 ActionFilter\Csrf::class,
35 ActionFilter\Authentication::class
36 ],
37 ],
38 'commit' => [
39 '-prefilters' => [
40 ActionFilter\Csrf::class,
41 ActionFilter\Authentication::class
42 ],
43 ],
44 ];
45 }
46
47 protected function processBeforeAction(Action $action): bool
48 {
49 if (!Loader::includeModule('disk'))
50 {
51 return false;
52 }
53
54 return parent::processBeforeAction($action);
55 }
56
57 public function uploadAction($filename, $token = null)
58 {
59 $params = [
60 'filename' => $filename,
61 'token' => $token,
62 ];
63 $this->setScope(Controller::SCOPE_REST);
64
65 return $this->forward(new Content(), 'upload', $params);
66 }
67
68 public function commitAction($folderId, $filename, $contentId, $generateUniqueName = false)
69 {
70 $params = [
71 'folderId' => $folderId,
72 'filename' => $filename,
73 'contentId' => $contentId,
74 'generateUniqueName' => $generateUniqueName,
75 ];
76
77 $this->setScope(Controller::SCOPE_REST);
78
79 return $this->forward(new File(), 'createByContent', $params);
80 }
81}
getDefaultPreFilters()
Определения disk.php:20
commitAction($folderId, $filename, $contentId, $generateUniqueName=false)
Определения disk.php:68
uploadAction($filename, $token=null)
Определения disk.php:57
processBeforeAction(Action $action)
Определения disk.php:47
configureActions()
Определения disk.php:29
setScope($scope)
Определения controller.php:373
forward($controller, string $actionName, array $parameters=null)
Определения controller.php:107
$filename
Определения file_edit.php:47
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения Image.php:9
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$contentId
Определения sonet_set_content_view.php:27
$action
Определения file_dialog.php:21