Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
actiongettemplate.php
1
<?php
8
namespace
Bitrix\Sender\Internals\CommonAjax
;
9
10
use
Bitrix\Main\Localization\Loc
;
11
use
Bitrix\Main\Loader
;
12
use
Bitrix\Main\HttpRequest
;
13
14
use
Bitrix\Sender\Templates
;
15
use
Bitrix\Sender\Internals\QueryController
as
Controller
;
16
use
Bitrix\Fileman\Block\Editor
;
17
18
Loc::loadMessages
(__FILE__);
19
24
class
ActionGetTemplate
extends
CommonAction
25
{
26
const
NAME
=
'getTemplate'
;
27
33
public
static
function
get
()
34
{
35
return
parent::get()->setRequestMethodGet();
36
}
37
44
public
static
function
onRequest
(
HttpRequest
$request,
Controller
\
Response
$response)
45
{
46
$content = $response->initContentHtml();
47
48
$type = $request->get(
'template_type'
);
49
$id = $request->get(
'template_id'
);
50
$charset = $request->get(
'template_charset'
) ?? SITE_CHARSET;
51
52
Loader::includeModule(
'fileman'
);
53
$template = Templates\Selector::create()
54
->withTypeId($type)
55
->withId($id)
56
->get();
57
if
(!$template)
58
{
59
return
;
60
}
61
62
$html =
Editor::getHtmlForEditor
($template[
'FIELDS'
][
'MESSAGE'
][
'VALUE'
], $charset);
63
$content->set($html);
64
}
65
}
Bitrix\Fileman\Block\Editor
Definition
editor.php:20
Bitrix\Fileman\Block\Editor\getHtmlForEditor
static getHtmlForEditor($html, $charset=null)
Definition
editor.php:1089
Bitrix\Main\HttpRequest
Definition
httprequest.php:20
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Response
Definition
response.php:5
Bitrix\Sender\Internals\CommonAjax\ActionGetTemplate
Definition
actiongettemplate.php:25
Bitrix\Sender\Internals\CommonAjax\ActionGetTemplate\NAME
const NAME
Definition
actiongettemplate.php:26
Bitrix\Sender\Internals\CommonAjax\ActionGetTemplate\onRequest
static onRequest(HttpRequest $request, Controller\Response $response)
Definition
actiongettemplate.php:44
Bitrix\Sender\Internals\CommonAjax\CommonAction
Definition
commonaction.php:22
Bitrix\Sender\Internals\CommonAjax
Definition
actiongettemplate.php:8
Bitrix\Sender\Internals\QueryController
Definition
action.php:8
Bitrix\Sender\Templates
Definition
category.php:8
modules
sender
lib
internals
commonajax
actiongettemplate.php
Создано системой
1.10.0