%PDF- %PDF-
Direktori : /home/bitrix/www/bitrix/modules/sender/install/components/bitrix/sender.call.text.editor/ |
Current File : /home/bitrix/www/bitrix/modules/sender/install/components/bitrix/sender.call.text.editor/class.php |
<? use Bitrix\Main\Localization\Loc; use Bitrix\Main\ErrorCollection; use Bitrix\Sender\Integration\VoxImplant\SpeechRate; if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die(); } Loc::loadMessages(__FILE__); class SenderCallTextEditorComponent extends CBitrixComponent { /** @var ErrorCollection $errors */ protected $errors; protected function checkRequiredParams() { return true; } protected function initParams() { $this->arParams['INPUT_NAME'] = isset($this->arParams['INPUT_NAME']) ? $this->arParams['INPUT_NAME'] : 'TEXT'; $this->arParams['VALUE'] = isset($this->arParams['VALUE']) ? $this->arParams['VALUE'] : null; } protected function prepareResult() { $this->arResult['ACTION_URL'] = $this->getPath() . '/ajax.php'; $this->arResult['VALUE'] = htmlspecialcharsback($this->arParams['VALUE']); $this->arResult['COUNT'] = count($this->arParams['VALUE']); $this->arResult['SPEECH_RATES'] = SpeechRate::getList(); $this->arResult['SPEECH_RATE_INTERVAL'] = SpeechRate::getBaseInterval(); return true; } protected function printErrors() { foreach ($this->errors as $error) { ShowError($error); } } public function executeComponent() { $this->errors = new \Bitrix\Main\ErrorCollection(); $this->initParams(); if (!$this->checkRequiredParams()) { $this->printErrors(); return; } if (!$this->prepareResult()) { $this->printErrors(); return; } $this->includeComponentTemplate(); } }