1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
Background.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Im\V2\Controller\Call
;
4
5
use
Bitrix\Main\Engine\Controller
;
6
use
Bitrix\UI\InfoHelper
;
7
8
class
Background
extends
Controller
9
{
13
public
function
getAction
()
14
{
15
$diskFolder =
\Bitrix\Im\Call\Background::getUploadFolder
();
16
$diskFolderId = $diskFolder? (int)$diskFolder->getId(): 0;
17
$infoHelperParams =
\Bitrix\Main\Loader::includeModule
(
'ui'
)?
InfoHelper::getInitParams
(): [];
18
19
return
[
20
'backgrounds'
=> [
21
'default'
=>
\Bitrix\Im\Call\Background::get
(),
22
'custom'
=>
\Bitrix\Im\Call\Background::getCustom
(),
23
],
24
'upload'
=> [
25
'folderId'
=> $diskFolderId,
26
],
27
'limits'
=>
\Bitrix\Im\Call\Background::getLimitForJs
(),
28
'infoHelperParams'
=> $infoHelperParams,
29
];
30
}
31
35
public
function
commitAction
(
int
$fileId)
36
{
37
$result
=
\CIMDisk::CommitBackgroundFile
(
38
$this->getCurrentUser()->getId(),
39
$fileId
40
);
41
42
if
(!
$result
)
43
{
44
$this->addError(
new
\
Bitrix
\
Main
\
Error
(
45
"Specified fileId is not located in background folder."
,
46
"FILE_ID_ERROR"
47
));
48
49
return
false
;
50
}
51
52
return
[
53
'result'
=> true
54
];
55
}
56
60
public
function
deleteAction
(
int
$fileId)
61
{
62
$result
=
\CIMDisk::DeleteBackgroundFile
(
63
$this->getCurrentUser()->getId(),
64
$fileId
65
);
66
67
if
(!
$result
)
68
{
69
$this->addError(
new
\
Bitrix
\
Main
\
Error
(
70
"Specified fileId is not located in background folder."
,
71
"FILE_ID_ERROR"
72
));
73
74
return
false
;
75
}
76
77
return
[
78
'result'
=> true
79
];
80
}
81
}
Bitrix\Im\Call\Background\getUploadFolder
static getUploadFolder($userId=null)
Определения
background.php:311
Bitrix\Im\Call\Background\get
static get()
Определения
background.php:11
Bitrix\Im\Call\Background\getLimitForJs
static getLimitForJs()
Определения
background.php:322
Bitrix\Im\Call\Background\getCustom
static getCustom()
Определения
background.php:255
Bitrix\Im\V2\Controller\Call\Background\getAction
getAction()
Определения
Background.php:13
Bitrix\Im\V2\Controller\Call\Background\commitAction
commitAction(int $fileId)
Определения
Background.php:35
Bitrix\Im\V2\Controller\Call\Background\deleteAction
deleteAction(int $fileId)
Определения
Background.php:60
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\Loader\includeModule
static includeModule($moduleName)
Определения
loader.php:67
Bitrix\UI\InfoHelper
Определения
infohelper.php:21
Bitrix\UI\InfoHelper\getInitParams
static getInitParams(?string $currentUrl=null)
Определения
infohelper.php:22
CIMDisk\CommitBackgroundFile
static CommitBackgroundFile($userId, $fileId)
Определения
im_disk.php:2140
CIMDisk\DeleteBackgroundFile
static DeleteBackgroundFile($userId, $fileId)
Определения
im_disk.php:2163
$result
$result
Определения
get_property_values.php:14
Bitrix\Im\V2\Chat\Background
Определения
Background.php:3
Bitrix\Im\V2\Controller\Call
Определения
Background.php:3
Bitrix\Main\Controller
Определения
agreement.php:2
Bitrix\Main
Bitrix
bitrix
modules
im
lib
V2
Controller
Call
Background.php
Создано системой
1.14.0