1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
comp_lib.php
См. документацию.
1
<?
2
IncludeModuleLangFile
(__FILE__);
3
4
class
CListFileControl
5
{
7
private
$_ob_file =
null
;
9
private
$_input_name =
null
;
11
private
static
$_counter = 0;
12
17
function
__construct
($obFile, $input_name)
18
{
19
$this->_ob_file = $obFile;
20
$this->_input_name = $input_name;
21
}
22
36
function
GetHTML
(
$params
)
37
{
38
$html =
''
;
39
40
$max_size = 102400;
41
$max_width = 150;
42
$max_height = 150;
43
$url_template =
''
;
44
$download_url =
''
;
45
$show_input =
true
;
46
$show_info =
true
;
47
48
if
(is_array(
$params
))
49
{
50
if
(isset(
$params
[
'max_size'
]))
51
$max_size = intval(
$params
[
'max_size'
]);
52
if
(isset(
$params
[
'max_width'
]))
53
$max_width = intval(
$params
[
'max_width'
]);
54
if
(isset(
$params
[
'max_height'
]))
55
$max_height = intval(
$params
[
'max_height'
]);
56
if
(isset(
$params
[
'url_template'
]))
57
$url_template =
$params
[
'url_template'
];
58
if
(isset(
$params
[
'download_url'
]))
59
$download_url =
$params
[
'download_url'
];
60
if
(isset(
$params
[
'show_input'
]))
61
$show_input = (bool)
$params
[
'show_input'
];
62
if
(isset(
$params
[
'show_info'
]))
63
$show_info = (bool)
$params
[
'show_info'
];
64
}
65
66
if
($download_url)
67
$url_template = $download_url;
68
69
if
($show_input)
70
{
71
$html .= $this->_ob_file->GetInputHTML(
array
(
72
'show_info'
=>
true
,
73
'url_template'
=> $url_template,
74
'input_name'
=> $this->_input_name,
75
));
76
}
77
elseif
($show_info)
78
{
79
$html .= $this->_ob_file->GetInfoHTML(
array
(
80
'url_template'
=> $url_template,
81
));
82
}
83
84
CUtil::InitJSCore(
array
(
"ui.viewer"
));
85
86
if
($this->_ob_file->IsImage() && $this->_ob_file->GetSize() < $max_size)
87
{
88
$img_src = $this->_ob_file->GetImgSrc(
array
(
'url_template'
=>$url_template));
89
self::$_counter++;
90
$divId =
'lists-image-'
. self::$_counter;
91
92
$html .=
'<div id="'
.$divId.
'">'
;
93
$html .= $this->_ob_file->GetImgHtml(
array
(
94
'url_template'
=> $url_template,
95
'max_width'
=> $max_width,
96
'max_height'
=> $max_height,
97
'html_attributes'
=>
array
(
98
'border'
=>
'0'
,
99
'data-bx-image'
=> $img_src,
100
),
101
));
102
$html .=
'</div>'
;
103
}
104
105
$html .= $this->_ob_file->GetLinkHtml(
array
(
106
'url_template'
=> $url_template,
107
'download_text'
=>
$params
[
'download_text'
],
108
));
109
110
return
$html;
111
}
112
}
113
?>
CListFileControl
Определения
comp_lib.php:5
CListFileControl\__construct
__construct($obFile, $input_name)
Определения
comp_lib.php:17
CListFileControl\GetHTML
GetHTML($params)
Определения
comp_lib.php:36
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
IncludeModuleLangFile
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения
tools.php:3778
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
lists
classes
general
comp_lib.php
Создано системой
1.14.0