Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
document.php
1
<?php
2
3
namespace
Bitrix\Main\UI\Viewer\Transformation
;
4
5
use
Bitrix\Main\Config\Option
;
6
use
Bitrix\Main\ModuleManager
;
7
use
Bitrix\Main\Web\MimeType
;
8
use Bitrix\Transformer\DocumentTransformer;
9
10
class
Document
extends
Transformation
11
{
12
public
static
function
getInputContentTypes
()
13
{
14
return
[
15
'text/html'
,
16
'text/plain'
,
17
'application/xml'
,
18
'application/pdf'
,
19
'application/rtf'
,
20
'text/rtf'
,
21
'application/msword'
,
22
'application/vnd.ms-excel'
,
23
'application/vnd.ms-powerpoint'
,
24
'application/vnd.ms-visio'
,
25
'application/vnd.ms-visio.drawing'
,
26
'application/vnd.ms-word.document.macroEnabled.12'
,
27
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
,
28
'application/vnd.ms-word.template.macroEnabled.12'
,
29
'application/vnd.openxmlformats-officedocument.wordprocessingml.template'
,
30
'application/vnd.ms-powerpoint.template.macroEnabled.12'
,
31
'application/vnd.openxmlformats-officedocument.presentationml.template'
,
32
'application/vnd.ms-powerpoint.addin.macroEnabled.12'
,
33
'application/vnd.ms-powerpoint.slideshow.macroEnabled.12'
,
34
'application/vnd.openxmlformats-officedocument.presentationml.slideshow'
,
35
'application/vnd.ms-powerpoint.presentation.macroEnabled.12'
,
36
'application/vnd.openxmlformats-officedocument.presentationml.presentation'
,
37
'application/vnd.ms-excel.addin.macroEnabled.12'
,
38
'application/vnd.ms-excel.sheet.binary.macroEnabled.12'
,
39
'application/vnd.ms-excel.sheet.macroEnabled.12'
,
40
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
41
'application/vnd.ms-excel.template.macroEnabled.12'
,
42
'application/vnd.openxmlformats-officedocument.spreadsheetml.template'
,
43
'image/vnd.djvu'
,
44
'application/epub+zip'
,
45
'message/rfc822'
,
46
'application/vnd.oasis.opendocument.text'
,
47
];
48
}
49
50
public
function
getOutputContentType
()
51
{
52
return
MimeType::getByFileExtension
($this->
getOutputExtension
());
53
}
54
55
public
function
getOutputExtension
()
56
{
57
return
'pdf'
;
58
}
59
60
public
function
buildTransformer
()
61
{
62
return
new
DocumentTransformer();
63
}
64
65
public
function
getInputMaxSize
()
66
{
67
$defaultValue =
ModuleManager::isModuleInstalled
(
'bitrix24'
)? 40 : 10;
68
69
return
intval(Option::get(
'main'
,
'max_size_for_document_transformation'
, $defaultValue)) * 1024 * 1024;
70
}
71
}
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Main\ModuleManager
Definition
modulemanager.php:5
Bitrix\Main\ModuleManager\isModuleInstalled
static isModuleInstalled($moduleName)
Definition
modulemanager.php:67
Bitrix\Main\UI\Viewer\Transformation\Document
Definition
document.php:11
Bitrix\Main\UI\Viewer\Transformation\Document\buildTransformer
buildTransformer()
Definition
document.php:60
Bitrix\Main\UI\Viewer\Transformation\Document\getInputMaxSize
getInputMaxSize()
Definition
document.php:65
Bitrix\Main\UI\Viewer\Transformation\Document\getOutputContentType
getOutputContentType()
Definition
document.php:50
Bitrix\Main\UI\Viewer\Transformation\Document\getOutputExtension
getOutputExtension()
Definition
document.php:55
Bitrix\Main\UI\Viewer\Transformation\Document\getInputContentTypes
static getInputContentTypes()
Definition
document.php:12
Bitrix\Main\UI\Viewer\Transformation\Transformation
Definition
transformation.php:8
Bitrix\Main\Web\MimeType
Definition
mimetype.php:7
Bitrix\Main\Web\MimeType\getByFileExtension
static getByFileExtension($extension)
Definition
mimetype.php:238
Bitrix\Main\UI\Viewer\Transformation
Definition
callbackhandler.php:3
modules
main
lib
ui
viewer
transformation
document.php
Создано системой
1.10.0