1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
file_edit.php
См. документацию.
1<?
2define('BX_PUBLIC_MODE', 0);
3require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
4require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_js.php");
5
6$addUrl = 'lang='.LANGUAGE_ID.(isset($logical) && $logical == "Y"?'&logical=Y':'');
7$useEditor3 = COption::GetOptionString('fileman', "use_editor_3", "N") == "Y";
9 isset($_REQUEST['from']) &&
10 (
11 $_REQUEST['from'] == 'main.include'
12 || $_REQUEST['from'] == 'includefile'
13 || $_REQUEST['from'] == 'includecomponent'
14 )
15;
16$bDisableEditor = !CModule::IncludeModule('fileman') || (isset($_REQUEST['noeditor']) && $_REQUEST['noeditor'] == 'Y');
17
18if (!($USER->CanDoOperation('fileman_admin_files') || $USER->CanDoOperation('fileman_edit_existent_files')))
19{
20 $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
21}
22
23require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/include.php");
24
25IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_html_edit.php");
26IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/file_edit.php");
27
28$obJSPopup = new CJSPopup("lang=".urlencode($_GET["lang"] ?? '')."&site=".urlencode($_GET["site"] ?? '')."&back_url=".urlencode($_GET["back_url"] ?? '')."&path=".urlencode($_GET["path"] ?? '')."&name=".urlencode($_GET["name"] ?? ''), array("SUFFIX"=>(isset($_REQUEST['subdialog']) && $_REQUEST['subdialog'] == 'Y'? 'editor':'')));
29
32$rsSiteTemplates = CSite::GetTemplateList($site ?? '');
33while($arSiteTemplate = $rsSiteTemplates->Fetch())
34{
35 if($arSiteTemplate["CONDITION"] == '')
36 {
37 $site_template = $arSiteTemplate["TEMPLATE"];
38 break;
39 }
40}
41
43
44$bVarsFromForm = false; // if 'true' - we will get content and variables from form, if 'false' - from saved file
45$bSessIDRefresh = false; // флаг, указывающий, нужно ли обновлять ид сессии на клиенте
46$editor_name = $_REQUEST['editor_name'] ?? 'filesrc_pub';
47$filename = $_REQUEST['filename'] ?? '';
48$new = $_REQUEST['new'] ?? '';
49$template = $_REQUEST['template'] ?? '';
50
51if ($filename != '' && ($mess = CFileMan::CheckFileName($filename)) !== true)
52{
53 $filename2 = $filename;
54 $filename = '';
55 $strWarning = $mess;
56 $bVarsFromForm = true;
57}
58
59$path = urldecode($path ?? '');
60$path = $io->CombinePath("/", $path);
61
63if(!$site)
64 $site = CSite::GetSiteByFullPath($_SERVER["DOCUMENT_ROOT"].$path);
65
66$DOC_ROOT = CSite::GetSiteDocRoot($site);
68
69if(GetFileType($abs_path) == "IMAGE")
70 $strWarning = GetMessage("PUBLIC_EDIT_FILE_IMAGE_ERROR");
71
73
74if(!$io->FileExists($abs_path) && !$io->DirectoryExists($abs_path))
75{
76 $p = mb_strrpos($path, "/");
77 if($p!==false)
78 {
79 $new = "Y";
80 $filename = mb_substr($path, $p + 1);
81 $path = mb_substr($path, 0, $p);
82 }
83}
84$relPath = $io->ExtractPathFromPath($path);
85
87
88$arParsedPath = CFileMan::ParsePath(Array($site, $path), true, false, "", false);
89$isScriptExt = in_array(CFileman::GetFileExtension($path), CFileMan::GetScriptFileExt());
90
92 $AUTOSAVE = new CAutoSave();
93
95if ($filename == '')
96{
97 $imgName = $io->ExtractNameFromPath($path);
98}
100
101//Check access to file
102if(
103 (
104 $new <> '' &&
105 !(
106 $USER->CanDoOperation('fileman_admin_files') &&
107 $USER->CanDoFileOperation('fm_create_new_file', $arPath)
108 )
109 )
110 ||
111 (
112 $new == '' &&
113 !(
114 $USER->CanDoOperation('fileman_edit_existent_files') &&
115 $USER->CanDoFileOperation('fm_edit_existent_file',$arPath)
116 )
117 )
118)
119{
120 $strWarning = GetMessage("ACCESS_DENIED");
121}
122elseif($strWarning == '')
123{
124 if(!$USER->IsAdmin() && str_starts_with(CFileman::GetFileName($abs_path), "."))
125 {
126 $strWarning = GetMessage("FILEMAN_FILEEDIT_BAD_FNAME")." ";
127 $bEdit = false;
128 $bVarsFromForm = true;
129 $path = $io->CombinePath("/", $arParsedPath["PREV"]);
130 $arParsedPath = CFileMan::ParsePath($path, true, false, "", $logical == "Y");
131 $abs_path = $DOC_ROOT.$path;
132 }
133 elseif($new == 'Y')
134 {
135 $bEdit = false;
136 }
137 else
138 {
139 if(!$io->FileExists($abs_path))
140 $strWarning = GetMessage("FILEMAN_FILEEDIT_FOLDER_EXISTS")." ";
141 else
142 $bEdit = true;
143 }
144
145 $limit_php_access = ($USER->CanDoFileOperation('fm_lpa', $arPath) && !$USER->CanDoOperation('edit_php'));
146 if ($limit_php_access)
147 {
148 //OFP - 'original full path' used for restorin' php code fragments in limit_php_access mode
149 if (!isset(\Bitrix\Main\Application::getInstance()->getSession()['arOFP']))
150 \Bitrix\Main\Application::getInstance()->getSession()['arOFP'] = Array();
151
152 if(isset($_POST['ofp_id']))
153 {
154 $ofp_id = $_POST['ofp_id'];
155 }
156 else
157 {
158 $ofp_id = mb_substr(md5($site.'|'.$path), 0, 8);
159 if(!isset(\Bitrix\Main\Application::getInstance()->getSession()['arOFP'][$ofp_id]))
160 \Bitrix\Main\Application::getInstance()->getSession()['arOFP'][$ofp_id] = $path;
161 }
162 }
163}
164
165if($strWarning == '')
166{
167 if($bEdit)
168 {
169 $oFile = $io->GetFile($abs_path);
170 $filesrc_tmp = $oFile->GetContents();
171 }
172 else
173 {
174 $arTemplates = CFileman::GetFileTemplates(LANGUAGE_ID, array($site_template));
175 if(!empty($template))
176 {
177 foreach ($arTemplates as $arTemplate)
178 {
179 if($arTemplate["file"] == $template)
180 {
181 $filesrc_tmp = CFileman::GetTemplateContent($arTemplate["file"],LANGUAGE_ID, array($site_template));
182 break;
183 }
184 }
185 }
186 else
187 {
188 $filesrc_tmp = CFileman::GetTemplateContent($arTemplates[0]["file"], LANGUAGE_ID, array($site_template));
189 }
190 }
191
192 if($_SERVER["REQUEST_METHOD"] == "POST" && isset($_REQUEST['save']) && $_REQUEST['save'] == 'Y')
193 {
194 $filesrc = $filesrc_pub;
196 {
197 $strWarning = GetMessage("FILEMAN_SESSION_EXPIRED");
198 $bVarsFromForm = true;
199 $bSessIDRefresh = true;
200 }
201 elseif((CFileman::IsPHP($filesrc) || $isScriptExt) && !($USER->CanDoOperation('edit_php') || $limit_php_access)) //check rights
202 {
203 $strWarning = GetMessage("FILEMAN_FILEEDIT_CHANGE");
204 $bVarsFromForm = true;
205 }
206 else
207 {
208 if($limit_php_access)
209 {
210 // ofp - original full path :)
211 $ofp = \Bitrix\Main\Application::getInstance()->getSession()['arOFP'][$ofp_id];
212 $ofp = $io->CombinePath("/", $ofp);
213 $abs_ofp = $DOC_ROOT.$ofp;
214
215 $f = $io->GetFile($abs_ofp);
216 $old_filesrc_tmp = $f->GetContents();
217 $old_res = CFileman::ParseFileContent($old_filesrc_tmp, true);
218 $old_filesrc = $old_res["CONTENT"];
219 $filesrc = LPA::Process($filesrc, $old_filesrc);
220 }
221
222 $res = CFileman::ParseFileContent($filesrc_tmp, true);
223 $prolog = CFileman::SetTitle($res["PROLOG"], $title);
224 for ($i = 0; $i<=$maxind; $i++)
225 {
226 if(trim($_POST["CODE_".$i]) <> '')
227 {
228 if($_POST["CODE_".$i] != $_POST["H_CODE_".$i])
229 {
230 $prolog = CFileman::SetProperty($prolog, trim($_POST["H_CODE_".$i]), "");
231 $prolog = CFileman::SetProperty($prolog, trim($_POST["CODE_".$i]), trim($_POST["VALUE_".$i]));
232 }
233 else
234 $prolog = CFileman::SetProperty($prolog, trim($_POST["CODE_".$i]), trim($_POST["VALUE_".$i]));
235 }
236 else
237 $prolog = CFileman::SetProperty($prolog, trim($_POST["H_CODE_".$i]), "");
238 }
239 $epilog = $res["EPILOG"];
240 $filesrc_for_save = $prolog.$filesrc.$epilog;
241 }
242
243 if($strWarning == '')
244 {
245 if (!CFileMan::CheckOnAllowedComponents($filesrc_for_save))
246 {
247 $str_err = $APPLICATION->GetException();
248 if($str_err && ($err = $str_err ->GetString()))
249 $strWarning .= $err;
250 $bVarsFromForm = true;
251 }
252 }
253
254 if($strWarning == '')
255 {
256 // File was created just a second ago
257 if (isset($_REQUEST["edit_new_file_undo"]) && $_REQUEST["edit_new_file_undo"] <> '')
258 {
259 CUndo::ShowUndoMessage($_REQUEST["edit_new_file_undo"]);
260 }
261 else
262 {
263 $f = $io->GetFile($abs_path);
264 $arUndoParams = array(
265 'module' => 'fileman',
266 'undoType' => 'edit_file',
267 'undoHandler' => 'CFileman::UndoEditFile',
268 'arContent' => array(
269 'absPath' => $abs_path,
270 'content' => $f->GetContents()
271 )
272 );
273 }
274
275 if(!$APPLICATION->SaveFileContent($abs_path, $filesrc_for_save))
276 {
277 if($str_err = $APPLICATION->GetException())
278 {
279 if ($err = $str_err ->GetString())
280 $strWarning = $err;
281
282 $bVarsFromForm = true;
283 $path = $io->CombinePath("/", $arParsedPath["PREV"]);
284 $arParsedPath = CFileMan::ParsePath($path, true, false, "", $logical == "Y");
285 $abs_path = $DOC_ROOT.$path;
286 }
287
288 if (empty($strWarning))
289 $strWarning = GetMessage("FILEMAN_FILE_SAVE_ERROR")." ";
290 }
291 else
292 {
293 if(COption::GetOptionString("fileman", "log_page", "Y")=="Y")
294 {
295 CEventLog::Log("content", "PAGE_EDIT", "fileman", $path, false, $_REQUEST["site"] ?? false);
296 }
297
298 if (CAutoSave::Allowed())
299 $AUTOSAVE->Reset();
300 }
301 }
302
303 if($strWarning == '')
304 {
305 if ($arUndoParams)
306 CUndo::ShowUndoMessage(CUndo::Add($arUndoParams));
307
308?>
309<script>
310<?
311if(!isset($_REQUEST['subdialog']) || $_REQUEST['subdialog'] != 'Y'):
312 $url = $_REQUEST["back_url"] ?? '';
313 if(!str_starts_with($url, "/") || mb_substr($url, 1, 1) == "/")
314 {
315 //only local /url is allowed
316 $url = '';
317 }
318?>
319 top.BX.reload('<?=CUtil::JSEscape($url)?>', true);
320<?else:?>
321 if (null != top.structReload)
322 top.structReload('<?=urlencode($_REQUEST["path"] ?? '')?>');
323<?endif;?>
324 top.<?=$obJSPopup->jsPopup?>.Close();
325</script>
326<?
327 }
328 else
329 {
330?>
331<script>
332top.CloseWaitWindow();
333top.<?=$obJSPopup->jsPopup?>.ShowError('<?=CUtil::JSEscape($strWarning)?>');
334var pMainObj = top.GLOBAL_pMainObj['<?=CUtil::JSEscape($editor_name)?>'];
335pMainObj.Show(true);
336<?if ($bSessIDRefresh):?>
337top.BXSetSessionID('<?=CUtil::JSEscape(bitrix_sessid())?>');
338<?endif;?>
339</script>
340<?
341 }
342 die();
343 }
344}
345else
346{
347?>
348<script>
349top.CloseWaitWindow();
350top.<?=$obJSPopup->jsPopup?>.ShowError('<?=CUtil::JSEscape($strWarning)?>');
351var pMainObj = top.GLOBAL_pMainObj['<?=CUtil::JSEscape($editor_name)?>'];
352pMainObj.Show(true);
353</script>
354<?
355 die();
356}
357
359{
360 $res = CFileman::ParseFileContent($filesrc_tmp, true);
361 $filesrc = $res["CONTENT"];
362
363 // ########### L P A ############
364 if ($limit_php_access)
365 {
367 $l = count($arPHP);
368 if ($l > 0)
369 {
370 $new_filesrc = '';
371 $end = 0;
372 $php_count = 0;
373 for ($n = 0; $n<$l; $n++)
374 {
375 $start = $arPHP[$n][0];
376 $new_filesrc .= mb_substr($filesrc, $end, $start - $end);
377 $end = $arPHP[$n][1];
378
379 //Trim php tags
380 $src = $arPHP[$n][2];
381 if (str_starts_with($src, "<?php"))
382 $src = substr($src, 5);
383 else
384 $src = substr($src, 2);
385 $src = substr($src, 0, -2);
386
387 //If it's Component 2, keep the php code. If it's component 1 or ordinary PHP - than replace code by #PHPXXXX# (XXXX - count of PHP scripts)
388 $comp2_begin = '$APPLICATION->INCLUDECOMPONENT(';
389 if (mb_strtoupper(mb_substr($src, 0, mb_strlen($comp2_begin))) == $comp2_begin)
390 $new_filesrc .= $arPHP[$n][2];
391 else
392 $new_filesrc .= '#PHP'.str_pad(++$php_count, 4, "0", STR_PAD_LEFT).'#';
393 }
394 $new_filesrc .= mb_substr($filesrc, $end);
395 $filesrc = $new_filesrc;
396 }
397 }
398
399 $bEditProps = (mb_strpos($res["PROLOG"], "prolog_before") > 0 || mb_strpos($res["PROLOG"], "header.php") > 0);
400 $title = $res["TITLE"];
401
402 if((CFileman::IsPHP($filesrc) || $isScriptExt) && !($USER->CanDoOperation('edit_php') || $limit_php_access))
403 $strWarning = GetMessage("FILEMAN_FILEEDIT_CHANGE_ACCESS");
404}
405
406$obJSPopup->ShowTitlebar(GetMessage('PUBLIC_EDIT_TITLE'.($bFromComponent ? '_COMP' : '')).': '.htmlspecialcharsex($_GET['path']));
407
408
409$obJSPopup->StartContent(
410 array(
411 'style' => "0px; height: 500px; overflow: hidden;",
412 'class' => "bx-content-editor"
413 )
414);
415?>
416</form>
417<iframe src="javascript:void(0)" name="file_edit_form_target" height="0" width="0" style="display: none;"></iframe>
418<form action="/bitrix/admin/public_file_edit.php" name="editor_form" method="post" enctype="multipart/form-data" target="file_edit_form_target" style="margin: 0px; padding: 0px; ">
419<?
421{
422 echo CJSCore::Init(array('autosave'), true);
423 $AUTOSAVE->Init();
424?><script>BX.WindowManager.Get().setAutosave();</script><?
425}
426?>
428<input type="submit" name="submitbtn" style="display: none;" />
429<input type="hidden" name="mode" id="mode" value="public" />
430<input type="hidden" name="save" id="save" value="Y" />
431<input type="hidden" name="site" id="site" value="<?=htmlspecialcharsbx($site)?>" />
432<input type="hidden" name="template" id="template" value="<?echo htmlspecialcharsbx($template)?>" />
433<input type="hidden" name="templateID" id="templateID" value="<?echo htmlspecialcharsbx($_REQUEST['templateID'] ?? '')?>" />
434<input type="hidden" name="subdialog" value="<?echo htmlspecialcharsbx($_REQUEST['subdialog'] ?? '')?>" />
435<?if (is_set($_REQUEST, 'back_url')):?>
436 <input type="hidden" name="back_url" value="<?=htmlspecialcharsbx($_REQUEST['back_url'] ?? '')?>" />
437<?endif;?>
438<?if (is_set($_REQUEST, 'edit_new_file_undo')):?>
439 <input type="hidden" name="edit_new_file_undo" value="<?=htmlspecialcharsbx($_REQUEST['edit_new_file_undo'] ?? '')?>" />
440<?endif;?>
441<?if(!$bEdit):?>
442 <input type="hidden" name="new" id="new" value="Y" />
443 <input type="hidden" name="filename" id="filename" value="<?echo htmlspecialcharsbx($filename)?>" />
444 <input type="hidden" name="path" id="path" value="<?=htmlspecialcharsbx($path.'/'.$filename)?>" />
445<?else:?>
446 <input type="hidden" name="title" value="<?=htmlspecialcharsbx($title)?>" />
447 <input type="hidden" name="path" id="path" value="<?=htmlspecialcharsbx($path)?>" />
448<?endif;?>
449
450<script>
451<?=$obJSPopup->jsPopup?>.PARTS.CONTENT.getElementsByTagName('FORM')[0].style.display = 'none'; // hack
452
453function BXFormSubmit()
454{
455 ShowWaitWindow();
456 var obForm = document.forms.editor_form;
457 obForm.elements.submitbtn.click();
458}
459
460function BXSetSessionID(new_sessid)
461{
462 document.forms.editor_form.sessid.value = new_sessid;
463}
464</script>
465
466<?
467if (!$bDisableEditor)
468{
469 /* ************* HTML EDITOR 3.0 ************* */
470 if ($useEditor3)
471 {
472 $Editor = new CHTMLEditor;
473 $Editor->Show(array(
474 'name' => $editor_name,
475 'id' => $editor_name,
476 'width' => '100%',
477 'height' => '490',
478 'content' => $filesrc,
479 'bAllowPhp' => $USER->CanDoOperation('edit_php'),
480 "limitPhpAccess" => $limit_php_access,
481 "site" => $site,
482 "relPath" => $relPath,
483 "templateId" => $_REQUEST['templateID'] ?? '',
484 ));
485
486 ?>
487 <script>
488 (function() {
489 var
490 editorDialog = BX.WindowManager.Get(),
491 editor = top.BXHtmlEditor.Get('<?=CUtil::JSEscape($editor_name)?>');
492
493 if (editor.IsInited())
494 {
495 onEditorInited();
496 }
497 else
498 {
499 BX.addCustomEvent(editor, "OnEditorInitedAfter", onEditorInited);
500 }
501
502 BX.addCustomEvent(editorDialog, 'onWindowResizeExt', onEditorDialogResize);
503 BX.addCustomEvent(editorDialog, 'onBeforeWindowClose', onBeforeDialogClose);
504 BX.addCustomEvent(editorDialog, 'onWindowUnRegister', onEditorUnregister);
505
506 function onEditorDialogResize(params)
507 {
508 if (this.offsetTop === undefined)
509 this.offsetTop = editor.CheckBrowserCompatibility() ? 0 : 40;
510
511 var
512 width = params.width,
513 height = params.height - this.offsetTop;
514
515 editor.SetConfigHeight(height);
516 editor.ResizeSceleton(width, height);
517 }
518
519 function onEditorInited()
520 {
521 onEditorDialogResize(editorDialog.GetInnerPos());
522 function ConfirmExitDialog(editor)
523 {
524 var params = {
525 id: 'bx_confirm_exit',
526 width: 500,
527 resizable: false,
528 className: 'bxhtmled-confirm-exit-dialog'
529 };
530
531 var _this = this;
532 this.id = 'confirm_exit';
533 // Call parrent constructor
534 ConfirmExitDialog.superclass.constructor.apply(this, [editor, params]);
535
536 this.oDialog.ClearButtons();
537 this.oDialog.SetButtons([
538 new BX.CWindowButton(
539 {
540 title: '<?= GetMessageJS('PUBLIC_EDIT_SAVE_BUT')?>',
541 className: 'adm-btn-save',
542 action: function()
543 {
544 if (typeof window.BXFormSubmit == 'function')
545 {
546 BXFormSubmit();
547 }
548 _this.oDialog.Close(true);
549 }
550 }),
551 new BX.CWindowButton(
552 {
553 title: '<?= GetMessageJS('PUBLIC_EDIT_EXIT_BUT')?>',
554 action: function()
555 {
556 editorDialog.Close(true);
557 _this.oDialog.Close(true);
558 }
559 }),
560 this.oDialog.btnCancel
561 ]);
562 this.SetContent("<?= GetMessageJS('PUBLIC_EDIT_DIALOG_EXIT_ACHTUNG')?>");
563 this.SetTitle("<?= GetMessageJS('PUBLIC_EDIT_EDITOR')?>");
564 }
565 BX.extend(ConfirmExitDialog, window.BXHtmlEditor.Dialog);
566 editor.RegisterDialog('ConfirmExit', ConfirmExitDialog);
567
568 BX.addCustomEvent(editor, 'OnIframeKeyDown', function(e, keyCode, target)
569 {
570 if (keyCode == 27 && !editor.IsExpanded() && !editor.IsPopupsOpened())
571 {
572 editorDialog.Close();
573 }
574 });
575
576 BX.addCustomEvent(editor, 'OnGetDefaultUploadImageName', function(nameObj)
577 {
578 nameObj.value = '<?=CUtil::JSEscape($imgName)?>';
579 });
580 }
581
582 function onBeforeDialogClose()
583 {
584 if (editor.IsExpanded() || editor.IsPopupsOpened())
585 {
586 editorDialog.DenyClose();
587 }
588 else if (editor.IsContentChanged() && !editor.IsSubmited())
589 {
590 editorDialog.DenyClose();
591 editor.GetDialog('ConfirmExit').Show();
592 }
593 }
594
595 function onEditorUnregister()
596 {
597 editor.Destroy();
598 }
599 })();
600 </script>
601 <?
602 /* ************* END |HTML EDITOR 3.0| END ************* */
603 }
604 else
605 {
606 /* ************* OLD HTML EDITOR ************* */
607 CFileman::ShowHTMLEditControl($editor_name, $filesrc, Array(
608 "site" => $site,
609 "templateID" => $_REQUEST['templateID'] ?? '',
610 "bUseOnlyDefinedStyles" => COption::GetOptionString("fileman", "show_untitled_styles", "N")!="Y",
611 "bWithoutPHP" => (!$USER->CanDoOperation('edit_php')),
612 "toolbarConfig" => CFileman::GetEditorToolbarConfig($editor_name),
613 "arTaskbars" => Array("BXComponentsTaskbar", "BXComponents2Taskbar", "BXPropertiesTaskbar", "BXSnippetsTaskbar"),
614 "sBackUrl" => $back_url,
615 "path" => $path,
616 "limit_php_access" => $limit_php_access,
617 'height' => '490',
618 'width' => '100%',
619 'light_mode' => true,
620 ));
621
622 ?>
623 <script>
624 var _bEdit = true;
625 arEditorFastDialogs['asksave'] = function(pObj)
626 {
627 return {
628 title: BX_MESS.EDITOR,
629 innerHTML : "<div style='margin-bottom: 20px; padding: 5px;'>" + BX_MESS.DIALOG_EXIT_ACHTUNG + "</div>",
630 width: 700,
631 height: 130,
632 OnLoad: function()
633 {
634 window.oBXEditorDialog.SetButtons([
635 new BX.CWindowButton(
636 {
637 title: BX_MESS.DIALOG_SAVE_BUT,
638 action: function()
639 {
640 pObj.pMainObj.isSubmited = true;
641 if(pObj.params.savetype == 'save')
642 BXFormSubmit();
643 window.oBXEditorDialog.Close(true);
644 },
645 className: 'adm-btn-save'
646 }),
647 new BX.CWindowButton(
648 {
649 title: BX_MESS.DIALOG_EXIT_BUT,
650 action: function()
651 {
652 pObj.pMainObj.isSubmited = true;
653 <?=$obJSPopup->jsPopup?>.CloseDialog();
654 pObj.pMainObj.oPublicDialog.Close(true);
655 }
656 }),
657 window.oBXEditorDialog.btnCancel
658 ]);
659
660 BX.addClass(window.oBXEditorDialog.PARTS.CONTENT_DATA, "bxed-dialog");
661 }
662 };
663 };
664
665 function _BXOnBeforeCloseDialog()
666 {
667 var pMainObj = GLOBAL_pMainObj['<?=CUtil::JSEscape($editor_name)?>'];
668
669 // We need to ask user
670 if (pMainObj.IsChanged() && !pMainObj.isSubmited)
671 {
672 pMainObj.oPublicDialog.DenyClose();
673 pMainObj.OpenEditorDialog("asksave", false, 600, {window: window, savetype: _bEdit ? 'save' : 'saveas', popupMode: true}, true);
674 }
675 }
676
677 function CheckEditorFinish()
678 {
679 var pMainObj = GLOBAL_pMainObj['<?=CUtil::JSEscape($editor_name)?>'];
680 if (!pMainObj.bLoadFinish)
681 return setTimeout('CheckEditorFinish()', 100);
682
683 <?=$obJSPopup->jsPopup?>.AllowClose();
684
685 pMainObj.oPublicDialog = BX.WindowManager.Get();
686 BX.addClass(pMainObj.oPublicDialog.PARTS.CONTENT, "bx-editor-dialog-cont");
687 pMainObj.oPublicDialog.AllowClose();
688
689 // Hack for prevent editor visual bugs from reappending styles from core_window.css
690 BX.removeClass(BX.findParent(pMainObj.pWnd, {tagName: "DIV", className: "bx-core-dialog-content"}), "bx-core-dialog-content");
691
692 if (BX.browser.IsIE())
693 {
694 pMainObj.pWnd.firstChild.rows[0].style.height = '1px';
695 var sftbl;
696 if (sftbl = BX.findChild(pMainObj.oPublicDialog.PARTS.CONTENT, {tagName: "TABLE"}))
697 {
698 sftbl.cellSpacing = 0;
699 sftbl.cellPadding = 0;
700 }
701 }
702
703 var onWinResizeExt = function(Params)
704 {
705 var
706 topTlbrH = BX('filesrc_pub_toolBarSet0').offsetHeight || 51,
707 h = parseInt(Params.height) - 2,
708 w = parseInt(Params.width) - 3;
709
710 pMainObj.pWnd.style.height = h + "px";
711 pMainObj.pWnd.style.width = w + "px";
712 BX.findParent(pMainObj.cEditor, {tagName: "TABLE"}).style.height = (h - (topTlbrH + 35)) + "px";
713 pMainObj.arTaskbarSet[2]._SetTmpClass(true);
714 pMainObj.arTaskbarSet[2].Resize(false, false, false);
715 pMainObj.arTaskbarSet[3].Resize(false, false, false);
716
717 if (window._SetTmpClassInterval)
718 clearInterval(window._SetTmpClassInterval);
719 window._SetTmpClassInterval = setTimeout(function()
720 {
721 pMainObj.arTaskbarSet[2]._SetTmpClass(false);
722 pMainObj.SetCursorFF();
723 }, 300);
724 }
725 onWinResizeExt(pMainObj.oPublicDialog.GetInnerPos());
726 BX.addCustomEvent(pMainObj.oPublicDialog, 'onWindowResizeExt', onWinResizeExt);
727 BX.addCustomEvent(pMainObj.oPublicDialog, 'onBeforeWindowClose', _BXOnBeforeCloseDialog);
728 }
729
730 CheckEditorFinish();
731
732 <? if (COption::GetOptionString("fileman", "htmleditor_fullscreen", "N") == "Y"):?>
733 BX.WindowManager.Get().__expand();
734 <?endif;?>
735 </script>
736 <?
737 /* ************* END |OLD HTML EDITOR| END ************* */
738 }
739 ?>
740
741
742<?
743}
744else //if ($bDisableEditor)
745{
746 ?>
747<textarea name="<?=htmlspecialcharsbx($editor_name)?>" id="<?=htmlspecialcharsbx($editor_name)?>" style="height: 99%; width: 100%;"><?=htmlspecialcharsex($filesrc)?></textarea>
748<script>
749var
750 border,
751 wnd = BX.WindowManager.Get();
752
753function TAResize(data)
754{
755 var ta = BX('<?=CUtil::JSEscape($editor_name)?>');
756 if (null == border)
757 border = parseInt(BX.style(ta, 'border-left-width')) + parseInt(BX.style(ta, 'border-right-width'));
758
759 if (isNaN(border))
760 border = 0;
761
762 if (data.height)
763 ta.style.height = (data.height - border - 10) + 'px';
764 if (data.width)
765 ta.style.width = (data.width - border - 10) + 'px';
766}
767
768BX.addCustomEvent(wnd, 'onWindowResizeExt', TAResize);
769TAResize(wnd.GetInnerPos());
770</script>
771<?
772} //if (!$bDisableEditor)
773$obJSPopup->StartButtons();
774?>
775 <input type="button" class="adm-btn-save" id="btn_popup_save" name="btn_popup_save" value="<?=GetMessage("JSPOPUP_SAVE_CAPTION")?>" onclick="BXFormSubmit();" title="<?=GetMessage("JSPOPUP_SAVE_CAPTION")?>" />
776<?
777$obJSPopup->ShowStandardButtons(array('cancel'));
778$obJSPopup->EndButtons();
779
781{
782 $AUTOSAVE->checkRestore();
783}
784
785require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin_js.php");
786?>
$path
Определения access_edit.php:21
$back_url
Определения access_edit.php:50
$AUTOSAVE
Определения autosave.php:12
global $APPLICATION
Определения include.php:80
if($canUseYandexMarket) $strWarning
Определения options.php:74
static getInstance()
Определения application.php:98
Определения undo.php:238
static Allowed()
Определения undo.php:441
static GetInstance()
Определения virtual_io.php:60
static Log($SEVERITY, $AUDIT_TYPE_ID, $MODULE_ID, $ITEM_ID, $DESCRIPTION=false, $SITE_ID=false)
Определения event_log.php:32
static GetScriptFileExt()
Определения fileman.php:1711
static CheckOnAllowedComponents($str)
Определения fileman.php:1940
static __CheckSite($site)
Определения fileman.php:772
static ParsePath($path, $bLast=false, $url=false, $param="", $bLogical=false)
Определения fileman.php:790
static CheckFileName($str)
Определения fileman.php:2069
Определения html_editor.php:14
Show($arParams)
Определения html_editor.php:593
static Init($arExt=array(), $bReturn=false)
Определения jscore.php:66
Определения jspopup.php:10
static ShowUndoMessage($ID)
Определения undo.php:187
static Add($params=array())
Определения undo.php:9
static ParseFile($filesrc, $limit=false)
Определения php_parser.php:651
$abs_path
Определения component_props2.php:76
$relPath
Определения component_props2.php:52
$arTemplate
Определения component_props.php:26
$f
Определения component_props.php:52
$filesrc
Определения component_props.php:53
$rsSiteTemplates
Определения file_edit.php:32
$filename
Определения file_edit.php:47
$DOC_ROOT
Определения file_edit.php:66
$new
Определения file_edit.php:48
$bVarsFromForm
Определения file_edit.php:44
$imgName
Определения file_edit.php:94
$arParsedPath
Определения file_edit.php:88
$isScriptExt
Определения file_edit.php:89
$bSessIDRefresh
Определения file_edit.php:45
$arPath
Определения file_edit.php:72
$bDisableEditor
Определения file_edit.php:16
$site_template
Определения file_edit.php:31
$template
Определения file_edit.php:49
$useEditor3
Определения file_edit.php:7
$addUrl
Определения file_edit.php:6
$NEW_ROW_CNT
Определения file_edit.php:86
$editor_name
Определения file_edit.php:46
$bFromComponent
Определения file_edit.php:8
else $bEdit
Определения file_edit_src.php:72
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
Определения file_new.php:759
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
bx_acc_lim_group_list limitGroupList[] multiple<?=$group[ 'ID']?> ID selected margin top
Определения file_new.php:657
$res
Определения filter_act.php:7
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$start
Определения get_search.php:9
$p
Определения group_list_element_edit.php:23
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
global $USER
Определения csv_new_run.php:40
$io
Определения csv_new_run.php:98
endif
Определения csv_new_setup.php:990
$l
Определения options.php:783
bitrix_sessid_post($varname='sessid', $returnInvocations=false)
Определения tools.php:4700
check_bitrix_sessid($varname='sessid')
Определения tools.php:4686
GetFileType($path)
Определения tools.php:3047
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения tools.php:3778
is_set($a, $k=false)
Определения tools.php:2133
GetMessage($name, $aReplace=null)
Определения tools.php:3397
GetFileNameWithoutExtension($path)
Определения tools.php:2986
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
<? endif;?> window document title
Определения prolog_main_admin.php:76
die
Определения quickway.php:367
$i
Определения factura.php:643
font style
Определения invoice.php:442
</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."%"
Определения waybill.php:936
$title
Определения pdf.php:123
$obJSPopup
Определения settings_admin_form.php:102
$n
Определения update_log.php:107
$url
Определения iframe.php:7
$site
Определения yandex_run.php:614