15require(
$_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/modules/main/include/prolog_admin_before.php");
16require(
$_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/modules/main/include/prolog_admin_js.php");
22if(!
$USER->CanDoOperation(
'fileman_view_file_structure') || !
$USER->CanDoFileOperation(
'fm_edit_existent_folder',
array(
SITE_ID,
"/")))
27 if(
$a[
"type"] ==
"D" && $b[
"type"] ==
"F")
29 elseif(
$a[
"type"] ==
"F" && $b[
"type"] ==
"D")
33 $name1 = (
$a[
"name"] <>
''?
$a[
"name"] :
$a[
"file"]);
34 $name2 = ($b[
"name"] <>
''? $b[
"name"] : $b[
"file"]);
35 return strcmp(mb_strtoupper($name1), mb_strtoupper($name2));
41 static $arTextExt =
array(
"php",
"htm",
"html");
45 $arFile =
array(
"file"=>$file,
"name"=>
"");
48 $arFile[
"type"] =
"D";
53 include(
$io->GetPhysicalName(
$abs_path.
"/".$file.
"/.section.php"));
60 $arFile[
"type"] =
"F";
64 $sContent =
$f->GetContents();
66 $arFile[
"name"] = $arContent[
"TITLE"];
67 $arFile[
"properties"] = $arContent[
"PROPERTIES"];
70 if(
$GLOBALS[
'arOptions'][
'show_file_info'] ==
true)
75 $arFile[
"time"] =
$f->GetModificationTime();
80 $arFile[
"time"] =
$f->GetModificationTime();
81 $arFile[
"size"] =
$f->GetFileSize();
91 static $tzOffset =
false;
92 if($tzOffset ===
false)
93 $tzOffset = CTimeZone::GetOffset();
101 if($arFile[
"name"] ==
'' && $arFile[
"file"] <>
"/" && (
$GLOBALS[
'arOptions'][
'show_all_files'] ??
null) !=
true)
104 $full_path = rtrim(
$path,
"/").
"/".trim($arFile[
"file"],
"/");
108 $md5 = md5($full_path);
111 $itemID =
'item'.$md5;
113 if($arFile[
"type"] ==
'D')
117 "create_file" =>
$USER->CanDoFileOperation(
"fm_create_new_file",
$arPath),
118 "create_folder" =>
$USER->CanDoFileOperation(
"fm_create_new_folder",
$arPath),
119 "edit_folder" =>
$USER->CanDoFileOperation(
"fm_edit_existent_folder",
$arPath),
120 "edit_perm" =>
$USER->CanDoFileOperation(
"fm_edit_permission",
$arPath),
121 "del_folder" =>
$USER->CanDoFileOperation(
"fm_delete_folder",
$arPath),
124 $bOpenSubdir = ($open_path <>
"" && (mb_strpos($open_path.
"/", $full_path.
"/") === 0 || $arFile[
"file"] ==
"/"));
126 $item =
'<div id="sign'.$md5.
'" class="'.($bOpenSubdir?
'bx-struct-minus':
'bx-struct-plus').
'" onclick="structGetSubDir(this, \''.$dirID.
'\', \
''.$encPath.
'\',
'.($dirsonly? 'true':'false').')
"></div>
127 <div class="bx-
struct-dir
" id="icon
'.$md5.'"></div>
128 <div id="'.$itemID.'" __bx_path="'.$encPath.'" __bx_type="D
" class="bx-
struct-name
"'.
129 ' onmouseover="structNameOver(
this)
" onmouseout="structNameOut(
this)
" onclick="structShowDirMenu(
this,
'.($dirsonly? 'true':'false').',
' . htmlspecialcharsbx(Json::encode($arPerm)) . ')
"'.
130 ' ondblclick="structGetSubdirAction(\
'sign'.
$md5.
'\')
">'.htmlspecialcharsEx($name).'</div>
131 <div style="clear:both;
"></div>
132 <div id="'.$dirID.'" class="bx-
struct-sub
" style="display:
'.($bOpenSubdir? 'block
':'none
').'">'.
133 ($bOpenSubdir? __struct_get_files($doc_root, $full_path, $open_path, $dirsonly):'').'</div>';
135 $scrDest .= ($scrDest <>''? ', ':'')."'".$itemID."'";
136 if($arFile["file
"] <> '/')
137 $scrSrc .= ($scrSrc <>''? ', ':'')."'".$itemID."',
'icon".$md5."'";
139 elseif($dirsonly == false)
141 $arPath = array($_GET['site'], $full_path);
143 "edit_file
" => $USER->CanDoFileOperation("fm_edit_existent_file
", $arPath),
144 "edit_perm
" => $USER->CanDoFileOperation("fm_edit_permission
", $arPath),
145 "del_file
" => $USER->CanDoFileOperation("fm_delete_file
", $arPath),
148 if($GLOBALS['bFileman'] == true && ($GLOBALS['arOptions']['show_all_files'] ?? null) == true)
149 $type = CFileMan::GetFileTypeEx($arFile["file
"]);
153 $item = '<div style="float:
left"></div><div class="bx-
struct-file
'.($type <> ''? ' bx-
struct-type-
'.$type : '').'" id="icon
'.$md5.'"></div>
154 <div id="'.$itemID.'" __bx_path="'.$encPath.'" __bx_type="F
" class="bx-
struct-name
" onmouseover="structNameOver(
this)
" onmouseout="structNameOut(
this)
" onclick="structShowFileMenu(
this,
' . htmlspecialcharsbx(Json::encode($arPerm)) . ')
" ondblclick="structEditFileAction(
this)
">'.htmlspecialcharsEx($name).'</div>
155 <div style="clear:both;
"></div>';
157 $scrSrc .= ($scrSrc <>''? ', ':'')."'".$itemID."',
'icon".$md5."'";
160 $res .= '<div class="bx-
struct-item
">'.$item.'</div>';
162 if($GLOBALS['arOptions']['show_file_info'] == true)
164 $sHint = '<table cellspacing="0
" border="0
">'.
165 '<tr><td colspan="2
"><b>'.($arFile["type
"] == 'D'? GetMessage("pub_struct_folder
"):GetMessage("pub_struct_file
")).'</b></td></tr>'.
166 '<tr><td class="bx-grey
">'.GetMessage("pub_struct_name
").'</td><td>'.htmlspecialcharsEx($arFile["file
"]).'</td></tr>'.
167 ($arFile["type
"] == 'F'? '<tr><td class="bx-grey
">'.GetMessage("pub_struct_size
")."</td><td>
".number_format($arFile["size"], 0, ".
", ",
")." ".GetMessage("pub_struct_byte
").'</td></tr>':'').
168 '<tr><td class="bx-grey
">'.GetMessage("pub_struct_modified
").'</td><td>'.htmlspecialcharsEx(ConvertTimeStamp($arFile["time
"]+$tzOffset, 'FULL', $_GET['site'])).'</td></tr>';
169 if(is_array($arFile["properties
"]))
170 foreach($arFile["properties
"] as $prop_name => $prop_val)
171 $sHint .= '<tr valign="top"><td class="bx-grey
">'.htmlspecialcharsEx($prop_name).':</td><td>'.htmlspecialcharsEx($prop_val).'</td></tr>';
172 $sHint .= '</table>';
174 $hintScript .= 'window.structHint'.$itemID.' = new BXHint(\''.CUtil::JSEscape($sHint).'\', document.getElementById(\''.$itemID.'\')); ';
177 if($hintScript <> '')
178 $res .= '<script>'.$hintScript.'</script>';
180 if($GLOBALS['bFileman'] == true)
181 $res .= '<script>structRegisterDD(['.$scrSrc.'], ['.$scrDest.']);</script>';
186function __struct_get_files($doc_root, $path="", $open_path="", $dirsonly=false)
190 if(!$USER->CanDoFileOperation('fm_view_listing', array($_GET['site'], $path)))
194 $abs_path = $doc_root."/
".$path;
196 $io = CBXVirtualIo::GetInstance();
197 $directory = $io->GetDirectory($abs_path);
198 $arChildren = $directory->GetChildren();
199 foreach ($arChildren as $child)
201 $n = $child->GetName();
202 if (!$child->IsDirectory())
204 if($n == '.section.php' || $n == '.access.php')
206 if(preg_match('/^\.(.*)?\.menu\.(php|html|php3|php4|php5|php6|phtml)$/', $n))
209 $arFile = __struct_get_file_info($abs_path, $n);
210 $arFiles[] = $arFile;
215 return __struct_show_files($arFiles, $doc_root, $path, $open_path, $dirsonly);
218$bFileman = CModule::IncludeModule('fileman');
221$DOC_ROOT = CSite::GetSiteDocRoot($_GET["site
"]);
223$arOptions = CUserOptions::GetOption("public_structure
", "options
", array());
224if(!isset($arOptions['show_file_info']))
225 $arOptions['show_file_info'] = true;
227$io = CBXVirtualIo::GetInstance();
228// **********************************************
230if (isset($_GET['ajax']) && $_GET['ajax'] == 'Y')
232 if(!empty($_GET['action']) && $_GET['action'] == 'delfolder' && check_bitrix_sessid() && $bFileman)
234 $normPath = $io->CombinePath("/
", $_GET["path"]);
236 $strWarning = CFileMan::DeleteEx(array($_GET["site
"], $normPath));
238 if(COption::GetOptionString("fileman
", "log_page
", "Y
")=="Y
")
240 CEventLog::Log("content
", "SECTION_DELETE
", "fileman
", $normPath);
243 elseif(!empty($_GET['action']) && ($_GET['action'] == 'copy' || $_GET['action'] == 'move') && check_bitrix_sessid() && $bFileman)
245 $normFrom = $io->CombinePath("/
", $_GET["from
"]);
247 if(($pos = mb_strrpos($normFrom, "/
")) !== false)
248 $name = mb_substr($normFrom, $pos + 1);
249 $normTo = $io->CombinePath("/
", $_GET["to
"]."/
".$name);
250 if($normFrom <> "" && $normTo <> "")
251 $strWarning = CFileMan::CopyEx(array($_GET["site
"], $normFrom), array($_GET["site
"], $normTo), ($_GET['action'] == "move
"? true : false));
254 if(isset($_GET['show_all_files']))
255 $arOptions['show_all_files'] = ($_GET['show_all_files'] == 'Y');
256 if(isset($_GET['show_file_info']))
257 $arOptions['show_file_info'] = ($_GET['show_file_info'] == 'Y');
258 if(isset($_GET['show_all_files']) || isset($_GET['show_file_info']))
259 CUserOptions::SetOption("public_structure
", "options
", $arOptions);
261 if (!empty($_GET['load_path']))
263 echo __struct_get_files($DOC_ROOT, _normalizePath($_GET['load_path']), "", (!empty($_GET['dirsonly']) && $_GET['dirsonly']=='Y'));
265 elseif (isset($_GET['reload']) && $_GET['reload'] == 'Y')
267 //display first level tree
268 $arRoot = __struct_get_file_info($DOC_ROOT, "/
");
269 echo __struct_show_files(array($arRoot), $DOC_ROOT, "", _normalizePath($_GET["path"]), (!empty($_GET['dirsonly']) && $_GET['dirsonly']=='Y'));
272 if($strWarning <> "")
274 $obJSPopup->ShowValidationError($strWarning);
275 echo '<script>jsPopup.AdjustShadow()</script>';
279<script>window.structOptions = <?= Json::encode($arOptions) ?>;</script>
281if (isset($_GET['ajax']) && $_GET['ajax'] == 'Y')
283 require($_SERVER["DOCUMENT_ROOT
"]."/bitrix/modules/main/include/epilog_admin_js.php
");
286// **********************************************
288$encPath = urlencode($_GET["path"]);
289$encLang = urlencode($_GET["lang"]);
290$encSite = urlencode($_GET["site
"]);
291$encTemplateID = urlencode($_GET["templateID
"]);
293<script src="/bitrix/js/main/dd.js<?echo
'?'.filemtime(
$_SERVER[
"DOCUMENT_ROOT"].
'/bitrix/js/main/dd.js')?>
"></script>
295window.structRegisterDD = function(arSrc, arDest)
297 for(var i=0, n=arSrc.length; i<n; i++)
299 var obEl = document.getElementById(arSrc[i]);
300 obEl.onbxdragstart = Struct_DragStart;
301 obEl.onbxdragstop = Struct_DragStop;
302 obEl.onbxdrag = Struct_Drag;
303 jsDD.registerObject(obEl);
305 for(i=0, n=arDest.length; i<n; i++)
307 obEl = document.getElementById(arDest[i]);
308 obEl.onbxdestdraghover = Struct_DragHover;
309 obEl.onbxdestdraghout = Struct_DragOut;
310 obEl.onbxdestdragfinish = Struct_DragFinish;
311 jsDD.registerDest(obEl);
315window.structGetSubDir = function(el, div_id, path, dirsonly)
317 var div = document.getElementById(div_id);
320 if(div.innerHTML == '')
322 div.innerHTML = '<?=CUtil::JSEscape(GetMessage("pub_struct_loading
"))?>';
323 CHttpRequest.Action = function(result)
325 result = jsUtils.trim(result);
326 div.innerHTML = result;
330 el.className = 'bx-struct-dot';
331 div.style.display = 'none';
334 CHttpRequest.Send('/bitrix/admin/public_structure.php?ajax=Y&<?="lang=
".$encLang."&site=
".$encSite?>&load_path='+path+(dirsonly? '&dirsonly=Y':''));
336 el.className = (el.className == 'bx-struct-plus'? 'bx-struct-minus':'bx-struct-plus');
337 div.style.display = (div.style.display == 'none'? 'block':'none');
340window.structGetSubdirAction = function(id)
342 var el = document.getElementById(id);
345 setTimeout(function(){if(window.structMenu) window.structMenu.PopupHide();}, 50);
350window.structReload = function(path, params)
352 CHttpRequest.Action = function(result)
355 var container = document.getElementById('structure_content');
357 container.innerHTML = result;
360 structReloadDirs(path);
362 setTimeout(ShowWaitWindow, 50);
363 CHttpRequest.Send('/bitrix/admin/public_structure.php?ajax=Y&reload=Y&<?="lang=
".$encLang."&site=
".$encSite?>&path='+path+(params? '&'+params:''));
366window.structReloadDirs = function(path)
368 var container = document.getElementById('bx_struct_dirs_container');
371 CHttpRequest.Action = function(result)
373 container.innerHTML = result;
376 setTimeout(ShowWaitWindow, 50);
377 CHttpRequest.Send('/bitrix/admin/public_structure.php?ajax=Y&reload=Y&<?="lang=
".$encLang."&site=
".$encSite?>&dirsonly=Y&path='+path);
380window.structNameOver = function(el)
382 el.className += ' bx-struct-name-over';
385window.structNameOut = function(el)
387 el.className = el.className.replace(/\s*bx-struct-name-over/ig, "");
390window.structPopup = <?=$obJSPopup->jsPopup?>;
392window.jsPopup_subdialog = new JCPopup({'suffix':'subdialog', 'zIndex':parseInt(window.structPopup.zIndex)+20});
394window.structShowSubDialog = function()
396 setTimeout(function(){window.structPopup.bDenyEscKey = true}, 200);
397 jsUtils.addCustomEvent('OnBeforeCloseDialog', function(){setTimeout(function(){window.structPopup.bDenyEscKey = false;}, 50);});
400window.structAddFile = function(path, isFolder)
402 structShowSubDialog();
404 $url = $APPLICATION->GetPopupLink(array(
405 "URL
"=>"/bitrix/admin/public_file_new.php?
subdialog=Y&
lang=
".$encLang."&site=
".$encSite."&templateID=
".$encTemplateID."&
path=_PATH_
",
406 "PARAMS
"=> Array("min_width
"=>450, "min_height
" => 250)), "subdialog");
407 $url = str_replace("_PATH_
", "'+path+(isFolder==true? '&newFolder=Y
':'')+'", $url);
412window.structAccessDialog = function(path)
414 structShowSubDialog();
416 $url = $APPLICATION->GetPopupLink(Array(
417 "URL
"=>"/bitrix/admin/public_access_edit.php?
subdialog=Y&
lang=
".$encLang."&site=
".$encSite."&
path=_PATH_
",
418 "PARAMS
" => Array("min_width
"=>450, "min_height
" => 250)), "subdialog");
419 $url = str_replace("_PATH_
", "'+path+'", $url);
424window.structEditFolder = function(path)
426 structShowSubDialog();
428 $url = $APPLICATION->GetPopupLink(array(
429 "URL
"=>"/bitrix/admin/public_folder_edit.php?
subdialog=Y&
lang=
".$encLang."&site=
".$encSite."&
path=_PATH_
",
430 "PARAMS
" => Array("min_width
"=>450, "min_height
" => 250)), "subdialog");
431 $url = str_replace("_PATH_
", "'+path+'", $url);
436window.structEditFile = function(path)
439 $url = $APPLICATION->GetPopupLink(Array(
441 "PARAMS
"=>array("width"=>780, "height"=>570, "resize
"=>true)), "editor
");
442 $url = str_replace("_PATH_
", "'+path+'", $url);
447window.structEditFileHtml = function(path)
450 $url = $APPLICATION->GetPopupLink(Array(
451 "URL
"=>"/bitrix/admin/public_file_edit.php?
bxpublic=Y&
subdialog=Y&
lang=
".$encLang."&noeditor=Y&
path=_PATH_&site=
".$encSite,
452 "PARAMS
"=>array("width"=>780, "height"=>570, "resize
"=>true)), "editor
");
453 $url = str_replace("_PATH_
", "'+path+'", $url);
458window.structFileProp = function(path)
460 structShowSubDialog();
462 $url = $APPLICATION->GetPopupLink(Array(
463 "URL
"=>"/bitrix/admin/public_file_property.php?
subdialog=Y&
lang=
".$encLang."&site=
".$encSite."&
path=_PATH_
",
464 "PARAMS
" => Array("min_width
"=>450, "min_height
" => 250)), "subdialog");
465 $url = str_replace("_PATH_
", "'+path+'", $url);
470window.structDelFile = function(path)
472 structShowSubDialog();
474 $url = $APPLICATION->GetPopupLink(array(
475 "URL
" => "/bitrix/admin/public_file_delete.php?
subdialog=Y&
lang=
".$encLang."&site=
".$encSite."&
path=_PATH_
",
476 "PARAMS
" => Array("min_width
"=>250, "min_height
" => 150, 'height' => 150, 'width' => 350)), "subdialog");
477 $url = str_replace("_PATH_
", "'+path+'", $url);
482window.structDelFolder = function(path)
484 if(confirm('<?=CUtil::JSEscape(GetMessage("pub_struct_folder_del_confirm
"))?>'))
485 structReload(path, 'action=delfolder&<?="lang=
".$encLang."&site=
".$encSite."&
".bitrix_sessid_get()?>&path='+path);
488window.structShowDirMenu = function(el, dirsonly, arPerm)
490 var path = el.getAttribute('__bx_path');
492 {'ICONCLASS': 'panel-new-file', 'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_add_page
"))?>', 'ONCLICK': 'structAddFile(\''+path+'\')', 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_add_page_title
"))?>', 'DISABLED':!arPerm.create_file},
493 {'ICONCLASS': 'panel-new-folder', 'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_add_sect
"))?>', 'ONCLICK': 'structAddFile(\''+path+'\', true)', 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_add_sect_title
"))?>', 'DISABLED':!arPerm.create_folder},
495 {'ICONCLASS': 'panel-folder-props', 'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_folder_prop
"))?>', 'ONCLICK': 'structEditFolder(\''+path+'\')', 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_folder_prop_title
"))?>', 'DISABLED':!arPerm.edit_folder},
496 {'ICONCLASS': 'panel-folder-access', 'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_folder_access
"))?>', 'ONCLICK': 'structAccessDialog(\''+path+'\')', 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_folder_access_title
"))?>', 'DISABLED':!arPerm.edit_perm}
499 if(unescape(path) != '/')
501 items[items.length] = {'SEPARATOR':true};
502 items[items.length] = {'ICONCLASS': 'panel-folder-delete', 'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_folder_del
"))?>', 'ONCLICK': 'structDelFolder(\''+path+'\')', 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_folder_del_title
"))?>', 'DISABLED':!arPerm.del_folder};
504 items[items.length] = {'SEPARATOR':true};
505 items[items.length] = {'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_cp
"))?>', 'ONCLICK': 'jsUtils.Redirect(arguments, \'/bitrix/admin/fileman_admin.php?lang=<?=$encLang?>&site=<?=$encSite?>&path='+path+'\')', 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_cp_title
"))?>'};
508 window.structShowMenu(el, items, dirsonly);
511window.structShowFileMenu = function(el, arPerm)
513 var path = el.getAttribute('__bx_path');
515 var pos = path.lastIndexOf('.');
517 ext = path.substr(pos+1);
521 if(ext == 'php' || ext == 'htm' || ext == 'html')
523 items[items.length] = {'ICONCLASS': 'panel-edit-visual', 'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_file_edit
"))?>', 'ONCLICK': 'structEditFile(\''+path+'\')', 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_file_edit_title
"))?>', 'DEFAULT':true, 'DISABLED':!arPerm.edit_file};
524 items[items.length] = {'ICONCLASS': 'panel-edit-text', 'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_file_edit_html
"))?>', 'ONCLICK': 'structEditFileHtml(\''+path+'\')', 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_file_edit_html_title
"))?>', 'DISABLED':!arPerm.edit_file};
529 items[items.length] = {'SEPARATOR':true};
530 items[items.length] = {'ICONCLASS': 'panel-file-props', 'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_file_prop
"))?>', 'ONCLICK': 'structFileProp(\''+path+'\')', 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_file_prop_title
"))?>', 'DISABLED':!arPerm.edit_file};
531 items[items.length] = {'ICONCLASS': 'panel-file-access', 'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_file_access
"))?>', 'ONCLICK': 'structAccessDialog(\''+path+'\')', 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_file_access_title
"))?>', 'DISABLED':!arPerm.edit_perm};
534 items[items.length] = {'SEPARATOR':true};
535 items[items.length] = {'ICONCLASS': 'panel-file-delete', 'TEXT': (bText? '<?=CUtil::JSEscape(GetMessage("pub_struct_file_del
"))?>':'<?=CUtil::JSEscape(GetMessage("pub_struct_file_del_title
"))?>'), 'ONCLICK': 'structDelFile(\''+path+'\')', 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_file_del_title1
"))?>', 'DISABLED':!arPerm.del_file};
537 window.structShowMenu(el, items);
540window.structEditFileAction = function(el)
542 var path = el.getAttribute('__bx_path');
543 var pos = path.lastIndexOf('.');
546 var ext = path.substr(pos+1);
547 if(ext == 'php' || ext == 'htm' || ext == 'html')
548 structEditFile(path);
552window.structShowMenu = function(el, items, dirsonly)
554 if(!window.structMenu)
556 window.structMenu = new PopupMenu('structure_menu');
557 window.structMenu.Create(parseInt(window.structPopup.zIndex)+15);
560 if(window['structHint'+el.id])
561 window['structHint'+el.id].Freeze();
562 window.structPopup.bDenyEscKey = true;
563 jsUtils.addCustomEvent('OnBeforeCloseDialog', window.structMenu.PopupHide, [], window.structMenu);
565 //var dY = document.getElementById((dirsonly? 'bx_struct_dirs_content':'bx_popup_content')).scrollTop;
568 ? BX('bx_struct_dirs_content')
569 : BX.findParent(window.structPopup.GetContent(), {tag: 'DIV'}) // hack ;-(
572 var dPos = {'left':0, 'right':0, 'top':-dY+1, 'bottom':-dY+1};
574 window.structMenu.ShowMenu(el, items, false, dPos, function(){
575 setTimeout(function(){window.structPopup.bDenyEscKey = false}, 50);
576 if(window['structHint'+el.id])
577 window['structHint'+el.id].UnFreeze();
581window.structShowSettingsMenu = function(el)
583 if(!window.structSettingsMenu)
584 window.structSettingsMenu = new PopupMenu('structure_menu', parseInt(window.structPopup.zIndex)+10);
587 {'ICONCLASS': (window.structOptions['show_all_files'] == true? 'checked':''),
588 'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_show_all
"))?>',
589 'ONCLICK': 'structReload(\'<?=$encPath?>\', \'show_all_files='+(window.structOptions['show_all_files'] == true? 'N':'Y')+'\')',
590 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_show_all_title
"))?>'},
591 {'ICONCLASS': (window.structOptions['show_file_info'] == true? 'checked':''),
592 'TEXT': '<?=CUtil::JSEscape(GetMessage("pub_struct_show_info
"))?>',
593 'ONCLICK': 'structReload(\'<?=$encPath?>\', \'show_file_info='+(window.structOptions['show_file_info'] == true? 'N':'Y')+'\')',
594 'TITLE': '<?=CUtil::JSEscape(GetMessage("pub_struct_show_info_title
"))?>'}
597 window.structSettingsMenu.SetItems(items);
598 window.structSettingsMenu.BuildItems();
600 window.structPopup.bDenyEscKey = true;
601 jsUtils.addCustomEvent('OnBeforeCloseDialog', window.structSettingsMenu.PopupHide, [], window.structSettingsMenu);
603 window.structSettingsMenu.ShowMenu(el, false, false, false, function(){setTimeout(function(){window.structPopup.bDenyEscKey = false}, 50)});
606window.structOpenDirs = function(el)
608 if(document.getElementById('bx_struct_dirs'))
610 var strDiv = window.structPopup.Get();
611 var div = jsFloatDiv.Create({
612 'id':'bx_struct_dirs',
613 'className':'bx-popup-form',
614 'zIndex':parseInt(window.structPopup.zIndex)+10,
615 'width':250, 'height':strDiv.offsetHeight
620 '/bitrix/admin/public_structure.php?ajax=Y&reload=Y&<?="lang=
".$encLang."&site=
".$encSite."&
path=
".$encPath?>&dirsonly=Y',
623 var container = document.getElementById('bx_struct_dirs');
626 container.innerHTML =
627 '<div class="bx-popup-
title" id="bx_popup_title_dirs
"><table cellspacing="0
" class="bx-width100
">'+
629 ' <td class="bx-width100 bx-
title-text
" onmousedown="jsFloatDiv.StartDrag(arguments[0], document.getElementById(\
'bx_struct_dirs\'));">'+
'<?=CUtil::JSEscape(GetMessage("pub_struct_sections"))?>'+
'</td>'+
630 ' <td class="bx-width0"><a class="bx-popup-close" href="javascript:void(0)" onclick="structCloseDirs()" title="'+
'<?=CUtil::JSEscape(GetMessage("pub_struct_close"))?>'+
'"></a></td>'+
633 '<div class="bx-popup-content" id="bx_struct_dirs_content"><div class="bx-popup-content-container" id="bx_struct_dirs_container">'+result+
'</div></div>';
635 var pos = jsUtils.GetRealPos(strDiv);
636 var cont = document.getElementById(
'bx_struct_dirs_content');
637 cont.style.height = pos[
"bottom"]-pos[
"top"]-31+
'px';
638 cont.style.width = 250-12+
'px';
640 jsDD.registerContainer(cont);
642 div.style.zIndex = parseInt(window.structPopup.zIndex)+2;
643 jsFloatDiv.Show(div, pos[
"left"]-250-1, pos[
"top"], 0,
true);
644 BX.closeWait(strDiv);
648 window.structUpdateTop =
function() {div.style.top = strDiv.style.top;};
649 BX.addCustomEvent(window.structPopup,
'onWindowClose', structCloseDirs);
650 BX.addCustomEvent(window.structPopup,
'onWindowExpand', window.structUpdateTop);
651 BX.addCustomEvent(window.structPopup,
'onWindowNarrow', window.structUpdateTop);
654window.structCloseDirs =
function()
656 var div = document.getElementById(
'bx_struct_dirs');
659 jsFloatDiv.Close(div);
660 div.parentNode.removeChild(div);
662 BX.removeCustomEvent(window.structPopup,
'onWindowClose', structCloseDirs);
664 if (window.structUpdateTop)
666 BX.removeCustomEvent(window.structPopup,
'onWindowExpand', window.structUpdateTop);
667 BX.removeCustomEvent(window.structPopup,
'onWindowNarrow', window.structUpdateTop);
668 window.structUpdateTop =
null;
674window.Struct_DragStart =
function()
676 var div = document.body.appendChild(document.createElement(
"DIV"));
677 div.style.position =
'absolute';
678 div.style.zIndex = parseInt(window.structPopup.zIndex)+30;
679 div.className =
'bx-struct-drag';
680 this.__dragCopyDiv = div;
683 if(!drag_div.getAttribute(
'__bx_path'))
684 drag_div = jsUtils.FindNextSibling(drag_div,
"div");
686 div.innerHTML = drag_div.innerHTML;
687 drag_div.className =
'bx-struct-name bx-struct-name-drag';
689 window.structContainers = [BX.findParent(window.structPopup.GetContent(), {tag:
'DIV'}), document.getElementById(
'bx_struct_dirs_content')];
690 window.structContainerPos = [];
691 for(var i=0; i<window.structContainers.length; i++)
692 if(window.structContainers[i])
693 window.structContainerPos[i] = jsUtils.GetRealPos(window.structContainers[i]);
695 var hint = window[
'structHint'+drag_div.id];
702window.Struct_Drag =
function(x, y)
704 var div = this.__dragCopyDiv;
705 div.style.left = x+
'px';
706 div.style.top = y+
'px';
708 for(var i=0; i<window.structContainers.length; i++)
710 if(window.structContainers[i] && x >= window.structContainerPos[i][
"left"] && x <= window.structContainerPos[i][
"right"])
712 if(y > window.structContainerPos[i][
"bottom"])
713 window.structContainers[i].scrollTop += 20;
714 if(y < window.structContainerPos[i][
"top"])
715 window.structContainers[i].scrollTop -= 20;
722window.Struct_DragStop =
function()
724 this.__dragCopyDiv.parentNode.removeChild(this.__dragCopyDiv);
725 this.__dragCopyDiv =
null;
728 if(!drag_div.getAttribute(
'__bx_path'))
729 drag_div = jsUtils.FindNextSibling(drag_div,
"div");
731 drag_div.className =
'bx-struct-name';
733 var hint = window[
'structHint'+drag_div.id];
740window.Struct_DragHover =
function(obDrag, x, y)
742 this.className +=
' bx-struct-dragover';
746window.Struct_DragOut =
function(obDrag, x, y)
748 this.className = this.className.replace(/\s*bx-
struct-dragover/ig,
"");
752window.Struct_DragFinish =
function(obDrag, x, y, e)
754 this.className = this.className.replace(/\s*bx-
struct-dragover/ig,
"");
756 if(!obDrag.getAttribute(
'__bx_path'))
757 obDrag = jsUtils.FindNextSibling(obDrag,
"div");
763 var enc_from = obDrag.getAttribute(
'__bx_path');
764 var enc_to = this.getAttribute(
'__bx_path');
765 var from = unescape(enc_from);
766 var to = unescape(enc_to);
767 if(to.charAt(to.length-1) !=
'/')
769 if(to == from.substring(0, from.lastIndexOf(
'/')+1))
772 if(to.indexOf(from+
'/') == 0)
776 var bFolder = (obDrag.getAttribute(
'__bx_type') ==
'D');
778 mess = (bFolder?
'<?=CUtil::JSEscape(GetMessage("pub_struct_folder_confirm_copy"))?>' :
'<?=CUtil::JSEscape(GetMessage("pub_struct_file_confirm_copy"))?>');
780 mess = (bFolder?
'<?=CUtil::JSEscape(GetMessage("pub_struct_folder_confirm_move"))?>' :
'<?=CUtil::JSEscape(GetMessage("pub_struct_file_confirm_move"))?>');
782 mess = mess.replace(/#FROM#/g, from);
783 mess = mess.replace(/#TO#/g, unescape(enc_to));
785 structReload(enc_to,
'action='+(e.ctrlKey?
'copy':
'move')+
'&from='+enc_from+
'&to='+enc_to+
'&<?=bitrix_sessid_get()?>');
792jsDD.registerContainer(BX.WindowManager.Get().GetContent());
800<p><b><?echo
GetMessage(
"pub_struct_desc_title")?></b></p>
801<div
class=
"bx-struct-settings" onclick=
"structShowSettingsMenu(this)" onmouseover=
"this.className+=' bx-struct-settings-over'" onmouseout=
"this.className=this.className.replace(/\s*bx-struct-settings-over/ig, '')" title=
"<?echo GetMessage("pub_struct_settings_title
")?>"><?echo
GetMessage(
"pub_struct_settings")?></div>
802<div
class=
"bx-struct-settings bx-struct-button" onclick=
"structOpenDirs(this)" onmouseover=
"this.className+=' bx-struct-settings-over'" onmouseout=
"this.className=this.className.replace(/\s*bx-struct-settings-over/ig, '')" title=
"<?echo GetMessage("pub_struct_folders_title
")?>"><?echo
GetMessage(
"pub_struct_folders_button")?></div>
804<br
style=
"clear:both;" />
808<div
id=
"structure_content">
819require(
$_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/modules/main/include/epilog_admin_js.php");
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)
bx_acc_lim_group_list limitGroupList[] multiple<?=$group[ 'ID']?> ID selected margin top
hidden mSiteList<?=htmlspecialcharsbx(serialize( $siteList))?><?=htmlspecialcharsbx( $siteList[ $j]["ID"])?> _Propery<? if(((COption::GetOptionString( $module_id, "different_set", "N")=="Y") &&( $j !=0))||(COption::GetOptionString( $module_id, "different_set", "N")=="N")) echo "display: none;"?> top adm detail content cell l top adm detail content cell r heading center center ID left
$_SERVER["DOCUMENT_ROOT"]
URL bitrix admin public_access_edit php subdialog
if(isset( $_GET[ 'ajax']) &&$_GET[ 'ajax']=='Y') if(isset($_GET['ajax']) && $_GET['ajax']=='Y') $encPath
URL bitrix admin public_file_edit php bxpublic
__struct_file_sort($a, $b)
__struct_get_file_info($abs_path, $file)
__struct_show_files($arFiles, $doc_root, $path, $open_path, $dirsonly=false)
ParseFileContent($filesrc, $params=[])
htmlspecialcharsback($str)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
<? endif;?> window document title
$GLOBALS['_____370096793']
adm detail iblock types adm detail iblock list tr_SITE_ID display