Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/translate/lib/controller/editor/ |
Upload File : |
<?php namespace Bitrix\Translate\Controller\Editor; use Bitrix\Main; use Bitrix\Translate; class File extends Translate\Controller\Controller { const ACTION_SAVE = 'save'; const ACTION_SAVE_SOURCE = 'saveSource'; const ACTION_CLEAN_ETHALON = 'cleanEthalon'; const ACTION_CANCEL = 'cancel'; const ACTION_WIPE_EMPTY = 'wipeEmpty'; /** * Configures actions. * * @return array */ public function configureActions() { $configureActions = parent::configureActions(); $permissionWrite = new Translate\Controller\CheckPermission(Translate\Permission::WRITE); $filterHttpMethod = new Main\Engine\ActionFilter\HttpMethod([Main\Engine\ActionFilter\HttpMethod::METHOD_POST]); $configureActions[self::ACTION_SAVE] = [ 'class' => Translate\Controller\Editor\SaveFile::class, '-prefilters' => [ Main\Engine\ActionFilter\HttpMethod::class, ], '+prefilters' => [ $permissionWrite, $filterHttpMethod ], ]; $configureActions[self::ACTION_SAVE_SOURCE] = [ 'class' => Translate\Controller\Editor\SaveSource::class, '-prefilters' => [ Main\Engine\ActionFilter\HttpMethod::class, ], '+prefilters' => [ $permissionWrite, new Translate\Controller\CheckPermission(Translate\Permission::SOURCE), $filterHttpMethod ], ]; $configureActions[self::ACTION_CLEAN_ETHALON] = [ 'class' => Translate\Controller\Editor\CleanEthalon::class, '+prefilters' => [ $permissionWrite, ], ]; $configureActions[self::ACTION_WIPE_EMPTY] = [ 'class' => Translate\Controller\Editor\WipeEmpty::class, '+prefilters' => [ $permissionWrite, ], ]; $configureActions[self::ACTION_CANCEL] = [ '+prefilters' => [ $permissionWrite ], ]; return $configureActions; } /** * @return array */ public function cancelAction(): array { return [ 'STATUS' => Translate\Controller\STATUS_COMPLETED ]; } }