12 $bCloudsBrowse = is_object(
$USER) &&
$USER->CanDoOperation(
"clouds_browse") && $arConfig[
"operation"] ===
"O";
14 CUtil::InitJSCore(
array(
'ajax',
'window'));
20 if(CModule::IncludeModule(
"fileman"))
22 $arConfig[
'path'] = ($arConfig[
'arPath'][
'PATH'] ??
'');
23 $arConfig[
'site'] = ($arConfig[
'arPath'][
'SITE'] ??
'');
24 $arConfig[
'lang'] = ($arConfig[
'lang'] ?? LANGUAGE_ID);
25 $arConfig[
'zIndex'] = $arConfig[
'zIndex'] ?? 2500;
26 $arConfig[
'saveConfig'] = $arConfig[
'saveConfig'] ??
true;
28 $path =
$io->CombinePath(
"/", $arConfig[
'path']);
30 $rootPath = CSite::GetSiteDocRoot($arConfig[
'site']);
32 while (!
$io->DirectoryExists($rootPath.$path))
34 $rpos = mb_strrpos(
$path,
'/');
35 if ($rpos ===
false || $rpos < 1)
40 $path = rtrim(mb_substr(
$path, 0, $rpos),
"/\\");
44 $arConfig[
'path'] =
$path;
47 if (!isset($arConfig[
'event']))
49 $functionError .=
GetMessage(
"BX_FD_NO_EVENT").
". ";
53 $arConfig[
'event'] = preg_replace(
"/[^a-zA-Z0-9_]/i",
"", $arConfig[
'event']);
54 if ($arConfig[
'event'] ==
'')
55 $functionError .=
GetMessage(
"BX_FD_NO_EVENT").
". ";
58 if (!isset($arConfig[
'arResultDest']) || !is_array($arConfig[
'arResultDest']))
60 $functionError .=
GetMessage(
"BX_FD_NO_RETURN_PRM").
". ";
64 if (isset($arConfig[
'arResultDest'][
"FUNCTION_NAME"]) && $arConfig[
'arResultDest'][
"FUNCTION_NAME"] <>
'')
66 $arConfig[
'arResultDest'][
"FUNCTION_NAME"] = preg_replace(
"/[^a-zA-Z0-9_]/i",
"", $arConfig[
'arResultDest'][
"FUNCTION_NAME"]);
67 if ($arConfig[
'arResultDest'][
"FUNCTION_NAME"] ==
'')
68 $functionError .=
GetMessage(
"BX_FD_NO_RETURN_FNC").
". ";
70 $resultDest =
"FUNCTION";
72 elseif (isset($arConfig[
'arResultDest'][
"FORM_NAME"]) && $arConfig[
'arResultDest'][
"FORM_NAME"] <>
''
73 && isset($arConfig[
'arResultDest'][
"FORM_ELEMENT_NAME"]) && $arConfig[
'arResultDest'][
"FORM_ELEMENT_NAME"] <>
'')
75 $arConfig[
'arResultDest'][
"FORM_NAME"] = preg_replace(
"/[^a-zA-Z0-9_]/i",
"", $arConfig[
'arResultDest'][
"FORM_NAME"]);
76 $arConfig[
'arResultDest'][
"FORM_ELEMENT_NAME"] = preg_replace(
"/[^a-zA-Z0-9_]/i",
"", $arConfig[
'arResultDest'][
"FORM_ELEMENT_NAME"]);
77 if ($arConfig[
'arResultDest'][
"FORM_NAME"] ==
'' || $arConfig[
'arResultDest'][
"FORM_ELEMENT_NAME"] ==
'')
78 $functionError .=
GetMessage(
"BX_FD_NO_RETURN_FRM").
". ";
82 elseif (isset($arConfig[
'arResultDest'][
"ELEMENT_ID"]) && $arConfig[
'arResultDest'][
"ELEMENT_ID"] <>
'')
84 $arConfig[
'arResultDest'][
"ELEMENT_ID"] = preg_replace(
"/[^a-zA-Z0-9_]/i",
"", $arConfig[
'arResultDest'][
"ELEMENT_ID"]);
85 if ($arConfig[
'arResultDest'][
"ELEMENT_ID"] ==
'')
86 $functionError .=
GetMessage(
"BX_FD_NO_RETURN_ID").
". ";
92 $functionError .=
GetMessage(
"BX_FD_BAD_RETURN").
". ";
98 $functionError =
GetMessage(
"BX_FD_NO_FILEMAN");
101 if ($functionError ==
'')
105 var mess_SESS_EXPIRED =
'<?=GetMessageJS('BX_FD_ERROR
').':
'.GetMessageJS('BX_FD_SESS_EXPIRED
')?>';
106 var mess_ACCESS_DENIED =
'<?=GetMessageJS('BX_FD_ERROR
').':
'.GetMessageJS('BX_FD_NO_PERMS
')?>';
107 window.<?= CUtil::JSEscape($arConfig[
'event'])?> =
function(bLoadJS, Params)
112 <?
if(!
$USER->CanDoOperation(
'fileman_view_file_structure')):?>
114 alert(mess_ACCESS_DENIED);
120 $fd_config = stripslashes(CUserOptions::GetOption(
"fileman",
"file_dialog_config",
"N"));
121 if ($fd_config ==
"N" || $arConfig[
'saveConfig'] ===
false)
126 site :
'<?= CUtil::JSEscape($arConfig['site
'])?>',
127 path :
'<?= CUtil::JSEscape($arConfig['path'])?>',
136 $res = explode(
";", $fd_config);
138 $arConfig[
'site'] =
$res[0];
140 $arConfig[
'path'] = rtrim(
$res[1],
" /\\");
142 $rootPath = CSite::GetSiteDocRoot($arConfig[
'site']);
144 if (!
$io->DirectoryExists($rootPath.$arConfig[
'path']))
145 $arConfig[
'path'] =
'/';
149 site :
'<?= CUtil::JSEscape($arConfig['site
'])?>',
150 path :
'<?= CUtil::JSEscape($arConfig['path'])?>',
151 view :
'<?= CUtil::JSEscape($res[2])?>',
152 sort :
'<?= CUtil::JSEscape($res[3])?>',
153 sort_order :
'<?= CUtil::JSEscape($res[4])?>'
158 if (!window.BXFileDialog)
160 if (bLoadJS !==
false)
161 BX.loadScript(
'<?=CUtil::GetAdditionalFileURL("/bitrix/js/main/file_dialog.js")?>');
162 return setTimeout(
function(){window[
'<?= CUtil::JSEscape($arConfig['event'])?>'](
false, Params)}, 50);
167 submitFuncName :
'<?= CUtil::JSEscape($arConfig['event'])?>Result',
169 operation:
'<?= CUtil::JSEscape($arConfig['operation
'])?>',
170 showUploadTab : <?= $arConfig[
'showUploadTab'] ?
'true' :
'false';?>,
171 showAddToMenuTab : <?= (isset($arConfig[
'showAddToMenuTab']) && $arConfig[
'showAddToMenuTab'] ?
'true' :
'false');?>,
172 site :
'<?= CUtil::JSEscape($arConfig['site
'] ?? '')?>',
173 path :
'<?= CUtil::JSEscape($arConfig['path'] ?? '')?>',
174 lang :
'<?= CUtil::JSEscape($arConfig['lang'] ?? '')?>',
175 fileFilter :
'<?= CUtil::JSEscape($arConfig['fileFilter
'] ?? '')?>',
176 allowAllFiles : <?= (!isset($arConfig[
'allowAllFiles']) || $arConfig[
'allowAllFiles'] !==
false ?
'true' :
'false')?>,
177 saveConfig : <?= (!isset($arConfig[
'saveConfig']) || $arConfig[
'saveConfig'] !==
false ?
'true' :
'false');?>,
178 sessid:
"<?=bitrix_sessid()?>",
180 genThumb: <?= COption::GetOptionString(
"fileman",
"file_dialog_gen_thumb",
"Y") ==
'Y' ?
'true' :
'false';?>,
181 zIndex: <?= CUtil::JSEscape($arConfig[
'zIndex'] ?? 0)?>
184 if(window.oBXFileDialog && window.oBXFileDialog.UserConfig)
186 UserConfig = oBXFileDialog.UserConfig;
187 oConfig.path = UserConfig.path;
188 oConfig.site = UserConfig.site;
192 oConfig.path = Params.path;
194 oConfig.site = Params.site;
196 oBXFileDialog =
new BXFileDialog();
197 oBXFileDialog.Open(oConfig, UserConfig);
200 window.<?= CUtil::JSEscape($arConfig[
'event'])?>Result =
function(filename,
path, site,
title, menu)
204if($bCloudsBrowse && CModule::IncludeModule(
'clouds'))
208 if($arBucket[
"ACTIVE"] ==
"Y")
211 if($obBucket->Init())
212 $arBuckets[$arBucket[
"BUCKET"]] = rtrim($obBucket->GetFileSRC(
"/"),
"/");
220 if (
path.substr(
path.length-1) ==
"/")
222 var full = (
path +
'/' + filename).replace(/\/\
226 var arBuckets = <?echo Json::encode($arBuckets)?>;
229 full = arBuckets[site] + filename;
233 if (
'<?= CUtil::JSEscape($arConfig['select'])?>' ==
'D')
236 <?
if ($resultDest ==
"FUNCTION"): ?>
237 <?= CUtil::JSEscape($arConfig[
'arResultDest'][
"FUNCTION_NAME"]).
"(filename, path, site, title || '', menu || '');"?>
238 <?
elseif($resultDest ==
"FORM"): ?>
239 document.<?= CUtil::JSEscape($arConfig[
'arResultDest'][
"FORM_NAME"])?>.<?= CUtil::JSEscape($arConfig[
'arResultDest'][
"FORM_ELEMENT_NAME"])?>.value = full;
240 BX.fireEvent(document.<?= CUtil::JSEscape($arConfig[
'arResultDest'][
"FORM_NAME"])?>.<?= CUtil::JSEscape($arConfig[
'arResultDest'][
"FORM_ELEMENT_NAME"])?>,
'change');
241 <?
elseif($resultDest ==
"ID"): ?>
242 BX(
'<?= CUtil::JSEscape($arConfig['arResultDest
']["ELEMENT_ID"])?>').value = full;
243 BX.fireEvent(BX(
'<?= CUtil::JSEscape($arConfig['arResultDest
']["ELEMENT_ID"])?>'),
'change');
252 echo
"<font color=\"#FF0000\">".htmlspecialcharsbx($functionError).
"</font>";
258 if(!defined(
"BX_B_FILE_DIALOG_SCRIPT_LOADED"))
260 define(
"BX_B_FILE_DIALOG_SCRIPT_LOADED",
true);
264 jsUtils.addEvent(window,
'load',
function(){jsUtils.loadJSFile(
'<?=CUtil::GetAdditionalFileURL("/bitrix/js/main/file_dialog.js")?>');},
false);
270 public static function Start($Params)
273 $bCloudsBrowse = is_object(
$USER) &&
$USER->CanDoOperation(
'clouds_browse') && $Params[
"operation"] ===
"O";
276 $dbSitesList = CSite::GetList();
277 $arSitesPP = Array();
278 while($arSite = $dbSitesList->GetNext())
280 $arSites[$arSite[
"ID"]] = $arSite[
"NAME"] ? $arSite[
"NAME"] : $arSite[
"ID"];
281 $arSitesPP[] =
array(
282 "ID" => $arSite[
"ID"],
283 "TEXT" =>
'['.$arSite[
"ID"].
'] '.$arSite[
"NAME"],
284 "ONCLICK" =>
"oBXDialogControls.SiteSelectorOnChange('".$arSite[
"ID"].
"')",
285 "ICON" => ($arSite[
"ID"] == $Params[
'site']) ?
'checked' :
''
289 if($bCloudsBrowse && CModule::IncludeModule(
'clouds'))
293 if($arBucket[
"ACTIVE"] ==
"Y")
295 $id = $arBucket[
"BUCKET"];
296 $arSites[$id] = $arBucket[
"BUCKET"];
297 $arSitesPP[] =
array(
299 "TEXT" => $arBucket[
"BUCKET"],
300 "ONCLICK" =>
"oBXDialogControls.SiteSelectorOnChange('".$id.
"')",
301 "ICON" => ($id == $Params[
'site']) ?
'checked' :
''
308 $Params[
'arSitesPP'] = $arSitesPP;
309 $Params[
'site'] = ($Params[
'site'] && isset(
$arSites[$Params[
'site']])) ? $Params[
'site'] : key(
$arSites);
311 if (!in_array(mb_strtolower($Params[
'lang']),
array(
'en',
'ru')))
315 $Params[
'lang'] =
$lang[
'ID'];
317 $Params[
'lang'] =
'en';
320 if ($Params[
'bAddToMenu'])
323 $Params[
'arMenuTypes'] =
$armt[0];
324 $Params[
'arMenuTypesScript'] =
$armt[1];
325 $Params[
'menuItems'] =
$armt[2];
337 if ($Params[
'bAddToMenu'])
340 if ($Params[
'loadRecursively'])
342 'path' => $Params[
'path'],
343 'site' => $Params[
'site'],
344 'bCheckEmpty' =>
true,
345 'getFiles' => $Params[
'getFiles'],
346 'loadRoot' => $Params[
'loadRoot'],
347 'bThrowException' =>
true,
348 'operation' => $Params[
'operation'],
352 'path' => $Params[
'path'],
353 'site' => $Params[
'site'],
354 'bCheckEmpty' =>
true,
355 'getFiles' => $Params[
'getFiles'],
356 'operation' => $Params[
'operation'],
360 echo
'window.action_warning = "'.addslashes($e->GetString()).
'";';
362 echo
'window.load_items_correct = true;';
372 $u =
new CAdminPopup(
"fd_site_list",
"fd_site_list", $Params[
'arSitesPP'],
array(
'zIndex' => 3520,
'dxShadow' => 0));
376<form
id=
"file_dialog" name=
"file_dialog" onsubmit=
"return false;">
377<table
class=
"bx-file-dialog">
379 <td
class=
"bxfd-cntrl-cell">
380 <div
id=
"__bx_fd_top_controls_container">
381 <table
class=
"bx-fd-top-contr-tbl">
384 <td
style=
"width:22px!important; padding: 0 4px 0 5px !important;">
385 <div
id=
"__bx_site_selector" bxvalue=
"<?=htmlspecialcharsbx($Params['site'])?>" onclick=
"oBXDialogControls.SiteSelectorOnClick(this);" class=
"site_selector_div"><span><?=
htmlspecialcharsbx($Params[
'site'])?></span><span
class=
"fd_iconkit site_selector_div_arrow">&
nbsp;&
nbsp;</span></div>
388 <td
style=
"padding: 0 2px 0 2px !important;">
389 <input
class=
"fd_input" type=
"text" id=
"__bx_dir_path_bar">
391 <td nowrap
style=
"width:170px !important; padding: 0 2px 0 2px !important;">
392 <img src=
"/bitrix/images/1.gif" class=
"fd_iconkit go_button" id=
"__bx_dir_path_go" title=
"<?=GetMessage("FD_GO_TO
")?>"/>
393 <img src=
"/bitrix/images/1.gif" __bx_disable=
"Y" class=
"fd_iconkit path_back_dis" title=
"<?=GetMessage("FD_GO_BACK
")?>" id=
"__bx_dir_path_back"/>
394 <img src=
"/bitrix/images/1.gif" __bx_disable=
"Y" class=
"fd_iconkit path_forward_dis" title=
"<?=GetMessage("FD_GO_FORWARD
")?>" id=
"__bx_dir_path_forward"/>
395 <img src=
"/bitrix/images/1.gif" class=
"fd_iconkit dir_path_up" title=
"<?=GetMessage("FD_GO_UP
")?>" id=
"__bx_dir_path_up" />
396 <img src=
"/bitrix/images/1.gif" class=
"fd_iconkit dir_path_root" title=
"<?=GetMessage("FD_GO_TO_ROOT
")?>" id=
"__bx_dir_path_root" />
397 <img src=
"/bitrix/images/1.gif" class=
"fd_iconkit new_dir" title=
"<?=GetMessage("FD_NEW_FOLDER
")?>" id=
"__bx_new_dir" />
398 <img src=
"/bitrix/images/1.gif" class=
"fd_iconkit refresh" title=
"<?=GetMessage("FD_REFRESH
")?>" onclick=
"oBXDialogControls.RefreshOnclick();"/>
401 Array(
"ID" =>
'list',
"TEXT" =>
GetMessage(
"FD_VIEW_LIST"),
"ONCLICK" =>
"oBXDialogControls.ViewSelector.OnChange('list')"),
402 Array(
"ID" =>
'detail',
"TEXT" =>
GetMessage(
"FD_VIEW_DETAIL"),
"ONCLICK" =>
"oBXDialogControls.ViewSelector.OnChange('detail')"),
403 Array(
"ID" =>
'preview',
"TEXT" =>
GetMessage(
"FD_VIEW_PREVIEW"),
"ONCLICK" =>
"oBXDialogControls.ViewSelector.OnChange('preview')")
405 $u =
new CAdminPopup(
"fd_view_list",
"fd_view_list", $arViews,
array(
'zIndex' => 2500,
'dxShadow' => 0));
408 <img onclick=
"oBXDialogControls.ViewSelector.OnClick();" src=
"/bitrix/images/1.gif" id=
"__bx_view_selector" class=
"fd_iconkit view_selector" title=
"<?=GetMessage("FD_SELECT_VIEW
")?>"/>
410 <td nowrap
style=
"width:180px !important; padding: 0 6px 0 3px !important; text-align:right !important;" align=
"right">
412 <
select class=
"fd_select" id=
"__bx_sort_selector" title=
"<?=GetMessage("FD_SORT_BY
")?>" style=
"font-size:11px !important;">
413 <option value=
"name"><?=
GetMessage(
"FD_SORT_BY_NAME")?></option>
414 <option value=
"type"><?=
GetMessage(
"FD_SORT_BY_TYPE")?></option>
415 <option value=
"size"><?=
GetMessage(
"FD_SORT_BY_SIZE")?></option>
416 <option value=
"date"><?=
GetMessage(
"FD_SORT_BY_DATE")?></option>
419 <td
style=
"width:20px !important; padding: 0 6px 0 3px !important;">
420 <img src=
"/bitrix/images/1.gif" class=
"fd_iconkit sort_up" title=
"<?=GetMessage("FD_CHANGE_SORT_ORDER
")?>" __bx_value=
"asc" id=
"__bx_sort_order" />
428 <td
style=
"vertical-align:top !important; height:398px !important;">
429 <div
id=
"__bx_fd_tree_and_window" style=
"display:block">
430 <table
style=
"width:743px !important; height:250px !important;">
432 <td
class=
"bxfd-tree-cont">
433 <div
id=
"__bx_treeContainer" class=
"fd_window bxfd-tree-cont-div"></div>
435 <td
class=
"bxfd-window-cont">
436 <div
class=
"fd_window" ><div
id=
"__bx_windowContainer" class=
"bxfd-win-cont"></div></div>
441 <div
id=
"__bx_fd_preview_and_panel" style=
"display:block;">
442 <table
style=
"width:100% !important;height:132px !important; padding:0 !important;" border=
"0">
444 <td
style=
"width:25% !important; height: 100% !important;">
445 <div
style=
"margin: 3px 8px 3px 5px;border:1px solid #C6C6C6"><div
style=
"height:127px;">
446 <div
id=
"bxfd_previewContainer"></div>
447 <div
id=
"bxfd_addInfoContainer"></div>
450 <td
style=
"width:70% !important; vertical-align:top !important;">
451 <div
class=
"bxfd-save-cont">
454 <td
class=
"bxfd-sc-cell" colspan=
"2">
455 <input type=
"text" style=
"width:98% !important;margin-bottom:5px !important;" id=
"__bx_file_path_bar">
456 <
select style=
"width:98% !important; display:none; margin-bottom:5px !important;" id=
"__bx_file_filter"></
select>
457 <div
id=
"__bx_page_title_cont" style=
"display:none;">
459 <input type=
"text" style=
"width:98% !important;" id=
"__bx_page_title1">
464 <td
class=
"bxfd-sc-cell2">
465 <table
id=
"add2menu_cont" style=
"display:none"><tr>
466 <td><input type=
"checkbox" id=
"__bx_fd_add_to_menu"></td>
467 <td><label
for=
"__bx_fd_add_to_menu"><?=
GetMessage(
"FD_ADD_PAGE_2_MENU")?></label></td>
470 <td
class=
"bxfd-sc-cell3">
471 <input
style=
"width:100px !important;" type=
"button" id=
"__bx_fd_submit_but" value=
"">
472 <input
style=
"width:100px !important;" type=
"button" onclick=
"oBXFileDialog.Close()" value=
"<?=GetMessage("FD_BUT_CANCEL
");?>">
481 <div
id=
"__bx_fd_load" style=
"display:none;">
482 <div
id=
"bxfd_upload_container"><iframe
id=
"bxfd_iframe_upload" src=
"javascript:''" frameborder=
"0"></iframe></div>
484 <div
id=
"__bx_fd_container_add2menu" class=
"bxfd-add-2-menu-tab"><?
if ($Params[
'bAddToMenu']) :?><table
class=
"bx-fd-add-2-menu-tbl">
486 <td
style=
"height:30px">
487 <table
class=
"fd_tab_title">
489 <td
class=
"icon"><img
class=
"bxfd-add-to-menu-icon" src=
"/bitrix/images/1.gif" width=
"32" height=
"32"/></td>
490 <td
class=
"title"><?=
GetMessage(
"FD_ADD_PAGE_2_MENU_TITLE")?></td>
493 <td colspan=
"2" class=
"delimiter"></td>
499 <td
style=
"height:310px !important; vertical-align:top !important;">
500 <table
id=
"add2menuTable" class=
"bxfd-add-2-menu-tbl">
502 <td
style=
"width:200px !important; text-align:right !important;"><?=
GetMessage(
"FD_FILE_NAME")?></td>
503 <td
style=
"width:250px !important;" id=
"__bx_fd_file_name"></td>
507 <td><input type=
"text" id=
"__bx_page_title2" value=
""></td>
512 <
select id=
"__bx_fd_menutype" name=
"menutype">
514 <option value=
"<?=htmlspecialcharsbx($Params['arMenuTypes'][$i]['key'])?>"><?=
htmlspecialcharsbx($Params[
'arMenuTypes'][
$i][
'title'])?></option>
520 <td
style=
"vertical-align:top !important; text-align:right !important;"><?=
GetMessage(
"FD_MENU_POINT")?></td>
522 <input type=
"radio" name=
"itemtype" id=
"__bx_fd_itemtype_n" value=
"n" checked> <label
for=
"__bx_fd_itemtype_n"><?=
GetMessage(
"FD_ADD_NEW")?></label><br>
523 <input type=
"radio" name=
"itemtype" id=
"__bx_fd_itemtype_e" value=
"e"> <label
for=
"__bx_fd_itemtype_e"><?=
GetMessage(
"FD_ATTACH_2_EXISTENT")?></label>
528 <td><input type=
"text" name=
"newp" id=
"__bx_fd_newp" value=
""></td>
533 <
select name=
"newppos" id=
"__bx_fd_newppos">
541 <tr
id=
"__bx_fd_e3" style=
"display:none;">
544 <
select name=
"menuitem" id=
"__bx_fd_menuitem">
562 <td
class=
"bx-fd-buttons-cont">
563 <input type=
"button" id=
"__bx_fd_submit_but2" value=
"">
564 <input type=
"button" onclick=
"oBXFileDialog.Close()" value=
"<?=GetMessage("FD_BUT_CANCEL
");?>">
567 </table><?
endif;?></div>
571 <td
id=
"__bx_tab_cont" style=
"background-color: #D7D7D7;"></td>
575<div
id=
"__bx_get_real_size_cont"></div>
582 $fd_engine_js_src =
'/bitrix/js/main/file_dialog_engine.js';
583 $fd_css_src =
'/bitrix/themes/.default/file_dialog.css';
587BXSite =
"<?= CUtil::JSEscape($Params['site'])?>";
588BXLang =
"<?= CUtil::JSEscape($Params['lang'])?>";
589if (!window.arFDDirs || !window.arFDFiles || !window.arFDPermission)
595if (!window.arFDMenuTypes)
598 if (!empty($Params[
'arMenuTypesScript']))
599 echo $Params[
'arMenuTypesScript'];
602 'path' => $Params[
'path'],
603 'site' => $Params[
'site'],
604 'bCheckEmpty' =>
true,
605 'getFiles' => $Params[
'getFiles'],
607 'bFindCorrectPath' =>
true,
608 'bThrowException' =>
false,
609 'operation' => $Params[
'operation'],
613 echo
'alert("'.CUtil::JSEscape($e->GetString()).
'");';
619arSites[
'<?= CUtil::JSEscape($key)?>'] =
'<?= CUtil::JSEscape($val)?>';
625 if (!window.BXWaitWindow || !window.BXDialogTree || !window.BXDialogWindow)
627 setTimeout(
function(){OnLoad();}, 20);
631 window.oWaitWindow =
new BXWaitWindow();
632 window.oBXDialogTree =
new BXDialogTree();
633 if(oBXFileDialog.oConfig.operation ==
'S' && oBXFileDialog.oConfig.showAddToMenuTab)
634 window.oBXMenuHandling =
new BXMenuHandling();
635 window.oBXDialogControls =
new BXDialogControls();
636 window.oBXDialogWindow =
new BXDialogWindow();
637 window.oBXDialogTabs =
new BXDialogTabs();
638 window.oBXFDContextMenu =
false;
640 if (oBXFileDialog.oConfig.operation ==
'O' && oBXFileDialog.oConfig.showUploadTab)
642 oBXDialogTabs.AddTab(
'tab1',
'<?= GetMessageJS("FD_OPEN_TAB_TITLE")?>', _Show_tab_OPEN,
true);
643 oBXDialogTabs.AddTab(
'tab2',
'<?= GetMessageJS("FD_LOAD_TAB_TITLE")?>',_Show_tab_LOAD,
false);
645 else if(oBXFileDialog.oConfig.operation ==
'S' && oBXFileDialog.oConfig.showAddToMenuTab)
647 oBXDialogTabs.AddTab(
'tab1',
'<?= GetMessageJS("FD_SAVE_TAB_TITLE")?>', _Show_tab_SAVE,
true);
648 oBXDialogTabs.AddTab(
'tab2',
'<?= GetMessageJS("FD_MENU_TAB_TITLE")?>', _Show_tab_MENU,
false);
649 BX(
'add2menu_cont').style.display =
'block';
651 oBXDialogTabs.DisplayTabs();
653 oBXDialogTree.Append();
654 oBXFileDialog.SubmitFileDialog = SubmitFileDialog;
656 BX.onCustomEvent(window,
'onFileDialogLoaded');
660if (!window.fd_styles_link || !window.fd_styles_link.parentNode)
661 window.fd_styles_link = jsUtils.loadCSSFile(
"<?=$fd_css_src.'?v='.@filemtime($_SERVER['DOCUMENT_ROOT'].$fd_css_src)?>");
664if (window.BXDialogTree)
667 BX.loadScript(
"<?=$fd_engine_js_src.'?v='.@filemtime($_SERVER['DOCUMENT_ROOT'].$fd_engine_js_src)?>", OnLoad);
681 FD_SAVE_TAB_TITLE :
'<?=GetMessageJS('FD_SAVE_TAB_TITLE
')?>',
682 FD_OPEN_DIR :
'<?=GetMessageJS('FD_OPEN_DIR
')?>',
683 FD_OPEN_TAB_TITLE :
'<?=GetMessageJS('FD_OPEN_TAB_TITLE
')?>',
684 FD_CLOSE :
'<?=GetMessageJS('FD_CLOSE
')?>',
685 FD_SORT_SIZE :
'<?=GetMessageJS('FD_SORT_SIZE
')?>',
686 FD_SORT_DATE :
'<?=GetMessageJS('FD_SORT_DATE
')?>',
687 FD_SORT_NAME :
'<?=GetMessageJS('FD_SORT_NAME
')?>',
688 FD_SORT_TYPE :
'<?=GetMessageJS('FD_SORT_TYPE
')?>',
689 FD_BUT_OPEN :
'<?=GetMessageJS('FD_BUT_OPEN
')?>',
690 FD_BUT_SAVE :
'<?=GetMessageJS('FD_BUT_SAVE
')?>',
691 FD_ALL_FILES :
'<?=GetMessageJS('FD_ALL_FILES
')?>',
692 FD_ALL_IMAGES :
'<?=GetMessageJS('FD_ALL_IMAGES
')?>',
693 FD_BYTE :
'<?=GetMessageJS('FD_BYTE
')?>',
694 FD_EMPTY_FILENAME :
'<?=GetMessageJS('FD_EMPTY_FILENAME
')?>',
695 FD_INPUT_NEW_PUNKT_NAME :
'<?=GetMessageJS('FD_INPUT_NEW_PUNKT_NAME
')?>',
696 FD_LAST_POINT :
'<?=GetMessageJS('FD_LAST_POINT
')?>',
697 FD_NEWFOLDER_EXISTS :
'<?=GetMessageJS('FD_NEWFOLDER_EXISTS
')?>',
698 FD_NEWFILE_EXISTS :
'<?=GetMessageJS('FD_NEWFILE_EXISTS
')?>',
699 FD_RENAME :
'<?=GetMessageJS('FD_RENAME
')?>',
700 FD_DELETE :
'<?=GetMessageJS('FD_DELETE
')?>',
701 FD_RENAME_TITLE :
'<?=GetMessageJS('FD_RENAME_TITLE
')?>',
702 FD_DELETE_TITLE :
'<?=GetMessageJS('FD_DELETE_TITLE
')?>',
703 FD_CONFIRM_DEL_DIR :
'<?=GetMessageJS('FD_CONFIRM_DEL_DIR
')?>',
704 FD_CONFIRM_DEL_FILE :
'<?=GetMessageJS('FD_CONFIRM_DEL_FILE
')?>',
705 FD_EMPTY_NAME :
'<?=GetMessageJS('FD_EMPTY_NAME
')?>',
706 FD_INCORRECT_NAME :
'<?=GetMessageJS('FD_INCORRECT_NAME
')?>',
707 FD_LOADIND :
'<?=GetMessageJS('FD_LOADING
')?>...',
708 FD_EMPTY_NAME :
'<?=GetMessageJS('FD_EMPTY_NAME
')?>',
709 FD_INCORRECT_EXT :
'<?=GetMessageJS('FD_INCORRECT_EXT
')?>',
710 FD_LOAD_EXIST_CONFIRM :
'<?=GetMessageJS('FD_LOAD_EXIST_CONFIRM
')?>',
711 FD_SESS_EXPIRED :
'<?=GetMessageJS('BX_FD_ERROR
').':
'.GetMessageJS('BX_FD_SESS_EXPIRED
')?>',
712 FD_ERROR :
'<?=GetMessageJS('BX_FD_ERROR
')?>',
713 FD_FILE :
'<?=GetMessageJS('FD_FILE
')?>',
714 FD_FOLDER :
'<?=GetMessageJS('FD_FOLDER
')?>',
715 FD_IMAGE :
'<?=GetMessageJS('FD_IMAGE
')?>'
724 if(!CModule::IncludeModule(
"fileman"))
734 $arAllItems = Array();
735 $arMenuTypes = Array();
742 if(!
$USER->CanDoFileOperation(
'fm_view_file', Array(
$site, $menuname)))
755 $arAllItems[
$key] = $arItems;
756 if($strSelected ==
"")
771 $strTypes.=
"'".CUtil::JSEscape(
$arTypes[
$i]).
"'";
774 for($j = 0; $j <
count($arItems); $j++)
776 if($j>0)$strItems .=
",";
777 $strItems.=
"'".CUtil::JSEscape($arItems[$j]).
"'";
782 $scriptRes =
"\n".
'arFDMenuTypes["'.CUtil::JSEscape(
$path).
'"] = {types: ['.$strTypes.
'], items: ['.$strItems.
']};'.
"\n";
789 return array($arMenuTypes, $scriptRes, $arAllItems[$strSelected]);
795 static $checkChildren, $genTmb;
797 if (!isset($checkChildren, $genTmb))
799 $checkChildren = COption::GetOptionString(
"fileman",
"file_dialog_check_children",
"Y") ==
'Y';
800 $genTmb = COption::GetOptionString(
"fileman",
"file_dialog_gen_thumb",
"Y") ==
'Y';
803 if(mb_strlen($Params[
"site"]) > 2)
805 if (!
$USER->CanDoOperation(
'clouds_browse'))
811 if($Params[
'operation'] !==
'O')
817 if(!CModule::IncludeModule(
'clouds'))
826 if($arBucket[
"ACTIVE"] ==
"Y" && $arBucket[
"BUCKET"] === $Params[
"site"])
836 if(!$obBucket->Init())
842 $path = preg_replace(
"#[\\\\\\/]+#",
"/",
"/".
$APPLICATION->UnJSEscape($Params[
'path']));
843 $path_js =
$path ==
"" ?
"/" : addslashes(htmlspecialcharsex(
$path));
844 $path_js = str_replace(
"//",
"/", $path_js);
853arFDDirs[
'<?=$path_js?>'] = [];
854arFDFiles[
'<?=$path_js?>'] = [];
859arFDDirs[
'<?=$path_js?>'][<?=$ind?>] =
861 name :
'<?=CUtil::JSEscape($dir)?>',
862 path :
'<?=CUtil::JSEscape(preg_replace("#[\\\\\\/]+#", "/", $path."/".$dir));?>',
864 permission : {del :
false, ren :
false},
873 if ($Params[
'getFiles'])
875 foreach (
$arFiles[
'file'] as $ind => $file)
878arFDFiles[
'<?=$path_js?>'][<?=$ind?>] =
880 name :
'<?=CUtil::JSEscape($file)?>',
881 path :
'<?=CUtil::JSEscape($obBucket->GetFileSRC($path."/".$file))?>',
882 permission : {del :
false, ren :
false},
885 size :
'<?=$arFiles["file_size"][$ind];?>'
892arFDPermission[
'<?=$path_js?>'] = {
903 $site = $Params[
'site'];
905 $path_js =
$path ==
"" ?
"/" : addslashes(htmlspecialcharsex(
$path));
906 $path_js = str_replace(
"//",
"/", $path_js);
907 $bCheckEmpty = $Params[
'bCheckEmpty'];
909 $rootPath = CSite::GetSiteDocRoot(
$site);
910 if (!
$io->FileExists($rootPath.$path) && !
$io->DirectoryExists($rootPath.$path) && $Params[
'bThrowException'] ===
true)
924arFDDirs[
'<?=$path_js?>'] = [];
925arFDFiles[
'<?=$path_js?>'] = [];
930 $name = addslashes(htmlspecialcharsex($Dir[
"NAME"]));
931 $path_i = addslashes(htmlspecialcharsex(
$path)).
"/".
$name;
932 $path_i = str_replace(
"//",
"/", $path_i);
933 $arPath_i = Array(
$site, $path_i);
935 if (!
$USER->CanDoFileOperation(
'fm_view_listing', $arPath_i))
942 $dirTmp =
$io->GetDirectory($rootPath.$path.
'/'.
$name);
943 $arDirTmpChildren = $dirTmp->GetChildren();
944 foreach ($arDirTmpChildren as $child)
946 if(!$child->IsDirectory())
952 $perm_del =
$USER->CanDoFileOperation(
'fm_delete_folder', $arPath_i) ?
'true' :
'false';
953 $perm_ren =
$USER->CanDoFileOperation(
'fm_rename_folder', $arPath_i) ?
'true' :
'false';
956arFDDirs[
'<?=$path_js?>'][<?=$ind?>] =
958 name :
'<?=CUtil::JSEscape($name)?>',
959 path :
'<?=CUtil::JSEscape($path_i)?>',
960 empty: <?= $empty ?
'true' :
'false';?>,
961 permission : {del : <?=$perm_del?>, ren : <?=$perm_ren?>},
962 date :
'<?=$Dir["DATE"];?>',
963 timestamp :
'<?=$Dir["TIMESTAMP"];?>',
969 if ($Params[
'getFiles'])
974 $name = addslashes(htmlspecialcharsex($File[
"NAME"]));
975 $path_i = addslashes(htmlspecialcharsex($File[
"ABS_PATH"]));
976 $path_i = str_replace(
"//",
"/", $path_i);
977 $arPath_i = Array(
$site, $path_i);
979 if (!
$USER->CanDoFileOperation(
'fm_view_file', $arPath_i))
983 $perm_del =
$USER->CanDoFileOperation(
'fm_delete_file', $arPath_i) ?
'true' :
'false';
984 $perm_ren =
$USER->CanDoFileOperation(
'fm_rename_file', $arPath_i) ?
'true' :
'false';
990 if (in_array($ext,
array(
'gif',
'jpg',
'jpeg',
'png',
'jpe',
'bmp')))
992 $upload_dir = COption::GetOptionString(
"main",
"upload_dir",
"upload");
993 $tmbPath =
"/".$upload_dir.
"/tmp/fd_tmb".$path_i;
994 $destinationFile = $rootPath.$tmbPath;
995 if (!file_exists($destinationFile))
997 $sourceFile = $File[
'PATH'];
998 if (CFile::ResizeImageFile($sourceFile, $destinationFile,
array(
'width' => 140,
'height' => 110)))
999 $imageAddProps =
",\n".
'tmb_src : \''.CUtil::JSEscape($tmbPath).
'\'';
1002 $imageAddProps =
",\n".
'tmb_src : \''.CUtil::JSEscape($tmbPath).
'\'';
1006arFDFiles[
'<?=$path_js?>'][<?=$ind?>] =
1008 name :
'<?=CUtil::JSEscape($name)?>',
1009 path :
'<?=CUtil::JSEscape($path_i)?>',
1010 permission : {del : <?=$perm_del?>, ren : <?=$perm_ren?>},
1011 date :
'<?=$File["DATE"];?>',
1012 timestamp :
'<?=$File["TIMESTAMP"];?>',
1013 size :
'<?=$File["SIZE"];?>'<?=$imageAddProps?>
1021arFDPermission[
'<?=$path_js?>'] = {
1022 new_folder : <?= (
$USER->CanDoFileOperation(
'fm_create_new_folder',
$arPath) ?
'true' :
'false');?>,
1023 upload : <?= (
$USER->CanDoFileOperation(
'fm_upload_file',
$arPath) ?
'true' :
'false');?>
1035 $rootPath = CSite::GetSiteDocRoot($Params[
'site']);
1037 if (!
$io->FileExists($rootPath.$path) && !
$io->DirectoryExists($rootPath.$path))
1039 if ($Params[
'bThrowException'] ===
true)
1049 if ($Params[
'loadRoot'] !==
false)
1051 $Params[
'path'] =
'/';
1062 $curPath .=
'/'.$catalog;
1063 $Params[
'path'] = $curPath;
1075 $site = $Params[
'site'];
1077 if(CModule::IncludeModule(
"fileman"))
1082 $dirname = str_replace(
"/",
"_",
$APPLICATION->UnJSEscape($Params[
'name']));
1086 if (!
$USER->CanDoFileOperation(
'fm_create_new_folder',
$arPath))
1096 if ($dirname <>
'' && ($mess = self::CheckFileName($dirname)) !==
true)
1122 self::LoadItems(
array(
'path' =>
$path,
'site' =>
$site,
'bAddToMenu' => $Params[
'bAddToMenu'],
'loadRecursively' =>
false,
'getFiles' => $Params[
'getFiles']));
1131 if(CModule::IncludeModule(
"fileman"))
1136 $site = $Params[
'site'];
1167 $parPath = mb_substr(
$path, 0, mb_strrpos(
$path,
'/'));
1168 self::LoadItems(
array(
'path' => $parPath,
'site' =>
$site,
'bAddToMenu' => $Params[
'bAddToMenu'],
'loadRecursively' =>
false,
'getFiles' => $Params[
'getFiles']));
1178 if(CModule::IncludeModule(
"fileman"))
1183 $site = $Params[
'site'];
1186 $oldName = str_replace(
"/",
"_",
$APPLICATION->UnJSEscape($Params[
'old_name']));
1194 $arPath1 = Array(
$site, $oldPath);
1195 $arPath2 = Array(
$site, $newPath);
1199 if (
$io->DirectoryExists($oldAbsPath))
1201 if (
$io->FileExists($oldAbsPath))
1206 !
$USER->CanDoOperation(
'edit_php') &&
1208 str_starts_with($oldName,
".")
1210 str_starts_with(
$name,
".")
1228 elseif (!
$USER->CanDoFileOperation(
'fm_rename_'.$type,$arPath1) || !
$USER->CanDoFileOperation(
'fm_rename_'.$type,$arPath2))
1232 if (
$name <> '' && ($mess = self::CheckFileName(
$name)) !==
true)
1234 else if(
$name ==
'')
1240 elseif(!
$io->Rename($oldAbsPath, $newAbsPath))
1253 self::LoadItems(
array(
'path' =>
$path,
'site' =>
$site,
'bAddToMenu' => $Params[
'bAddToMenu'],
'loadRecursively' =>
false,
'getFiles' => $Params[
'getFiles']));
1259 if (!
$io->ValidateFilenameString(
$str))
1269 window.action_status =
true;
1271 window.action_warning =
'<?= CUtil::JSEscape($strWarning)?>';
1272 window.action_status =
false;
1281 $Params[
'path'] =
$APPLICATION->UnJSEscape($Params[
'path']);
1282 $Params[
'site'] =
$APPLICATION->UnJSEscape($Params[
'site']);
1283 $Params[
'view'] = in_array($Params[
'view'],
array(
'detail',
'preview')) ? $Params[
'view'] :
'list';
1284 $Params[
'sort'] = in_array($Params[
'sort'],
array(
'size',
'type',
'date')) ? $Params[
'sort'] :
'name';
1285 $Params[
'sort_order'] = ($Params[
'sort_order'] ==
'asc') ?
'asc' :
'des';
1287 CUserOptions::SetOption(
"fileman",
"file_dialog_config", addslashes($Params[
'site'].
';'.$Params[
'path'].
';'.$Params[
'view'].
';'.$Params[
'sort'].
';'.$Params[
'sort_order']));
1292 if(CModule::IncludeModule(
"fileman"))
1296 $path = $Params[
'path'];
1301 if(!
$USER->CanDoFileOperation(
'fm_view_file',
$arPath))
1311<BODY
id=
"__flash" style=
"margin:0; border-width: 0;">
1312<embed
id=
"__flash_preview" pluginspage=
"http://www.macromedia.com/go/getflashplayer" type=
"application/x-shockwave-flash" name=
"__flash_preview" quality=
"high" width=
"<?=$Params['width']?>" height=
"<?=$Params['height']?>" src=
"<?=htmlspecialcharsex($path)?>"></embed>
1322 $lang = htmlspecialcharsex($Params[
'lang']);
1323 $site = htmlspecialcharsex($Params[
'site']);
1327<HEAD><?=
$res?></HEAD>
1328<BODY
style=
"margin:0 !important; background-color:#F4F4F4; font-family:Verdana,serif;">
1329<form name=
"frmLoad" action=
"file_dialog.php?action=uploader&lang=<?=$lang?>&site=<?=$site?>&<?=bitrix_sessid_get()?>" onsubmit=
"return parent.oBXDialogControls.Uploader.OnSubmit();" method=
"post" enctype=
"multipart/form-data">
1330 <input
id=
"__bx_fd_server_site" type=
"hidden" name=
"cur_site" value=
"<?=$site?>" />
1331 <table
style=
"width: 540px; height: 123px; font-size:70%">
1336 <td
style=
"width:60%; padding-top: 0;" valign=
"top" align=
"left">
1337 <input
id=
"__bx_fd_load_file" size=
"45" type=
"file" name=
"load_file">
1345 <input
id=
"__bx_fd_server_file_name" style=
"width:100%;" type=
"text">
1349 <td
style=
"width:100%;" valign=
"top" align=
"left" colspan=
"2">
1350 <table
style=
"font-size:100%"><tr>
1351 <td><input
id=
"_bx_fd_upload_and_open" value=
"Y" type=
"checkbox" name=
"upload_and_open" checked=
"checked"></td>
1352 <td><label
for=
"_bx_fd_upload_and_open"> <?=
GetMessage(
"FD_UPLOAD_AND_OPEN");?></label></td>
1357 <td
style=
"width:100%; padding:0 8px 5px 0" valign=
"bottom" align=
"right" colSpan=
"2">
1358 <input type=
"submit" value=
"<?=GetMessage("FD_BUT_LOAD
");?>">
1359 <input
style=
"width:100px;" type=
"button" onclick=
"parent.oBXFileDialog.Close()" value=
"<?=GetMessage("FD_BUT_CANCEL
");?>">
1363 <input type=
"hidden" name=
"MAX_FILE_SIZE" value=
"1000000000">
1364 <input type=
"hidden" name=
"lang" value=
"<?=$lang?>">
1365 <input type=
"hidden" name=
"site" value=
"<?=$site?>">
1366 <input
id=
"__bx_fd_rewrite" type=
"hidden" name=
"rewrite" value=
"N">
1367 <input
id=
"__bx_fd_upload_path" type=
"hidden" name=
"path" value=
"">
1368 <input
id=
"__bx_fd_upload_fname" type=
"hidden" name=
"filename" value=
"">
1377 $buffer =
'parent.oWaitWindow.Hide();';
1378 $F = $Params[
'file'];
1382 if (isset($F[
"tmp_name"]) && $F[
"tmp_name"] <>
'' && $F[
"name"] <>
'' || is_uploaded_file($F[
"tmp_name"]))
1387 $path = $Params[
'path'];
1388 $site = $Params[
'site'];
1389 $upload_and_open = $Params[
'upload_and_open'];
1390 $rootPath = CSite::GetSiteDocRoot(
$site);
1402 $fn =
$io->ExtractNameFromPath($pathto);
1403 if(
$USER->CanDoFileOperation(
'fm_upload_file',
array(
$site, $pathto)) &&
1407 if(!
$io->FileExists($rootPath.$pathto) ||
$_REQUEST[
"rewrite"] ==
"Y")
1412 if(COption::GetOptionInt(
"main",
"disk_space") > 0)
1416 if ($quota->checkDiskQuota(
array(
"FILE_SIZE"=>filesize($F[
"tmp_name"]))))
1422 $io->Copy($F[
"tmp_name"], $rootPath.$pathto);
1423 $flTmp =
$io->GetFile($rootPath.$pathto);
1424 $flTmp->MarkWritable();
1426 if(COption::GetOptionInt(
"main",
"disk_space") > 0)
1427 CDiskQuota::updateDiskQuota(
"file", $flTmp->GetFileSize(),
"copy");
1429 $buffer =
'setTimeout(function(){parent.oBXDialogControls.Uploader.OnAfterUpload("'.$filename.
'", '.($upload_and_open ==
"Y" ?
'true' :
'false').
');}, 50);';
1455 return '<script>'.$buffer.
'</script>';
if($canUseYandexMarket) $strWarning
static EchoActionStatus($strWarning='')
static PreviewFlash($Params)
static MakeNewDir($Params)
static UploadFile($Params)
static BuildDialog($Params)
static GetItemsRecursively($Params)
static CheckFileName($str)
static SetUserConfig($Params)
static ShowScript($arConfig)
static ShowUploadForm($Params)
static LoadItems($Params)
static GetMenuTypes($site, $path, $bEchoResult=false)
static SecurePathVar($str)
static GetMenuArray($abs_path)
if(!defined("ADMIN_AJAX_MODE") &&(($_REQUEST["mode"] ?? '') !='excel')) $buffer
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
GetDirList($path, &$arDirs, &$arFiles, $arFilter=array(), $sort=array(), $type="DF", $bLogical=false, $task_mode=false)
if(!defined('SITE_ID')) $lang
HasScriptExtension($check_name)
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Rel2Abs($curdir, $relpath)
GetMessage($name, $aReplace=null)
global_menu_<?echo $menu["menu_id"]?> adm main menu item icon adm main menu item text text adm main menu hover adm submenu menucontainer menu_id menu_id items_id items_id desktop menu_id block none adm global submenu<?=($subMenuDisplay=="block" ? " adm-global-submenu-active" :"")?> global_submenu_<?echo $menu["menu_id"]?> text MAIN_PR_ADMIN_FAV items adm submenu items wrap adm submenu items stretch wrap BX adminMenu itemsStretchScroll()"> <table class if (!empty( $menu["items"])) elseif ( $menu[ 'menu_id']=='desktop') if ( $menu[ 'menu_id']=='desktop') endforeach
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
<? endif;?> window document title
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"