9 CUtil::InitJSCore(
array(
'ajax',
'window'));
11 $arLangArray =
array();
12 if ($Params[
'initSearch'])
13 $arLangArray[] =
'search';
15 if ($Params[
'initServerAccess'] ??
false)
16 $arLangArray[] =
'server_access';
18 if ($Params[
'initCopy'])
19 $arLangArray[] =
'copy';
21 if ($Params[
'initPack'])
22 $arLangArray[] =
'pack';
25 $dbSitesList = CSite::GetList();
26 while($arSite = $dbSitesList->GetNext())
29 "id" => $arSite[
"ID"],
30 "dir" => $arSite[
"DIR"],
31 "text" =>
'['.$arSite[
"ID"].
'] '.$arSite[
"~NAME"],
32 "current" => $arSite[
"ID"] == $Params[
'site']
36 $arArcTypes =
array();
39 foreach ($arTypesTmp as
$key => $value)
41 $arArcTypes[] =
array(
43 "text" => mb_strtoupper(
$key)
48 <script src=
"/bitrix/js/fileman/fileman_utils.js?v=<?=@filemtime($_SERVER['DOCUMENT_ROOT'].'/bitrix/js/fileman/fileman_utils.js')?>"></script>
53 <?
if ($Params[
'initSearch']):?>
55 var oSearchDialog =
new BX.CAdminDialog({
56 title :
'<?= GetMessage('FILEMAN_SEARCH
')?>',
62 oSearchDialog.SetButtons([
65 title:
"<?= GetMessage("FM_UTIL_FIND
")?>",
68 className:
'adm-btn-save',
69 action: function(){window.oFMSearch.Search();}
73 title:
"<?= GetMessage("FM_UTIL_COUNT
")?>",
76 action: function(){window.oFMSearch.Count()}
78 oSearchDialog.btnCancel
81 window.SearchReplaceRun =
function(
path, bSearch, ssess, lastValues)
83 BX.addClass(oSearchDialog.PARTS.CONTENT,
"bx-fm-dialog-tabed");
85 oSearchDialog.adjustSizeEx();
86 oSearchDialog.PARTS.CONTENT_DATA.style.height =
'auto';
88 if (!window.oFMSearch || !window.oFMSearch.bInited)
90 window.oFMSearch =
new BXFMSearch(
92 oSearchDialog: oSearchDialog,
93 lang:
'<?= LANGUAGE_ID?>',
94 site:
'<?= CUtil::JSEscape($Params['site
'])?>',
95 sessid_get:
'<?= bitrix_sessid_get()?>',
96 viewMsFilePath:
'<?= CUtil::JSEscape($Params['viewMsFilePath
'])?>',
97 viewMsFolderPath:
'<?= CUtil::JSEscape($Params['viewMsFolderPath
'])?>',
98 dateFormat:
'<?= CLang::GetDateFormat("SHORT")?>',
105 window.oFMSearch.OnOpen({
109 lastValues: lastValues ||
false
114 <?
if ($Params[
'initCopy']):?>
116 var oCopyDialog =
new BX.CDialog({
123 oCopyDialog.SetButtons([
124 new BX.CWindowButton(
129 action: function(){window.oBXFMCopy.Process();}
131 oCopyDialog.btnCancel
134 window.CopyMoveRun =
function(arFiles, bCopy)
138 if (!window.oBXFMCopy || !window.oBXFMCopy.bInited)
140 window.oBXFMCopy =
new BXFMCopy(
142 oCopyDialog: oCopyDialog,
143 lang:
'<?= LANGUAGE_ID?>',
144 site:
'<?= CUtil::JSEscape($Params['site
'])?>',
145 sessid_get:
'<?= bitrix_sessid_get()?>',
146 viewMsFilePath:
'<?= CUtil::JSEscape($Params['viewMsFilePath
'])?>',
147 viewMsFolderPath:
'<?= CUtil::JSEscape($Params['viewMsFolderPath
'])?>',
154 window.oBXFMCopy.OnOpen({
155 path: BX(
'quick_path').value,
158 bSearch: <?= (($_GET[
'search'] ??
null) ==
"Y" ?
'true' :
'false')?>,
159 ssess:
"<?= CFilemanSearch::SecureSearchSess(($_GET['ssess'] ?? null))?>"
165 if ($Params[
'initPack']):?>
167 var oPackDialog =
new BX.CDialog(
169 title :
'pack-unpack',
175 oPackDialog.SetButtons([
176 new BX.CWindowButton(
181 action: function(){window.oBXFMPack.Process();}
183 new BX.CWindowButton(
191 window.PackUnpackRun =
function(arFiles, bPack, qPath)
195 if (!window.oBXFMPack || !window.oBXFMPack.bInited)
197 window.oBXFMPack =
new BXFMPack(
199 oPackDialog: oPackDialog,
200 lang:
'<?= LANGUAGE_ID?>',
201 site:
'<?= CUtil::JSEscape($Params['site
'])?>',
202 sessid_get:
'<?= bitrix_sessid_get()?>',
203 viewMsFilePath:
'<?= CUtil::JSEscape($Params['viewMsFilePath
'])?>',
204 viewMsFolderPath:
'<?= CUtil::JSEscape($Params['viewMsFolderPath
'])?>',
212 window.oBXFMPack.OnOpen({
213 path: BX(
'quick_path').value,
216 bSearch: <?= (($_GET[
'search'] ??
null) ==
"Y" ?
'true' :
'false')?>,
217 ssess:
"<?= CFilemanSearch::SecureSearchSess(($_GET['ssess'] ?? null))?>"
223 BX.bind(BX.browser.IsIE() ? document.body : window,
"keydown",
function(e)
228 <?if ($Params[
'initSearch']):?>
229 if (e.ctrlKey && !e.shiftKey && !e.altKey && e.keyCode == 70)
231 var js = BX(
'btn_fileman_search').getAttribute(
'href');
232 BX.evalGlobal(js.substr(
'javascript: '.length));
233 return BX.PreventDefault(e);
243 $arLangMess =
array();
244 if (in_array(
'search', $Config))
246 $arLangMess = array_merge($arLangMess,
array(
247 'Count' =>
'FM_UTIL_COUNT',
248 'Counted' =>
'FM_UTIL_COUNTED',
249 'CountedFiles' =>
'FM_UTIL_COUNTED_FILES',
250 'SearchProgress' =>
'FM_UTIL_SEARCH_PROGRESS',
251 'ShowRes' =>
'FM_UTIL_SHOW_RES',
252 'Stop' =>
'FM_UTIL_STOP_SEARCH',
253 'SearchEnded' =>
'FM_UTIL_SEARCH_ENDED',
254 'Path' =>
'FM_UTIL_SEARCH_PATH',
255 'Size' =>
'FM_UTIL_SEARCH_SIZE',
256 'Date' =>
'FM_UTIL_SEARCH_DATE',
257 'CountProgress' =>
'FM_UTIL_COUNT_PROGRESS',
258 'CountEnded' =>
'FM_UTIL_COUNT_ENDED',
259 'Find' =>
'FM_UTIL_FIND',
260 'Replace' =>
'FM_UTIL_REPLACE',
261 'ReplProgress' =>
'FM_UTIL_REPLACE_PROGRESS',
262 'ReplEnded' =>
'FM_UTIL_REPLACE_ENDED',
263 'ReplCounted' =>
'FM_UTIL_REPLACE_COUNTED',
264 'ReplCountInFiles' =>
'FM_UTIL_REPLACE_COUNT_IN_FILES',
265 'ReplShowRes' =>
'FM_UTIL_REPLACE_SHOW_RES',
266 'ReplInFileTitle' =>
'FM_UTIL_REPLACE_IN_FILE_TITLE',
267 'ReplaceConfirm' =>
'FM_UTIL_REPLACE_CONFIRM',
268 'ReplacePhraseWarn' =>
'FM_UTIL_REPLACE_WARN',
269 'SearchInFileTitle' =>
'FM_UTIL_SEARCH_IN_FILE_TITLE',
270 'CountLimitWarn' =>
'FM_UTIL_RES_COUNT_LIMIT_WARN',
274 if (in_array(
'server_access', $Config))
276 $arLangMess = array_merge($arLangMess,
array(
278 'InProcess' =>
'FM_SA_IN_PROC',
279 'Stop' =>
'FM_UTIL_STOP_SEARCH',
280 'StopTitle' =>
'FM_SA_STOP_TITLE',
281 'Return' =>
'FM_SA_RETURN',
282 'ReturnTitle' =>
'FM_SA_RETURN_TITLE',
283 'Stoped' =>
'FM_SA_STOPED',
284 'Error' =>
'FM_SA_ERROR',
288 if (in_array(
'copy', $Config))
290 $arLangMess = array_merge($arLangMess,
array(
291 'Copy' =>
'FM_UTIL_COPY',
292 'Move' =>
'FM_UTIL_MOVE',
293 'CopyTitle' =>
'FM_UTIL_COPY_TITLE',
294 'MoveTitle' =>
'FM_UTIL_MOVE_TITLE',
295 'More' =>
'FM_UTIL_MORE',
296 'NoFolder' =>
'FM_UTIL_NO_FOLDER',
297 'NoFolderNoAccess' =>
'FM_UTIL_NO_FOLDER_NO_ACCESS',
298 'FileExist' =>
'FM_UTIL_FILE_EXIST',
299 'Replace' =>
'FM_COPY_REPLACE',
300 'Rename' =>
'FM_COPY_RENAME',
301 'Skip' =>
'FM_COPY_SKIP',
302 'ToAll' =>
'FM_COPY_TO_ALL',
303 'FileExistTitle' =>
'FM_UTIL_FILE_EXIST_1',
304 'FolderExistTitle' =>
'FM_UTIL_FILE_EXIST_2',
305 'RenameTitle' =>
'FM_COPY_RENAME_TITLE'
309 if (in_array(
'pack', $Config))
311 $arLangMess = array_merge($arLangMess,
array(
312 'Pack' =>
'FM_UTIL_PACK',
313 'Unpack' =>
'FM_UTIL_UNPACK',
314 'PackTitle' =>
'FM_UTIL_PACK_TITLE',
315 'UnpackTitle' =>
'FM_UTIL_UNPACK_TITLE',
316 'UnpackError' =>
'FM_UTIL_UNPACK_ERROR',
317 'PackError' =>
'FM_UTIL_PACK_ERROR',
318 'More' =>
'FM_UTIL_MORE',
319 'NoFolder' =>
'FM_UTIL_NO_FOLDER',
320 'NoFolderNoAccess' =>
'FM_UTIL_NO_FOLDER_NO_ACCESS',
321 'FileExist' =>
'FM_UTIL_FILE_EXIST',
322 'Replace' =>
'FM_PACK_REPLACE',
323 'Rename' =>
'FM_PACK_RENAME',
324 'Skip' =>
'FM_PACK_SKIP',
325 'FileExistTitle' =>
'FM_UTIL_FILE_EXIST_1',
326 'FolderExistTitle' =>
'FM_UTIL_FILE_EXIST_2',
327 'AskNewName' =>
'FM_PACK_ASK_NEW_NAME',
328 'PackPermsError' =>
'FM_UTIL_PACK_PERMS_ERROR',
329 'PackFinishing' =>
'FM_UTIL_PACK_FINISH',
330 'PackCancel' =>
'FM_UTIL_PACK_CANCEL',
331 'PackFNameError' =>
'FM_UTIL_PACK_FNAME_ERROR'
335 if (
count($arLangMess) > 0):
337var FM_MESS = {0:0<?
foreach($arLangMess as $m1 => $m2){echo
', '.$m1.
" : '".addslashes(
GetMessage($m2)).
"'";}?>};
351 $defMask = COption::GetOptionString(
"fileman",
"search_mask",
"*.php");
353 $aTabs[] =
array(
"DIV" =>
"bx_fm_tab_search",
"TAB" =>
GetMessage(
"FM_UTIL_FIND"),
"ICON" =>
"",
"TITLE" =>
GetMessage(
"FM_UTIL_FIND_TITLE"),
"ONSELECT" =>
"window.oFMSearch.SetTab('search');");
354 $aTabs[] =
array(
"DIV" =>
"bx_fm_tab_replace",
"TAB" =>
GetMessage(
"FM_UTIL_REPLACE"),
"ICON" =>
"",
"TITLE" =>
GetMessage(
"FM_UTIL_REPLACE_TITLE"),
"ONSELECT" =>
"window.oFMSearch.SetTab('replace');");
356 $searchTabControl =
new CAdmintabControl(
"searchTabControl",
$aTabs,
false,
true);
357 $searchTabControl->SetPublicMode(
'oSearchDialog');
358 $searchTabControl->Begin();
360 <?$searchTabControl->BeginNextTab();?>
362 <div
id=
"bx_search_cont" class=
"bxfm-search-cont"><form name=
"bx_search_form" action=
"<?= $actUri?>" method=
"POST">
363 <table
id=
"bx_fms_tbl" class=
"bxfm-d-params bxfm-d-params-add-hide">
364 <tr
id=
"bx_search_in_res_tr">
365 <td
class=
"bxfm-d-label"><input
id=
"bx_search_in_res" type=
"checkbox" value=
"Y" checked=
"checked" /></td>
366 <td
class=
"bxfm-d-value"><label
for=
"bx_search_in_res" style=
"font-weight: bold;"><?=
GetMessage(
"FM_UTIL_IN_SEARCH_RESULT")?></label></td>
368 <tr
title=
'<?= GetMessage("FM_UTIL_FILE_NAME_TITLE")?>'>
369 <td
class=
"bxfm-d-label"><label
for=
"bx_search_file"><?=
GetMessage(
"FM_UTIL_FILE_NAME")?>:</label></td>
370 <td
class=
"bxfm-d-value"><input
id=
"bx_search_file" name=
"bx_search_file" value=
"<?= htmlspecialcharsbx($defMask)?>" style=
"width: 220px;" type=
"text"/></td>
372 <tr
title=
"<?= GetMessage("FM_UTIL_PHRASE_TITLE
")?>">
373 <td
class=
"bxfm-d-label"><label
for=
"bx_search_phrase"><?=
GetMessage(
"FM_UTIL_PHRASE")?>:</label></td>
374 <td
class=
"bxfm-d-value"><input
id=
"bx_search_phrase" name=
"bx_search_phrase" value=
"" style=
"width: 220px;" type=
"text"/></td>
376 <tr
class=
"bxfm-d-only-replace" title=
"<?= GetMessage("FM_UTIL_REPLACE_INP_TITLE
")?>">
377 <td
class=
"bxfm-d-label"><label
for=
"bx_replace_phrase"><?=
GetMessage(
"FM_UTIL_REPLACE_INP")?>:</label></td>
378 <td
class=
"bxfm-d-value"><input
id=
"bx_replace_phrase" name=
"bx_replace_phrase" value=
"" style=
"width: 220px;" type=
"text"/></td>
381 <tr
title=
"<?= GetMessage("FM_UTIL_DIR_TITLE
")?>">
382 <td
class=
"bxfm-d-label"><label
for=
"bx_search_dir"><?=
GetMessage(
"FM_UTIL_DIR")?>:</label></td>
383 <td
class=
"bxfm-d-value"><input
id=
"bx_search_dir" name=
"bx_search_dir" value=
"" style=
"width: 220px;" type=
"text"/> <input
id=
"bx_search_fd_but" type=
"button" value=
"..." title=
"<?= GetMessage('FD_OPEN_DIR')?>" onclick=
"FMFD_SearchDirOpen(true, {site: window.oFMSearch.oSiteSel.value, path: window.oFMSearch.pSearchDir.value});" /><span
class=
"bxfm-site-sel" id=
"bx_search_site_sel"></span></td>
386 <td
class=
"bxfm-d-label"><label
for=
"bx_search_subdir"><?=
GetMessage(
"FM_UTIL_INCLUDE_SUBFOLDER")?></label></td>
387 <td
class=
"bxfm-d-value"><input
id=
"bx_search_subdir" name=
"bx_search_subdir" type=
"checkbox" value=
"Y" checked=
"checked" /></td>
389 <tr
class=
"bxfm-d-title">
391 <a
class=
"bxfm-add-link" id=
"bx_fms_add_lnk" href=
"javascript: void(0);"><?=
GetMessage(
"FM_UTIL_ADDITIONAL")?> <span
class=
"bxfm-d-span-hide">(<?=
GetMessage(
"FM_UTIL_HIDE")?>)</span></a>
394 <tr
class=
"bxfm-add-hide" title=
"<?= GetMessage("FM_UTIL_DATE_TITLE
")?>">
395 <td
class=
"bxfm-d-label"><label
for=
"bx_search_date_sel"><?=
GetMessage(
"FM_UTIL_DATE")?>:</label></td>
396 <td
class=
"bxfm-d-value">
397 <
select id=
"bx_search_date_sel" name=
"bx_search_date_sel">
398 <option value=
""> - <?=
GetMessage(
"FM_UTIL_NO_VAL")?> - </option>
399 <option value=
"day"><?=
GetMessage(
"FM_UTIL_DAY")?></option>
400 <option value=
"week"><?=
GetMessage(
"FM_UTIL_WEEK")?></option>
401 <option value=
"month"><?=
GetMessage(
"FM_UTIL_MONTH")?></option>
402 <option value=
"year"><?=
GetMessage(
"FM_UTIL_YEAR")?></option>
403 <option value=
"set"><?=
GetMessage(
"FM_UTIL_SET_EXACTLY")?></option>
405 <div
id=
"bx_search_date_div" class=
"bxfm-d-adjust-div">
406 <?=
GetMessage(
"FM_UTIL_FROM")?>: <input name=
"bx_search_date_from" id=
"bx_search_date_from" value=
"" style=
"width: 90px;" type=
"text"/><?=
CAdminCalendar::Calendar(
"bx_search_date_from",
"bx_search_form");?>
407 <?=
GetMessage(
"FM_UTIL_TO")?>: <input name=
"bx_search_date_to" id=
"bx_search_date_to" value=
"" style=
"width: 90px;" type=
"text"/><?=
CAdminCalendar::Calendar(
"bx_search_date_to",
"bx_search_form");?>
411 <tr
class=
"bxfm-add-hide" title=
"<?= GetMessage("FM_UTIL_SIZE_TITLE
")?>">
412 <td
class=
"bxfm-d-label"><label
for=
"bx_search_size_sel"><?=
GetMessage(
"FM_UTIL_SIZE")?>:</label></td>
413 <td
class=
"bxfm-d-value">
414 <
select id=
"bx_search_size_sel" name=
"bx_search_size_sel">
415 <option value=
""> - <?=
GetMessage(
"FM_UTIL_NO_VAL")?> - </option>
416 <option value=
"100"><?=
GetMessage(
"FM_UTIL_SIZE_100")?></option>
417 <option value=
"100_500"><?=
GetMessage(
"FM_UTIL_SIZE_100_500")?></option>
418 <option value=
"500"><?=
GetMessage(
"FM_UTIL_SIZE_500")?></option>
419 <option value=
"set"><?=
GetMessage(
"FM_UTIL_SET_EXACTLY")?></option>
421 <div
id=
"bx_search_size_div" class=
"bxfm-d-adjust-div">
422 <?=
GetMessage(
"FM_UTIL_SIZE_FROM")?>: <input
id=
"bx_search_size_from" name=
"bx_search_size_from" value=
"" style=
"width: 70px;" type=
"text"/><?=
GetMessage(
"FM_UTIL_KB")?> &
nbsp;
423 <?=
GetMessage(
"FM_UTIL_SIZE_TO")?>: <input
id=
"bx_search_size_to" name=
"bx_search_size_to" value=
"" style=
"width: 70px;" type=
"text"/><?=
GetMessage(
"FM_UTIL_KB")?>
427 <tr
class=
"bxfm-add-hide bxfm-d-only-search">
428 <td
class=
"bxfm-d-label"><label
for=
"bx_search_dirs_too"><?=
GetMessage(
"FM_UTIL_SEARCH_DIRS")?></label></td>
429 <td
class=
"bxfm-d-value"><input
id=
"bx_search_dirs_too" name=
"bx_search_dirs_too" type=
"checkbox" value=
"Y" checked=
"checked" /></td>
431 <tr
class=
"bxfm-add-hide-TEMP" style=
"display: none;">
432 <td
class=
"bxfm-d-label"><label
for=
"bx_search_entire"><?=
GetMessage(
"FM_UTIL_ENTIRE")?></label></td>
433 <td
class=
"bxfm-d-value"><input
id=
"bx_search_entire" type=
"checkbox" value=
"Y" /></td>
435 <tr
class=
"bxfm-add-hide">
436 <td
class=
"bxfm-d-label"><label
for=
"bx_search_case"><?=
GetMessage(
"FM_UTIL_CASE_SENS")?></td>
437 <td
class=
"bxfm-d-value"><input
id=
"bx_search_case" name=
"bx_search_case" type=
"checkbox" value=
"Y" /></label></td>
440 <input type=
"hidden" name=
"search" value=
"Y" />
441 <div
id=
"bx_search_res_cont"></div>
445 "event" =>
"FMFD_SearchDirOpen",
446 "arResultDest" => Array(
"ELEMENT_ID" =>
"bx_search_dir"),
447 "arPath" => Array(
"SITE" =>
$site,
"PATH" =>
"/"),
450 "showUploadTab" =>
false,
451 "showAddToMenuTab" =>
false,
452 "allowAllFiles" =>
false,
459 <?$searchTabControl->BeginNextTab();?>
461 <div
id=
"bx_replace_cont" class=
"bxfm-replace-cont"></div>
464 $searchTabControl->End();
468 <div
id=
"bx_copy_dialog" class=
"bx-copy-cont">
469 <table
class=
"bx-copy-cont-tbl bx-copy-cont-tbl-add-hide" id=
"bx_copy_table" style=
"width: 470px;">
471 <td
class=
"bxfm-d-label"><label
for=
"bx_copy_file_list"><?=
GetMessage(
"FM_UTIL_FILE")?>:</label></td>
472 <td
class=
"bxfm-d-value"><div
id=
"bx_copy_file_list" style=
"margin-top: 2px;"><div></td>
475 <td
class=
"bxfm-d-label"><label
for=
"bx_copy_to"><?=
GetMessage(
"FM_COPY_TO")?>:</label></td>
476 <td
class=
"bxfm-d-value">
477 <div
style=
"width: 340px;">
478 <input
id=
"bx_copy_to" style=
"width: 255px;" value=
"/" type=
"text" /><input type=
"button" value=
"..." title=
"<?= GetMessage('FD_OPEN_DIR')?>" onclick=
"FMFD_CopyMoveOpen(true, {site: window.oBXFMCopy.oSiteSel.value, path: window.oBXFMCopy.oCopyTo.pInput.value});" />
479 <span
class=
"bxfm-site-sel" id=
"bx_copy_site_sel"></span>
484 <tr
class=
"bx-copy-d-title">
486 <a
class=
"bx-copy-add-link" id=
"bx_copy_add_lnk" href=
"javascript: void(0);"><?=
GetMessage(
"FM_UTIL_ADDITIONAL")?> <span
class=
"bx-copy-d-span-hide">(<?=
GetMessage(
"FM_UTIL_HIDE")?>)</span></a>
489 <tr
class=
"bxfm-add-hide">
490 <td colSpan=
"2" style=
"padding: 5px 0 5px 120px !important;"><?=
GetMessage(
"FM_COPY_COINCID")?>:</td>
492 <tr
class=
"bxfm-add-hide">
493 <td
class=
"bxfm-d-label">
494 <input
id=
"bx_copy_ask_user" type=
"radio" name=
"bx_copy_coincidence" value=
"ask" checked=
"checked"/>
496 <td
class=
"bxfm-d-value">
497 <label
for=
"bx_copy_ask_user"><?=
GetMessage(
"FM_COPY_ASK_USER")?></label>
500 <tr
class=
"bxfm-add-hide">
501 <td
class=
"bxfm-d-label">
502 <input
id=
"bx_copy_replace" type=
"radio" name=
"bx_copy_coincidence" value=
"replace" />
504 <td
class=
"bxfm-d-value">
505 <label
for=
"bx_copy_replace"><?=
GetMessage(
"FM_COPY_REPLACE")?></label>
508 <tr
class=
"bxfm-add-hide">
509 <td
class=
"bxfm-d-label">
510 <input
id=
"bx_copy_auto_rename" type=
"radio" name=
"bx_copy_coincidence" value=
"auto_rename" />
512 <td
class=
"bxfm-d-value">
513 <label
for=
"bx_copy_auto_rename"><?=
GetMessage(
"FM_COPY_AUTO_RENAME")?></label>
516 <tr
class=
"bxfm-add-hide">
517 <td
class=
"bxfm-d-label">
518 <input
id=
"bx_copy_skip" type=
"radio" name=
"bx_copy_coincidence" value=
"skip" />
520 <td
class=
"bxfm-d-value">
521 <label
for=
"bx_copy_skip"><?=
GetMessage(
"FM_COPY_SKIP")?></label>
528 "event" =>
"FMFD_CopyMoveOpen",
529 "arResultDest" => Array(
"ELEMENT_ID" =>
"bx_copy_to"),
530 "arPath" => Array(
"SITE" =>
$GLOBALS[
'site'],
"PATH" =>
"/"),
533 "showUploadTab" =>
false,
534 "showAddToMenuTab" =>
false,
535 "allowAllFiles" =>
false,
541 <div
id=
"bx_copy_ask_dialog" class=
"bx-copy-cont">
542 <div
style=
"margin: 0 70px 0 70px; width: 460px; padding: 10px 0 5px;">
543 <?=
GetMessage(
"FM_UTIL_FILE_EXIST",
array(
"#NAME#" =>
"<span id='bx_copy_ask_file_name'>#NAME#</span>",
"#FOLDER#" =>
"<span id='bx_copy_ask_folder'>#FOLDER#</span>"))?>:
545 <div
style=
"margin: 0 50px;">
546 <table
class=
"bx-copy-compare-tbl">
547 <tr
class=
"bx-copy-title">
548 <td><?=
GetMessage(
"FM_UTIL_NEW_FILE")?>:</td>
549 <td rowSpan=
"4" class=
"bx-copy-sep-td"></td>
550 <td><?=
GetMessage(
"FM_UTIL_ORIGINAL_FILE")?>:</td>
554 <div
class=
"bx-copy-name-cnt">
555 <a
id=
"bx_copy_ask_file1" href=
"javascript:void();">file1</a>
556 <div
id=
"bxc_ask_nn_cont1" class=
"bx-copy-new-name bxcnn-0"></div>
560 <div
class=
"bx-copy-name-cnt"><a
id=
"bx_copy_ask_file2" href=
"javascript:void();">file2</a></div>
563 <tr
id=
"bx_copy_ask_size_row">
564 <td><?=
GetMessage(
"FM_UTIL_SIZE")?>: <span
id=
"bx_copy_ask_size1"></span></td>
565 <td><?=
GetMessage(
"FM_UTIL_SIZE")?>: <span
id=
"bx_copy_ask_size2"></span></td>
567 <tr
class=
"bx-copy-bottom">
568 <td><?=
GetMessage(
"FM_UTIL_DATE")?>: <span
id=
"bx_copy_ask_date1"></span></td>
569 <td><?=
GetMessage(
"FM_UTIL_DATE")?>: <span
id=
"bx_copy_ask_date2"></span></td>
575 $searchTabControl->BeginNextTab();
579 <div
id=
"bx_pack_dialog" class=
"bx-pack-cont">
580 <table
class=
"bx-pack-cont-tbl bx-pack-cont-tbl-add-hide" id=
"bx_pack_table" style=
"width: 470px;">
582 <td
class=
"bxfm-d-label"><label
for=
"bx_pack_file_list"><?=
GetMessage(
"FM_PACK_FILE")?>:</label></td>
583 <td
class=
"bxfm-d-value"><div
id=
"bx_pack_file_list" style=
"margin-top: 2px;"><div></td>
585 <tr
id=
"bxfm-arctype-line">
586 <td
class=
"bxfm-d-label"><label
for=
"bx_pack_arc_type"><?=
GetMessage(
"FM_PACK_ARC_TYPE")?>:</label></td>
587 <td
class=
"bxfm-d-value"><div
id=
"bx_pack_arc_type" class=
"bxfm-arctype-sel" style=
"margin-top: 4px;"><div></td>
590 <!--
if pack
"to archive",
if not -
"to folder" -->
591 <td
class=
"bxfm-d-label"><label
for=
"bx_pack_to"><?=
GetMessage(
"FM_PACK_TO")?>:</label></td>
592 <td
class=
"bxfm-d-value">
593 <div
style=
"width: 340px;">
594 <input
id=
"bx_pack_to" style=
"width: 260px;" value=
"/" type=
"text"/>&
nbsp;<input type=
"button" value=
"..." title=
"<?= GetMessage('FD_OPEN_DIR')?>" onclick=
"FMFD_PackUnpackOpen(true, {site: window.oBXFMPack.oSiteSel.value, path: window.oBXFMPack.GetFolderPath(window.oBXFMPack.oPackTo.pInput.value)});" />
595 <span
class=
"bxfm-site-sel" id=
"bx_pack_site_sel"></span>
599 <tr
class=
"bx-pack-d-title" id=
"bx-pack-d-title-label">
601 <td><?=
GetMessage(
"FM_PACK_ADDITIONAL")?></td>
603 <!--<tr
class=
"bxfm-add-hide" id=
"bxfm-pack-option-ask">
604 <td
class=
"bxfm-d-label">
605 <input
id=
"bx_pack_ask_user" type=
"radio" name=
"bx_pack_coincidence" value=
"ask" checked=
"checked"/>
607 <td
class=
"bxfm-d-value">
608 <label
for=
"bx_pack_ask_user"><?=
GetMessage(
"FM_PACK_ASK_USER")?></label>
611 <tr
class=
"bxfm-add-hide" id=
"bxfm-pack-option-replace">
612 <td
class=
"bxfm-d-label">
613 <input
id=
"bx_pack_replace" type=
"radio" name=
"bx_pack_coincidence" value=
"replace" />
615 <td
class=
"bxfm-d-value">
616 <label
for=
"bx_pack_replace"><?=
GetMessage(
"FM_PACK_REPLACE")?></label>
619 <!--<tr
class=
"bxfm-add-hide" id=
"bxfm-pack-option-rename">
620 <td
class=
"bxfm-d-label">
621 <input
id=
"bx_pack_auto_rename" type=
"radio" name=
"bx_pack_coincidence" value=
"auto_rename" />
623 <td
class=
"bxfm-d-value">
624 <label
for=
"bx_pack_auto_rename"><?=
GetMessage(
"FM_PACK_AUTO_RENAME")?></label>
627 <tr
class=
"bxfm-add-hide" id=
"bxfm-pack-option-skip">
628 <td
class=
"bxfm-d-label">
629 <input
id=
"bx_pack_skip" type=
"radio" name=
"bx_pack_coincidence" value=
"skip" />
631 <td
class=
"bxfm-d-value">
632 <label
for=
"bx_pack_skip"><?=
GetMessage(
"FM_PACK_SKIP")?></label>
639 "event" =>
"FMFD_PackUnpackOpen",
640 "arResultDest" => Array(
"FUNCTION_NAME" =>
"MakeArchivePathFromFolderPath"),
641 "arPath" => Array(
"SITE" =>
$GLOBALS[
'site'],
"PATH" =>
"/"),
644 "showUploadTab" =>
false,
645 "showAddToMenuTab" =>
false,
646 "allowAllFiles" =>
false,
653 function MakeArchivePathFromFolderPath(filename,
path, site)
656 oldArchivePath = BX(
'bx_pack_to').value,
660 archiveName = oldArchivePath.substr(oldArchivePath.lastIndexOf(
'/') + 1);
661 newArchivePath =
"/" +
path +
"/" + filename +
"/" + archiveName;
663 newArchivePath = newArchivePath.replace(/[\/]+$/g,
"");
664 newArchivePath = newArchivePath.replace(/[\/]+/g,
'/');
665 newArchivePath = newArchivePath.replace(/[\\]+/g,
'/');
667 if (newArchivePath ==
'')
668 newArchivePath =
'/';
670 BX(
'bx_pack_to').value = newArchivePath;
673 <div
id=
"bx_pack_ask_dialog" class=
"bx-pack-cont">
674 <div
style=
"margin: 0 20px 0 20px; width: 450px; padding: 10px 0 5px;">
675 <?=
GetMessage(
"FM_UTIL_FILE_EXIST",
array(
"#NAME#" =>
"<span id='bx_pack_ask_file_name'>#NAME#</span>",
"#FOLDER#" =>
"<span id='bx_pack_ask_folder'>#FOLDER#</span>"))?>:
677 <table
style=
"margin: 0 20px 0 20px">
680 <div
class=
"bx-pack-name-cnt">
681 <a
id=
"bx_pack_ask_file2" href=
"javascript:void('');">file1</a>
682 <div
id=
"bxc_ask_nn_cont2" class=
"bx-pack-new-name bxcnn-0"></div>
686 <tr
id=
"bx_pack_ask_size_row">
687 <td><?=
GetMessage(
"FM_UTIL_SIZE")?>: <span
id=
"bx_pack_ask_size2"></span></td>
689 <tr
class=
"bx-pack-bottom">
690 <td><?=
GetMessage(
"FM_UTIL_DATE")?>: <span
id=
"bx_pack_ask_date2"></span></td>
700 if (!
$USER->CanDoOperation(
'fileman_view_file_structure'))
713 'lastPath' => isset($_POST[
'last_path']) ? $_POST[
'last_path'] :
false,
714 'bCount' =>
$action ==
"count",
715 'bReplace' =>
$action ==
"replace",
716 "fileName" => trim($_POST[
'file']),
717 "phrase" => trim($_POST[
'phrase']),
718 "replacePhrase" => trim($_POST[
'replace_phrase']),
720 "bSubdir" => $_POST[
'subdir'],
721 "dateFrom" => $_POST[
'date_from'],
722 "dateTo" => $_POST[
'date_to'],
723 "sizeFrom" => intval($_POST[
'size_from']),
724 "sizeTo" => intval($_POST[
'size_to']),
725 "entire" => $_POST[
'entire'],
726 "bCaseSens" => $_POST[
'case_sens'],
727 "bDirsToo" => $_POST[
'dirs_too'],
728 "ssess" => ($_POST[
'ssess'] ??
null),
729 "bInResult" => $_POST[
'in_result'],
741 case "search_save_config":
743 "advMode" => (
boolean) $_POST[
'adv_mode'],
744 "bSubdir" => (
boolean) $_POST[
'subdir'],
745 "entire" => (
boolean) $_POST[
'entire'],
746 "bCaseSens" => (
boolean) $_POST[
'case_sens'],
747 "bDirsToo" => (
boolean) $_POST[
'dirs_too']
751 case "copy_save_config":
753 "advMode" => (
boolean) $_POST[
'adv_mode'],
754 "caseOption" => $_POST[
'case_option']
763 "caseOption" => $_POST[
'case_option'],
764 "arFiles" => $_POST[
'files'],
765 "copyTo" => $_POST[
'copy_to'],
766 "createCopyTo" => ($_POST[
'create_copy_to'] ??
null) ==
"Y",
768 "userCaseAnswer" => isset($_POST[
'uc_answer']) ? $_POST[
'uc_answer'] :
false,
769 "userCaseToAll" => isset($_POST[
'uc_to_all']) ? $_POST[
'uc_to_all'] :
false,
770 "userCaseLastPath" => isset($_POST[
'uc_last_path']) ? $_POST[
'uc_last_path'] :
false,
772 "bSearch" => ($_POST[
'search'] ??
null) ==
"Y",
773 "ssess" => ($_POST[
'ssess'] ??
null),
780 case "get_last_pathes":
787 if (isset($_POST[
"startFile"]))
788 $startFile = trim($_POST[
"startFile"]);
790 if (isset($_POST[
"quickPath"]))
791 $quickPath = trim($_POST[
"quickPath"]);
793 if (isset($_POST[
"packTo"]))
795 if (mb_substr($_POST[
"packTo"], 0, 1) ==
"/")
796 $pack_to = $_POST[
"packTo"];
798 $pack_to =
"/".$_POST[
"packTo"];
802 $docRootTo = CSite::GetSiteDocRoot($siteTo) ? CSite::GetSiteDocRoot($siteTo) :
'';
804 $docRootFrom = CSite::GetSiteDocRoot($siteFrom);
806 if (!
$USER->IsAdmin())
810 if (!
$USER->CanDoFileOperation(
'fm_create_new_file',
array($siteTo, $pack_to)))
814 window.BXFM_archivePermsError =
true;
824 window.BXFM_archiveFNameError =
true;
831 if (file_exists(
$io->GetPhysicalName($docRootTo.$pack_to)))
833 if (empty($startFile))
835 if (($_POST[
"bPackReplace"] ??
null) !=
"replace")
839 window.BXFM_archiveExists = {
842 name:
"<?= CUtil::JSEscape(basename($pack_to))?>",
843 path:
"<?= CUtil::JSEscape($pack_to)?>",
844 site:
"<?= CUtil::JSEscape($siteTo)?>",
845 size:
"<?= CFile::FormatSize(filesize($io->GetPhysicalName($docRootTo.$pack_to)))?>",
846 date:
"<?= date(CDatabase::DateFormatToPHP(CLang::GetDateFormat('FULL')), filemtime($io->GetPhysicalName($docRootTo.$pack_to))+CTimeZone::GetOffset())?>"
861 $packarc->SetOptions(
864 "STEP_TIME" => COption::GetOptionString(
"fileman",
"archive_step_time", 30),
866 "REMOVE_PATH" => $docRootFrom.$quickPath,
867 "CHECK_PERMISSIONS" =>
$USER->IsAdmin() ?
false :
true
871 $arPackFiles =
array();
872 foreach ($_POST[
"files"] as $path2file)
874 $arPackFiles[] = $docRootFrom.$path2file[
'path'];
879 $pRes = $packarc->Pack($arPackFiles, $startFile);
886 window.fmPackTimeout =
true;
887 window.fmPackLastFile =
'<?= CUtil::JSEscape($packarc->GetStartFile())?>';
894 window.fmPackTimeout =
false;
895 window.fmPackLastFile =
'';
896 window.fmPackSuccess =
true;
901 $arErrors = $packarc->GetErrors();
904 window.fmPackTimeout =
false;
905 window.fmPackSuccess =
false;
906 window.fmPackErrors = <?=CUtil::PhpToJSObject($arErrors)?>;
916 window.fmPackSuccess =
false;
917 window.fmPackErrors = <?=CUtil::PhpToJsObject(
GetMessage(
"FM_UTIL_ARC_ERROR"))?>;
926 if (isset($_POST[
"packTo"]))
928 if (mb_substr($_POST[
"packTo"], 0, 1) ==
"/")
929 $pack_to = $_POST[
"packTo"];
931 $pack_to =
"/".$_POST[
"packTo"];
936 $docRootFrom = CSite::GetSiteDocRoot($siteFrom);
937 $docRootTo = CSite::GetSiteDocRoot($siteTo);
939 if (!(
$USER->CanDoFileOperation(
'fm_create_new_file',
array($siteTo, $_POST[
"packTo"])) ||
940 $USER->CanDoFileOperation(
'fm_create_new_folder',
array($siteTo, $_POST[
"packTo"]))))
944 window.BXFM_archivePermsError =
true;
950 $bReplaceFiles = $_POST[
"case_option"] ==
"replace" ? true :
false;
961 "REMOVE_PATH" => $docRootFrom,
962 "UNPACK_REPLACE" => $bReplaceFiles,
963 "CHECK_PERMISSIONS" =>
$USER->IsAdmin() ?
false :
true
967 $uRes = $arc->Unpack($docRootTo.$pack_to);
971 $uErrors = $arc->GetErrors();
974 window.fmUnpackSuccess =
false;
975 window.fmUnpackErrors = <?=CUtil::PhpToJSObject($uErrors)?>
983 window.fmUnpackSuccess =
true;
992 window.fmUnpackSuccess =
false;
993 window.fmUnpackErrors = <?=CUtil::PhpToJsObject(
GetMessage(
"FM_UTIL_ARC_ERROR"))?>;
1003 return COption::GetOptionString(
"fileman",
"search_time_step", 5);
1037 if (file_exists(
$path))
1039 $stat = stat(
$path);
1040 return $stat[
"mtime"];
1050 private $maxFileOpenSize;
1051 private $maxResultCount;
1058 private bool $bReplace;
1062 $this->maxFileOpenSize = 1024 * COption::GetOptionString(
"fileman",
"search_max_open_file_size", 1024);
1063 $this->maxResultCount = COption::GetOptionString(
"fileman",
"search_max_res_count",
false);
1065 $this->startTime = time();
1066 $this->Params = $Params;
1067 $this->Result =
array();
1068 $this->docRoot = CSite::GetSiteDocRoot($Params[
'site']);
1070 $this->bSkip = $this->Params[
'lastPath'] ? true :
false;
1073 $this->Params[
'lastPath'] =
Rel2Abs(
"/", $this->Params[
'lastPath']);
1074 $this->Params[
'lastPath'] = $this->docRoot.$this->Params[
'lastPath'];
1077 $this->sSess = $this->Params[
'ssess'] ? $this->Params[
'ssess'] :
false;
1078 $this->bReplace = $this->Params[
'bReplace'] && $this->Params[
'phrase'] <>
'';
1080 if ($this->bReplace)
1082 $this->Params[
'bDirsToo'] =
false;
1090 if ($this->Params[
'bInResult'])
1095 $path = $this->docRoot.$searchRes[
$i][
'path'];
1113 $path = $this->docRoot.$path;
1116 'site' => $Params[
'site'],
1117 'callBack' =>
"Search",
1118 'checkBreak' =>
"CheckBreak",
1119 'checkSubdirs' => $this->Params[
"bSubdir"]
1121 $bSuccess = $oDir->Start();
1123 $bBreak = $oDir->bBreak;
1124 $nextPath = $oDir->nextPath;
1125 $bStoped = $oDir->bStoped;
1136 window.fmsBtimeout =
true;
1137 window.fmsLastPath =
'<?= CUtil::JSEscape(CFilemanUtils::TrimPath($nextPath, $this->docRoot))?>';
1139 window.fmsBtimeout =
false;
1143 window.fmsBstoped =
true;
1145 window.fmsBstoped =
false;
1148<?
if ($this->Params[
'bCount']): ?>
1149 window.fmsResult = <?=
count($this->Result)?>;
1151 window.fmsResult = <?= CUtil::PhpToJSObject($this->Result)?>;
1160<?
if ($this->Params[
'bCount']): ?>
1161 window.fmsResult = 0;
1163 window.fmsResult = [];
1174 if ($this->maxResultCount &&
count($this->Result) >= $this->maxResultCount)
1179 if ($file == $this->Params[
'lastPath'])
1180 $this->bSkip =
false;
1187 $bIsDir =
$io->DirectoryExists($file);
1189 if ($bIsDir && !$this->Params[
'bDirsToo'])
1192 $entity = $bIsDir ?
$io->GetDirectory($file) :
$io->GetFile($file);
1198 if (!
$USER->CanDoFileOperation(
'fm_view_file',
$arPath))
1201 $name = CFileman::GetFileName($file);
1204 if ($this->Params[
'fileName'] !=
"")
1206 if (!$this->Params[
'bCaseSens'])
1209 $this->Params[
'fileName'] = mb_strtolower($this->Params[
'fileName']);
1213 if (mb_strpos($this->Params[
'fileName'],
"*") ===
false)
1215 if (mb_strpos(
$name, $this->Params[
'fileName']) ===
false)
1220 $pattern = str_replace(
'.',
'\.',$this->Params[
'fileName']);
1223 if (!preg_match(
'/^'.
$pattern.
'$/i',
$io->ExtractNameFromPath($file)))
1231 $size =
$entity->GetFileSize();
1234 ($this->Params[
'sizeFrom'] > 0 && $size < $this->Params[
'sizeFrom'] * 1024)
1236 ($this->Params[
'sizeTo'] > 0 && $size > $this->Params[
'sizeTo'] * 1024)
1246 $time =
$entity->GetModificationTime()+CTimeZone::GetOffset();
1248 ($this->Params[
'dateFrom'] &&
$time <
MakeTimeStamp($this->Params[
'dateFrom'], CLang::GetDateFormat(
"FULL")))
1250 ($this->Params[
'dateTo'] &&
$time >
MakeTimeStamp($this->Params[
'dateTo'], CLang::GetDateFormat(
"FULL")))
1254 if ($this->Params[
'phrase'] !=
"")
1257 if ($size > $this->maxFileOpenSize || $bIsDir || ($this->bReplace && !
$USER->CanDoFileOperation(
'fm_edit_existent_file',
$arPath)))
1260 $fTmp =
$io->GetFile($file);
1262 $phrase = $this->Params[
'phrase'];
1263 $fileContent = str_replace(
"\r\n",
"\n", $fTmp->GetContents());
1267 if (!$this->Params[
'bCaseSens'])
1269 $phrase = mb_strtolower($phrase);
1273 $I_PCRE_MODIFIER = $this->Params[
'bCaseSens'] ?
'' :
'i';
1281 if ($this->bReplace)
1283 if ($isPHP && !
$USER->CanDoOperation(
'edit_php'))
1286 $pattern =
'/'.preg_quote($this->Params[
'phrase'],
'/').
'/u'.$I_PCRE_MODIFIER;
1290 $origFileContent = preg_replace(
$pattern, $this->Params[
'replacePhrase'], $origFileContent);
1293 $APPLICATION->SaveFileContent($file, $origFileContent);
1297 if ($isPHP && !(
$USER->CanDoOperation(
'edit_php') ||
$USER->CanDoFileOperation(
'fm_lpa',
$arPath)))
1300 $pattern =
'/'.preg_quote($this->Params[
'phrase'],
'/').
'/u'.$I_PCRE_MODIFIER;
1303 if (
$USER->CanDoFileOperation(
'fm_lpa',
$arPath) && !
$USER->CanDoOperation(
'edit_php'))
1304 $origFileContent = CMain::ProcessLPA($origFileContent,
'');
1312 $this->Result[] =
array(
1317 'str_date' => date(CDatabase::DateFormatToPHP(CLang::GetDateFormat(
"FULL")),
$time),
1318 'str_size' => $bIsDir ?
"" : CFile::FormatSize($size),
1320 'repl_count' => $replFileCount
1331 if ($docRoot ===
false)
1332 $docRoot =
$_SERVER[
"DOCUMENT_ROOT"];
1333 $l = mb_strlen($docRoot);
1344 $res =
$DB->Query(
"SELECT * FROM b_file_search WHERE SESS_ID='".
$DB->ForSql($searchSess).
"' LIMIT 1",
false);
1347 $res =
$DB->Query(
"SELECT TOP 1 * FROM b_file_search WHERE SESS_ID='".
$DB->ForSql($searchSess).
"'",
false);
1350 $res =
$DB->Query(
"SELECT * FROM b_file_search WHERE SESS_ID='".
$DB->ForSql($searchSess).
"' AND ROWNUM <= 1",
false);
1354 return !
$res->Fetch();
1361 $q =
"SELECT * FROM b_file_search WHERE SESS_ID='".$DB->ForSql($searchSess).
"'";
1364 if ($arOrder[0] ==
'timestamp')
1366 else if ($arOrder[0] ==
'size')
1368 else if ($arOrder[0] ==
'name')
1370 else if ($arOrder[0] ==
'id')
1375 $order = mb_strtolower($arOrder[1]);
1378 $strOrderBy = $by.
' '.(
$order ==
'desc' ?
'desc'.($DB->type ==
"ORACLE" ?
" NULLS LAST" :
"") :
'asc'.($DB->type ==
"ORACLE" ?
" NULLS FIRST":
""));
1381 if($strOrderBy !=
"")
1382 $q .=
" ORDER BY ".$strOrderBy;
1386 $searchRes =
array();
1389 $searchRes[] =
array(
1390 'path' =>
$arRes[
'F_PATH'],
1391 'b_dir' =>
$arRes[
'B_DIR'],
1392 'time' =>
$arRes[
'F_TIME'],
1393 'size' =>
$arRes[
'F_SIZE']
1403 $DB->Query(
"DELETE FROM b_file_search WHERE SESS_ID='".
$DB->ForSql($searchSess).
"'",
false);
1408 'SESS_ID' => $searchSess,
1409 'F_PATH' => $searchRes[
$i][
'path'],
1410 'B_DIR' => $searchRes[
$i][
'b_dir'] ??
null,
1411 'F_TIME' => $searchRes[
$i][
'time'] ??
null,
1412 'F_SIZE' => $searchRes[
$i][
'size'] ??
null,
1424 return $DB->Query(
"DELETE FROM b_file_search WHERE SESS_ID='".
$DB->ForSql($searchSess).
"' AND F_PATH='".
$DB->ForSql(
$path).
"'",
false);
1432 "UPDATE b_file_search SET ".
1433 $DB->PrepareUpdate(
"b_file_search",
array(
'F_PATH' => $pathTo)).
1434 " WHERE SESS_ID='".$DB->ForSql($searchSess).
"' AND F_PATH='".
$DB->ForSql($pathFrom).
"'";
1436 return $DB->Query($strSql);
1441 return preg_replace(
"/[^a-z0-9]/i",
"", $ssess ??
'');
1446 return md5(
$GLOBALS[
"USER"]->GetID().
"+".uniqid(rand(),
true));
1453 $d = date(CDatabase::DateFormatToPHP(CLang::GetDateFormat(
"FULL")), mktime(0, 0, 0, date(
"m") , date(
"d") - 2, date(
"Y")));
1454 $q =
"DELETE FROM b_file_search WHERE TIMESTAMP_X<=".$DB->CharToDateFunction($d,
"SHORT").
"";
1455 $DB->Query($q,
false);
1460 CUserOptions::SetOption(
"fileman",
"file_search_config", serialize($arConfig));
1465 $arConfig =
array();
1466 $strAr = CUserOptions::GetOption(
"fileman",
"file_search_config",
false);
1468 $arConfig = unserialize($strAr, [
'allowed_classes' =>
false]);
1492 private $checkSubdirs;
1497 $this->dir = str_replace(
'\\',
'/',
$dir);
1498 $this->obj = $Params[
'obj'];
1499 $this->site = $Params[
'site'];
1500 $this->docRoot = CSite::GetSiteDocRoot($Params[
'site']);
1501 $this->checkSubdirs = isset($Params[
'checkSubdirs']) ? $Params[
'checkSubdirs'] :
true;
1502 $this->callBack = isset($Params[
'callBack']) ? $Params[
'callBack'] :
false;
1503 $this->checkBreak = isset($Params[
'checkBreak']) ? $Params[
'checkBreak'] :
false;
1504 $this->processDir = isset($Params[
'processDir']) ? $Params[
'processDir'] :
false;
1510 $this->dir = str_replace(
'\\',
'/',
$dir);
1514 if (
$io->DirectoryExists($this->dir))
1518 if ($this->startPath && !$this->bFound)
1520 $this->err[] =
'Error: start path not found!';
1528 $r = $this->
CallMethod($this->callBack, $this->dir);
1530 $this->err[] =
'Error on entry: '.$this->dir;
1542 if ($this->bDirFirst && $this->processDir && (!$this->startPath || $this->bFound))
1545 $this->err[] =
'Error on dir: '.$dir;
1549 $dTmp =
$io->GetDirectory(
$dir);
1550 $arChildren = $dTmp->GetChildren();
1553 foreach ($arChildren as $child)
1554 $arItems[] = $child->GetName();
1559 foreach($arItems as $item)
1562 if ($this->startPath && !$this->bFound)
1564 if ($this->startPath ==
$f)
1565 $this->bFound =
true;
1566 elseif (mb_substr($this->startPath, 0, mb_strlen(
$f) + 1) !=
$f.
'/')
1571 $this->nextPath =
$f;
1573 if ($this->checkBreak && $this->
CallMethod($this->checkBreak))
1575 $this->bBreak =
true;
1579 if ($this->bSkipSymLinks && is_link(
$f))
1582 if (
$io->DirectoryExists(
$f))
1584 if (!
$USER->CanDoFileOperation(
'fm_view_listing',
$arPath))
1590 $this->bBreak =
true;
1591 $this->bStoped =
true;
1595 if ($this->checkSubdirs)
1609 $this->bBreak =
true;
1610 $this->bStoped =
true;
1616 $this->err[] =
'Error on file: <b>'.$f.
'</b>';
1623 if ($this->processDir && !$this->bDirFirst)
1627 $this->err[] =
'Error on folder: '.$dir;
1638 return $obj->$method($param);
1640 return $obj->$method();
1648 $this->value = $Params[
'value'];
1649 $this->startTime = time();
1650 $this->Params = $Params;
1651 $this->Result =
array();
1653 $this->bSkip = $this->Params[
'lastPath'] ? true :
false;
1656 $this->Params[
'lastPath'] =
Rel2Abs(
"/", $this->Params[
'lastPath']);
1657 $this->Params[
'lastPath'] =
$_SERVER[
"DOCUMENT_ROOT"].$this->Params[
'lastPath'];
1670 if ($file == $this->Params[
'lastPath'])
1671 $this->bSkip =
false;
1685 $arWarnings =
array();
1687 if (!
$USER->CanDoOperation(
'fileman_admin_files') && !
$USER->CanDoOperation(
'fileman_admin_folders'))
1688 $arWarnings[] =
GetMessage(
'FM_UTIL_ACCESS_DENIED');
1692 $log = $log ??
null;
1693 if (
count($arWarnings) == 0)
1695 $pathTo = trim($Params[
'copyTo'],
" /");
1697 $siteTo = $Params[
'siteTo'] ? $Params[
'siteTo'] :
$site;
1698 $pathTo = $pathTo ==
"" ?
"/" :
"/".$pathTo.
"/";
1700 $absPathTo = CSite::GetSiteDocRoot($siteTo).$pathTo;
1701 $docRootFrom = CSite::GetSiteDocRoot(
$site);
1703 if (!
$io->DirectoryExists($absPathTo))
1706 $bAccess =
$USER->CanDoOperation(
'fileman_admin_folders') &&
$USER->CanDoFileOperation(
'fm_create_new_folder',$pathTo);
1708 if ($Params[
'createCopyTo'])
1715 ?><script>window.BXFM_NoCopyToDir =
"<?= ($bAccess ? "ask_user
" : "access_denied
")?>";</script><?
1720 foreach ($Params[
'arFiles'] as $file)
1722 $filePath = $file[
'path'];
1723 $caseOption = $Params[
'caseOption'];
1725 if($Params[
"userCaseLastPath"])
1727 if ($Params[
"userCaseLastPath"] != $filePath)
1730 $caseOption = $Params[
'userCaseAnswer'];
1731 if ($Params[
"userCaseToAll"])
1732 $Params[
'caseOption'] = $caseOption;
1734 $Params[
"userCaseLastPath"] =
false;
1737 $arPath_i = Array(
$site, $filePath);
1738 $absPath_i = $docRootFrom.$filePath;
1739 $bDir_i =
$io->DirectoryExists($absPath_i);
1740 $name_i = CFileman::GetFileName($filePath);
1744 if (
$io->FileExists($absPathTo.$name_i) || ( $bDir_i ==
$io->DirectoryExists($absPathTo.$name_i) && $bDir_i))
1746 $fTmp =
$io->GetFile($absPathTo.$name_i);
1747 $fTmp1 =
$io->GetFile($absPath_i);
1750 if ($caseOption ==
'ask')
1753 window.BXFM_fileExist = {
1755 name:
"<?= CUtil::JSEscape($name_i)?>",
1756 path:
"<?= CUtil::JSEscape($pathTo.$name_i)?>",
1757 site:
"<?= CUtil::JSEscape($siteTo)?>",
1758 bDir: <?= $bDir_i ?
"true" :
"false"?>,
1759 size:
"<?= $bDir_i ? '-' : CFile::FormatSize($fTmp->GetFileSize())?>",
1760 date:
"<?= date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL
")), CFilemanUtils::GetModifyTime($absPathTo.$name_i)+CTimeZone::GetOffset())?>"
1763 alt_name:
"<?= CUtil::JSEscape($altName)?>",
1764 name:
"<?= CUtil::JSEscape($name_i)?>",
1765 path:
"<?= CUtil::JSEscape($filePath)?>",
1766 site:
"<?= CUtil::JSEscape($site)?>",
1767 bDir: <?= $bDir_i ?
"true" :
"false"?>,
1768 size:
"<?= $bDir_i ? '-' : CFile::FormatSize($fTmp1->GetFileSize())?>",
1769 date:
"<?= date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL
")), CFilemanUtils::GetModifyTime($absPath_i)+CTimeZone::GetOffset())?>"
1775 elseif ($caseOption ==
'replace')
1785 $arWarnings[] = $strWarn;
1788 elseif ($Params[
'bSearch'] && $Params[
'ssess'] && !$Params[
'bCopy'])
1791 elseif ($caseOption ==
'auto_rename')
1797 $arWarnings[] = $strWarn;
1800 elseif ($Params[
'bSearch'] && $Params[
'ssess'] && !$Params[
'bCopy'])
1803 elseif ($caseOption ==
'skip')
1814 $arWarnings[] = $strWarn;
1817 elseif ($Params[
'bSearch'] && $Params[
'ssess'] && !$Params[
'bCopy'])
1822 if(COption::GetOptionString(
$module_id,
"log_page",
"Y")==
"Y" && $log)
1824 $res_log[
'copy_to'] = mb_substr($pathTo, 1);
1825 $res_log[
'path'] = mb_substr($filePath, 1);
1826 if ($Params[
'bCopy'] ==
"copy")
1870 window.BXFM_result = {
1871 status:
"<?= (count($arWarnings) > 0 ? 'errors' : 'ok')?>",
1872 errors: <?= (
count($arWarnings) > 0 ? CUtil::PhpToJSObject($arWarnings) :
'{}')?>
1879 CUserOptions::SetOption(
"fileman",
"file_copy_move_config", serialize($arConfig));
1884 $arConfig =
array();
1885 $strAr = CUserOptions::GetOption(
"fileman",
"file_copy_move_config",
false);
1887 $arConfig = unserialize($strAr, [
'allowed_classes' =>
false]);
1895 for (
$i=1;
$i <= 9999;
$i++)
1897 $dotPos = mb_strpos(
$name,
".");
1898 if ($bDir || $dotPos ===
false)
1901 $new_name = mb_substr(
$name, 0, $dotPos).
"(".
$i.
")".mb_substr(
$name, $dotPos);
1903 if (!
$io->FileExists($absPath.$new_name) && !
$io->DirectoryExists($absPath.$new_name))
1912 public static function Init($Params)
1914 echo CUtil::InitJSCore(
array(
'translit'),
true);
1917function InitTranslitInputs(params)
1920 bLinked = params.bLinked !==
false,
1922 fromInput = params.fromInput,
1923 toInput = params.toInput,
1924 prevValue = fromInput,
1925 translit =
function()
1927 if (prevValue != fromInput.value)
1928 BX.translit(fromInput.value, {
1929 max_len : params.max_len,
1930 change_case : params.change_case,
1931 replace_space : params.replace_space,
1932 replace_other : params.replace_other,
1933 delete_repeat_replace : params.delete_repeat_replace,
1934 use_google : params.use_google,
1935 callback : function(result)
1937 if (params.ext && params.ext)
1938 result = result +
"." + params.ext;
1939 toInput.value = result;
1940 prevValue = fromInput.value;
1945 if (params.bLinkInputs)
1947 if (!params.unlinkedTitle)
1948 params.unlinkedTitle =
'';
1949 if (!params.linkedTitle)
1950 params.linkedTitle =
'';
1953 pLink1 = BX.create(
"IMG", {props: {src:
"/bitrix/images/1.gif", className:
"bxfm-linked",
title: params.linkedTitle}}),
1954 pLink2 = BX.create(
"IMG", {props: {src:
"/bitrix/images/1.gif", className:
"bxfm-linked", title: params.linkedTitle}});
1956 if (fromInput.nextSibling)
1957 fromInput.parentNode.insertBefore(pLink1, fromInput.nextSibling);
1959 fromInput.parentNode.appendChild(pLink1);
1961 if (toInput.nextSibling)
1962 toInput.parentNode.insertBefore(pLink2, toInput.nextSibling);
1964 toInput.parentNode.appendChild(pLink2);
1966 pLink1.onclick = pLink2.onclick =
function()
1968 pLink1.className = pLink2.className = bLinked ?
"bxfm-unlinked" :
"bxfm-linked";
1969 pLink1.title = pLink2.title = bLinked ? params.unlinkedTitle : params.linkedTitle;
1972 params.pLinked.value = bLinked ?
"Y" :
"N";
1984 fromInput.onmousedown =
1985 fromInput.onkeydown =
1986 fromInput.onchange =
function()
1990 if (translitTimeout)
1991 clearTimeout(translitTimeout);
1992 translitTimeout = setTimeout(translit, 150);
2001 fromInput: BX(
'<?= CUtil::JSEscape($Params['fromInputId
'])?>'),
2002 toInput: BX(
'<?= CUtil::JSEscape($Params['toInputId
'])?>'),
2003 pLinked: BX(
'<?= CUtil::JSEscape($Params['linkedId
'] ?? null)?>'),
2005 bLinked: <?= $Params[
'linked'] ?
'true' :
'false'?>,
2006 linkedTitle :
'<?= CUtil::JSEscape($Params['linkedTitle
'])?>',
2007 unlinkedTitle:
'<?= CUtil::JSEscape($Params['unlinkedTitle
'])?>',
2008 ext:
'<?= CUtil::JSEscape($Params['ext
'] ?? null)?>',
2011 replace_space :
'-',
2012 replace_other :
'-',
2013 delete_repeat_replace :
true,
static Calendar($sFieldName, $sFromName="", $sToName="", $bTime=false)
static ShowScript($arConfig)
static GetOptionString($module_id, $name, $def="", $site=false, $bExactSite=false)
static GetAvailableFormats()
static GetArchive($strArcName, $strType="")
static ConvertCharset($string, $direction=1, $skipEvents=false)
static Log($SEVERITY, $AUDIT_TYPE_ID, $MODULE_ID, $ITEM_ID, $DESCRIPTION=false, $SITE_ID=false)
static SecurePathVar($str)
static CopyEx($path_from, $path_to, $bDeleteAfterCopy=false, $bOverride=false)
static NormalizePath($path)
static SaveLastPath($path)
static __CheckSite($site)
static GetFileTypeEx($fileName)
static CheckFileName($str)
static GetAltFileName($absPath, $name, $bDir=false)
static SaveConfig($arConfig)
static CheckSearchSess($searchSess)
static CleanOldSearchResult()
static SecureSearchSess($ssess='')
static DelFromSearchResult($searchSess, $path)
static SetSearchResult($searchRes, $searchSess, $bClean=true)
static GetSearchResult($searchSess='', $arOrder=array('date', 'desc'))
static RenameInSearchResult($searchSess, $pathFrom, $pathTo)
static SaveConfig($arConfig)
static trimPath($path, $docRoot=false)
__construct($dir, $Params)
CallMethod($method='', $param=false)
static Request($action, $site)
static BuildDialogContent($site)
static NormalizePath($path)
static TrimPath($path, $docRoot=false)
static InitScript($Params)
static AppendLangMessages($Config)
static GetModifyTime($path)
static PhpToJSObject($arData, $bWS=false, $bSkipTilda=false, $bExtType=false)
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)
$_SERVER["DOCUMENT_ROOT"]
CheckSerializedData($str, $max_depth=200)
RemoveScriptExtension($check_name)
HasScriptExtension($check_name)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Rel2Abs($curdir, $relpath)
GetMessage($name, $aReplace=null)
MakeTimeStamp($datetime, $format=false)
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."%"
if(!Loader::includeModule('sale')) $pattern
$GLOBALS['_____370096793']