Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
file.php
1<?php
3
6
7
8class File
10{
11 const ACTION_SAVE = 'save';
12 const ACTION_SAVE_SOURCE = 'saveSource';
13 const ACTION_CLEAN_ETHALON = 'cleanEthalon';
14 const ACTION_CANCEL = 'cancel';
15 const ACTION_WIPE_EMPTY = 'wipeEmpty';
16
17
23 public function configureActions()
24 {
25 $configureActions = parent::configureActions();
26 $permissionWrite = new Translate\Controller\CheckPermission(Translate\Permission::WRITE);
27 $filterHttpMethod = new Main\Engine\ActionFilter\HttpMethod([Main\Engine\ActionFilter\HttpMethod::METHOD_POST]);
28
29 $configureActions[self::ACTION_SAVE] = [
30 'class' => Translate\Controller\Editor\SaveFile::class,
31 '-prefilters' => [
32 Main\Engine\ActionFilter\HttpMethod::class,
33 ],
34 '+prefilters' => [
35 $permissionWrite,
36 $filterHttpMethod
37 ],
38 ];
39
40 $configureActions[self::ACTION_SAVE_SOURCE] = [
41 'class' => Translate\Controller\Editor\SaveSource::class,
42 '-prefilters' => [
43 Main\Engine\ActionFilter\HttpMethod::class,
44 ],
45 '+prefilters' => [
46 $permissionWrite,
47 new Translate\Controller\CheckPermission(Translate\Permission::SOURCE),
48 $filterHttpMethod
49 ],
50 ];
51
52 $configureActions[self::ACTION_CLEAN_ETHALON] = [
53 'class' => Translate\Controller\Editor\CleanEthalon::class,
54 '+prefilters' => [
55 $permissionWrite,
56 ],
57 ];
58
59 $configureActions[self::ACTION_WIPE_EMPTY] = [
60 'class' => Translate\Controller\Editor\WipeEmpty::class,
61 '+prefilters' => [
62 $permissionWrite,
63 ],
64 ];
65
66 $configureActions[self::ACTION_CANCEL] = [
67 '+prefilters' => [
68 $permissionWrite
69 ],
70 ];
71
72 return $configureActions;
73 }
74
75
79 public function cancelAction(): array
80 {
81 return [
82 'STATUS' => Translate\Controller\STATUS_COMPLETED
83 ];
84 }
85}