Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
collector.php
1<?php
3
5
6
8{
9 const SETTING_ID = 'TRANSLATE_INDEX';
10
11 const ACTION_COLLECT_LANG_PATH = 'collectLangPath';
12 const ACTION_COLLECT_PATH = 'collectPath';
13 const ACTION_COLLECT_FILE = 'collectFile';
14 const ACTION_COLLECT_PHRASE = 'collectPhrase';
15 const ACTION_PURGE = 'purge';
16 const ACTION_CANCEL = 'cancel';
17
23 public function configureActions()
24 {
25 $configureActions = parent::configureActions();
26 $permission = new Translate\Controller\CheckPermission(Translate\Permission::READ);
27
28 $configureActions[self::ACTION_COLLECT_LANG_PATH] = [
29 'class' => Translate\Controller\Index\CollectLangPath::class,
30 '+prefilters' => [
31 $permission
32 ],
33 ];
34
35 $configureActions[self::ACTION_COLLECT_PATH] = [
36 'class' => Translate\Controller\Index\CollectPathIndex::class,
37 '+prefilters' => [
38 $permission
39 ],
40 ];
41
42 $configureActions[self::ACTION_COLLECT_FILE] = [
43 'class' => Translate\Controller\Index\CollectFileIndex::class,
44 '+prefilters' => [
45 $permission
46 ],
47 ];
48
49 $configureActions[self::ACTION_COLLECT_PHRASE] = [
50 'class' => Translate\Controller\Index\CollectPhraseIndex::class,
51 '+prefilters' => [
52 $permission
53 ],
54 ];
55
56 $configureActions[self::ACTION_PURGE] = [
57 'class' => Translate\Controller\Index\Purge::class,
58 '+prefilters' => [
59 $permission
60 ],
61 ];
62
63 $configureActions[self::ACTION_CANCEL] = [
64 '+prefilters' => [
65 $permission
66 ],
67 ];
68
69 return $configureActions;
70 }
71
75 public function cancelAction(): array
76 {
77 $settingId = static::SETTING_ID;
78
79 unset($_SESSION[$settingId]);
80
81 return [
82 'STATUS' => Translate\Controller\STATUS_COMPLETED
83 ];
84 }
85}