Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
actiongettemplate.php
1<?php
9
13
17
18Loc::loadMessages(__FILE__);
19
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}
static getHtmlForEditor($html, $charset=null)
Definition editor.php:1089
static loadMessages($file)
Definition loc.php:64
static onRequest(HttpRequest $request, Controller\Response $response)