1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
appform.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Rest\Controller
;
4
5
use Bitrix\Bitrix24\CurrentUser;
6
use
Bitrix\Main\ArgumentException
;
7
use
Bitrix\Main\Engine\Controller
;
8
use
Bitrix\Main\Engine\ActionFilter
;
9
use
Bitrix\Main\Engine\Response\AjaxJson
;
10
use
Bitrix\Main\Error
;
11
use
Bitrix\Main\Loader
;
12
use
Bitrix\Main\SystemException
;
13
use
Bitrix\Main\Web\Json
;
14
use
Bitrix\Pull\Event
;
15
use
Bitrix\Rest\AppTable
;
16
use
Bitrix\Rest\FormConfig\EventType
;
17
use
Bitrix\Rest\PullTransport
;
18
19
class
AppForm
extends
Controller
20
{
21
public
function
showAction
(
string
$config
, \
CRestServer
$server =
null
):
array
22
{
23
try
24
{
25
$transport =
new
PullTransport
();
26
}
27
catch
(\
Exception
$exception)
28
{
29
return
[
30
'error'
=>
'NOT_INSTALLED_MODULE'
,
31
'error_description'
=> $exception->getMessage()
32
];
33
}
34
35
$appForm = new \Bitrix\Rest\AppForm(
$config
);
36
37
return
[
'success'
=> $appForm->sendShowMessage($transport)];
38
}
39
40
public
function
getConfigAction
(
string
$clientId
,
string
$type
,
array
$formData = []):
AjaxJson
41
{
42
try
43
{
44
$app
= new \Bitrix\Rest\App(
$clientId
);
45
$responseData = [
46
'config'
=>
$app
->fetchAppFormConfig($formData, EventType::from(
$type
))
47
];
48
49
return
AjaxJson::createSuccess($responseData);
50
}
51
catch
(
ArgumentException
$e)
52
{
53
$this->errorCollection->setError(
new
Error
($e->getMessage()));
54
}
55
}
56
57
public
function
configureActions
():
array
58
{
59
return
[
60
'show'
=> [
61
'+prefilters'
=> [
62
new
ActionFilter\Scope
(
ActionFilter
\
Scope::REST
),
63
],
64
],
65
];
66
}
67
}
$type
$type
Определения
options.php:106
Bitrix\Main\ArgumentException
Определения
ArgumentException.php:9
Bitrix\Main\Engine\ActionFilter\Scope
Определения
scope.php:12
Bitrix\Main\Engine\ActionFilter\Scope\REST
const REST
Определения
scope.php:14
Bitrix\Main\Engine\Response\AjaxJson
Определения
ajaxjson.php:11
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\Event
Определения
event.php:5
Bitrix\Main\Loader
Определения
loader.php:13
Bitrix\Main\SystemException
Определения
SystemException.php:9
Bitrix\Main\Web\Json
Определения
json.php:9
Bitrix\Rest\AppTable
Определения
app.php:68
Bitrix\Rest\Controller\AppForm
Определения
appform.php:20
Bitrix\Rest\Controller\AppForm\getConfigAction
getConfigAction(string $clientId, string $type, array $formData=[])
Определения
appform.php:40
Bitrix\Rest\Controller\AppForm\showAction
showAction(string $config, \CRestServer $server=null)
Определения
appform.php:21
Bitrix\Rest\Controller\AppForm\configureActions
configureActions()
Определения
appform.php:57
Bitrix\Rest\PullTransport
Определения
PullTransport.php:11
CRestServer
Определения
rest.php:24
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$app
$app
Определения
proxy.php:8
Bitrix\Main\Controller
Определения
agreement.php:2
Bitrix\Main\DI\Exception
Определения
circulardependencyexception.php:3
Bitrix\Main\Engine\ActionFilter
Bitrix\Rest\Controller
Определения
appform.php:3
Bitrix\Rest\FormConfig\EventType
EventType
Определения
EventType.php:6
$config
$config
Определения
quickway.php:69
$clientId
$clientId
Определения
seo_client.php:18
bitrix
modules
rest
lib
controller
appform.php
Создано системой
1.14.0