function BuildSceleton($display = true) { $width = isset($this->jsConfig['width']) && intval($this->jsConfig['width']) > 0 ? $this->jsConfig['width'] : "100%"; $height = isset($this->jsConfig['height']) && intval($this->jsConfig['height']) > 0 ? $this->jsConfig['height'] : "100%"; $widthUnit = strpos($width, "%") === false ? "px" : "%"; $heightUnit = strpos($height, "%") === false ? "px" : "%"; $width = intval($width); $height = intval($height); ?> <div class="bx-html-editor" id="bx-html-editor-<?php echo $this->id; ?> " style="width:<?php echo $width . $widthUnit; ?> ; height:<?php echo $height . $heightUnit; ?> ; <?php echo $display ? '' : 'display: none;'; ?> "> <div class="bxhtmled-toolbar-cnt" id="bx-html-editor-tlbr-cnt-<?php echo $this->id; ?> "> <div class="bxhtmled-toolbar" id="bx-html-editor-tlbr-<?php echo $this->id; ?> "></div> </div> <div class="bxhtmled-search-cnt" id="bx-html-editor-search-cnt-<?php echo $this->id; ?> " style="display: none;"></div> <div class="bxhtmled-area-cnt" id="bx-html-editor-area-cnt-<?php echo $this->id; ?> "> <div class="bxhtmled-iframe-cnt" id="bx-html-editor-iframe-cnt-<?php echo $this->id; ?> "></div> <div class="bxhtmled-textarea-cnt" id="bx-html-editor-ta-cnt-<?php echo $this->id; ?> "></div> <div class="bxhtmled-resizer-overlay" id="bx-html-editor-res-over-<?php echo $this->id; ?> "></div> <div id="bx-html-editor-split-resizer-<?php echo $this->id; ?> "></div> </div> <div class="bxhtmled-nav-cnt" id="bx-html-editor-nav-cnt-<?php echo $this->id; ?> " style="display: none;"></div> <div class="bxhtmled-taskbar-cnt bxhtmled-taskbar-hidden" id="bx-html-editor-tskbr-cnt-<?php echo $this->id; ?> "> <div class="bxhtmled-taskbar-top-cnt" id="bx-html-editor-tskbr-top-<?php echo $this->id; ?> "></div> <div class="bxhtmled-taskbar-resizer" id="bx-html-editor-tskbr-res-<?php echo $this->id; ?> "> <div class="bxhtmled-right-side-split-border"> <div data-bx-tsk-split-but="Y" class="bxhtmled-right-side-split-btn"></div> </div> </div> <div class="bxhtmled-taskbar-search-nothing" id="bxhed-tskbr-search-nothing-<?php echo $this->id; ?> "><?php echo GetMessage('HTMLED_SEARCH_NOTHING'); ?> </div> <div class="bxhtmled-taskbar-search-cont" id="bxhed-tskbr-search-cnt-<?php echo $this->id; ?> " data-bx-type="taskbar_search"> <div class="bxhtmled-search-alignment" id="bxhed-tskbr-search-ali-<?php echo $this->id; ?> "> <input type="text" class="bxhtmled-search-inp" id="bxhed-tskbr-search-inp-<?php echo $this->id; ?> " placeholder="<?php echo GetMessage('HTMLED_SEARCH_PLACEHOLDER'); ?> "/> </div> <div class="bxhtmled-search-cancel" data-bx-type="taskbar_search_cancel" title="<?php echo GetMessage('HTMLED_SEARCH_CANCEL'); ?> "></div> </div> </div> </div> <div style="display: none;"> <? CAdminFileDialog::ShowScript(Array ( "event" => "BxOpenFileBrowserWindFile".$this->id, "arResultDest" => Array("FUNCTION_NAME" => "OnFileDialogSelect".$this->id), "arPath" => Array("SITE" => SITE_ID), "select" => 'F', "operation" => 'O', "showUploadTab" => true, "showAddToMenuTab" => false, "fileFilter" => '', "allowAllFiles" => true, "SaveConfig" => true ) ); CAdminFileDialog::ShowScript(Array ( "event" => "BxOpenFileBrowserImgFile".$this->id, "arResultDest" => Array("FUNCTION_NAME" => "OnFileDialogImgSelect".$this->id), //"arPath" => Array("SITE" => $_GET["site"], "PATH" =>(strlen($str_FILENAME) > 0 ? GetDirPath($str_FILENAME) : '')), "select" => 'F', "operation" => 'O', "showUploadTab" => true, "showAddToMenuTab" => false, "fileFilter" => 'image', "allowAllFiles" => true, "SaveConfig" => true ) ); CMedialib::ShowBrowseButton( array( 'value' => '...', 'event' => "BxOpenFileBrowserImgFile".$this->id, 'button_id' => "bx-open-file-medialib-but-".$this->id, 'id' => "bx_open_file_medialib_button_".$this->id, 'MedialibConfig' => array( "event" => "BxOpenFileBrowserImgFileMl".$this->id, "arResultDest" => Array("FUNCTION_NAME" => "OnFileDialogImgSelect".$this->id), "types" => array('image') ) ) ); ?> </div> <? }
$res .= '<textarea name=\\\'' . $ID . '[]\\\' cols=\\\'' . $prop["COLS"] . '\\\'></textarea>'; } else { $res .= '<input type=\\\'text\\\' name=\\\'' . $ID . '[]\\\' size=\\\'' . $prop["COLS"] . '\\\'>'; } $res .= '\'">'; } else { if ($prop['ROWS'] > 1) { $res .= '<textarea name="' . $ID . '" cols=' . $prop["COLS"] . '>' . htmlspecialcharsbx($val) . '</textarea>'; } else { if ($prop["TYPE"] == 'FILE') { CAdminFileDialog::ShowScript(array("event" => "BX_FD_" . $ID, "arResultDest" => array("FUNCTION_NAME" => "BX_FD_ONRESULT_" . $ID), "arPath" => array(), "select" => isset($prop['FD_TARGET']) ? $prop['FD_TARGET'] : 'F', "operation" => 'O', "showUploadTab" => isset($prop['FD_UPLOAD']) && $prop['FD_UPLOAD'] && $prop['FD_TARGET'] == 'F', "showAddToMenuTab" => false, "fileFilter" => isset($prop['FD_EXT']) ? $prop['FD_EXT'] : '', "allowAllFiles" => true, "SaveConfig" => true)); $bML = isset($prop['FD_USE_MEDIALIB']) && $prop['FD_USE_MEDIALIB']; $res .= '<input id="__FD_PARAM_' . $ID . '" name="' . $ID . '" size=' . $prop["COLS"] . ' value="' . htmlspecialcharsbx($val) . '" type="text" ' . ($bML ? 'style="float:left;"' : '') . '>'; // Using medialib if ($bML) { $res .= "<div>" . CMedialib::ShowBrowseButton(array('mode' => $prop['FD_USE_ONLY_MEDIALIB'] ? 'medialib' : 'select', 'value' => '...', 'event' => "BX_FD_" . $ID, 'id' => "bx_fd_input_" . strtolower($ID), 'MedialibConfig' => array("event" => "bx_ml_event_" . $ID, "arResultDest" => array("FUNCTION_NAME" => "BX_FD_ONRESULT_" . $ID), "types" => is_array($prop['FD_MEDIALIB_TYPES']) ? $prop['FD_MEDIALIB_TYPES'] : false), 'bReturnResult' => true)) . "</div>"; } else { // Use old good file dialog $res .= '<input size=' . $prop["COLS"] . ' value="..." type="button" onclick="window.BX_FD_' . $ID . '();">'; } $res .= '<script> setTimeout(function(){ if (BX("bx_fd_input_' . strtolower($ID) . '")) BX("bx_fd_input_' . strtolower($ID) . '").onclick = window.BX_FD_' . $ID . '; }, 200); window.BX_FD_ONRESULT_' . $ID . ' = function(filename, filepath) { var oInput = BX("__FD_PARAM_' . $ID . '"); if (typeof filename == "object") oInput.value = filename.src;
function BaseGetEditFormHTML($set, $val, $name, $controlMode = false) { global $APPLICATION; $id = str_replace(array("[", "]", ":"), "_", $name); $path = $val["path"]; if (intVal($val['width']) <= 0) { $val['width'] = 400; } if (intVal($val['height']) <= 0) { $val['height'] = 300; } ob_start(); ?> <div style="padding: 5px;"> <style> table.bx-video-prop-tbl{border-collapse: collapse! important; border: 1px solid #E0E4F1;} table.bx-video-prop-tbl td{padding: 3px 5px! important; border-bottom: 1px dotted #BABABA !important;} table.bx-video-prop-tbl tr.bx-prop-main-title td{background: #E0E4F1! important; color: #525355! important; font-weight: bold! important; text-align: center! important; border-bottom-width: 0px !important; padding: 5px! important;} table.bx-video-prop-tbl tr.bx-prop-sub-title td{background: #E2E1E0! important; color: #525355! important; font-weight: bold! important; text-align: left! important; border-bottom-width: 0px !important;} table.bx-video-prop-tbl td.bx-pr-title{text-align: right! important; vertical-align: top! important; padding-top: 8px !important;} div.bx-path-div a{float: right !important;} div.bx-path-div a.bx-leave{display: none;} div.bx-path-div-changed a.bx-leave{display: block !important;} div.bx-path-div-changed a.bx-change{display: none !important;} div.bx-path-div input.bx-path{color: #525355 !important;} div.bx-path-div-changed input.bx-path{text-decoration: line-through !important;} table.bx-video-prop-tbl img.spacer{display:block;float:left;height:1px;margin-top:-2px;width:220px;} </style> <table class="bx-video-prop-tbl"> <tr class="bx-prop-main-title"><td colSpan="2"><?php echo GetMessage('IBLOCK_PROP_VIDEO_PARAMS_TITLE'); ?> </td></tr> <?php if ($controlMode != "iblock_element_admin") { ?> <?php if (strlen($path) > 0) { ?> <tr class="heading"><td colSpan="2"><?php echo GetMessage('IBLOCK_PROP_VIDEO_PARAMS_TITLE_VIEW'); ?> </td></tr> <tr> <td colSpan="2" style="text-align: center;"> <?php $APPLICATION->IncludeComponent("bitrix:player", "", array("PLAYER_TYPE" => "auto", "PATH" => $path, "WIDTH" => $val['width'], "HEIGHT" => $val['height'], "FILE_TITLE" => $val['title'], "FILE_DURATION" => intVal($val['duration']), "FILE_AUTHOR" => $val['author'], "FILE_DATE" => $val['date'], "FILE_DESCRIPTION" => $val['desc'], "SKIN_PATH" => CVideoProperty::GetSkinPath(), "SKIN" => $set["SKIN"], "CONTROLBAR" => $set["CONTROLBAR"], "WMODE" => $set["WMODE_FLV"], "WMODE_WMV" => $set["WMODE_WMV"], "SHOW_CONTROLS" => $set["CONTROLBAR"] != 'none' ? "Y" : "N", "CONTROLS_BGCOLOR" => $set["CONTROLS_BGCOLOR"], "CONTROLS_COLOR" => $set["CONTROLS_COLOR"], "CONTROLS_OVER_COLOR" => $set["CONTROLS_OVER_COLOR"], "SCREEN_COLOR" => $set["SCREEN_COLOR"], "AUTOSTART" => $set["AUTOSTART"], "VOLUME" => $set["VOLUME"], "ADDITIONAL_FLASHVARS" => $set["FLASHVARS"], "BUFFER_LENGTH" => $set["BUFFER_LENGTH"], "ADDITIONAL_WMVVARS" => $set["SILVERVARS"], "ALLOW_SWF" => "N", "LOGO_POSITION" => "none"), false, array('HIDE_ICONS' => 'Y')); ?> </td> </tr> <?php } ?> <tr><td class="bx-pr-title" style="width: 300px;"></td><td style="width: 240px;"></td></tr> <tr class="heading"><td colSpan="2"><?php echo GetMessage('IBLOCK_PROP_VIDEO_PARAMS_TITLE_MAIN'); ?> </td></tr> <?php if (strlen($path) > 0) { ?> <tr> <td class="bx-pr-title"><?php echo GetMessage('IBLOCK_PROP_VIDEO_FILE'); ?> :</td> <td> <div id="bx_video_path_div_<?php echo $id; ?> " class="bx-path-div"> <input type="hidden" value="<?php echo $path; ?> " name= "<?php echo $name; ?> [CUR_PATH]" /> <input id="bx_video_b_new_file_<?php echo $id; ?> " type="hidden" value="N" name= "<?php echo $name; ?> [B_NEW_FILE]" /> <input class="bx-path" readonly="readonly" value="<?php echo htmlspecialcharsex($path); ?> " size="30" /> <br /> <a href="javascript: void(0)" onclick="return ChangeOrLeaveFile<?php echo $id; ?> (true);" class="bx-change" id="bx-change"><?php echo GetMessage('IBLOCK_PROP_VIDEO_FILE_CHANGE'); ?> </a> <a href="javascript: void(0)" onclick="return ChangeOrLeaveFile<?php echo $id; ?> (false);" class="bx-leave"><?php echo GetMessage('IBLOCK_PROP_VIDEO_FILE_LEAVE'); ?> </a> </div> </td> </tr> <?php if (CVideoProperty::CheckFileInUploadDir($path)) { ?> <tr id="bx_video_del_row_<?php echo $id; ?> " style="display: none;"> <td class="bx-pr-title"></td> <td> <input type="checkbox" value="Y" id="bx_video_del_<?php echo $id; ?> " checked="checked" name= "<?php echo $name; ?> [DEL_CUR_FILE]" /><label for="bx_video_del_<?php echo $id; ?> "><?php echo GetMessage('IBLOCK_PROP_VIDEO_DEL_FILE'); ?> </label> </td> </tr> <?php } ?> <?php } ?> <tr id="bx_video_new_path_row_<?php echo $id; ?> " <?php if (strlen($path) > 0) { echo 'style="display: none;"'; } ?> > <td class="bx-pr-title" style="width: 300px;"><?php echo GetMessage(strlen($path) > 0 ? 'IBLOCK_PROP_VIDEO_PATH_NEW' : 'IBLOCK_PROP_VIDEO_PATH'); ?> :</td> <td style="width: 240px;"> <img src="/bitrix/images/1.gif" class="spacer" /> <div id="bx_video_path_cont1_<?php echo $id; ?> " style="display: none;"> <input type="text" size="30" value="" id="bx_video_path_<?php echo $id; ?> " style="float:left;" name= "<?php echo $name; ?> [PATH]" /> <?php CAdminFileDialog::ShowScript(array("event" => "OpenFileBrowser_" . $id, "arResultDest" => array("FUNCTION_NAME" => "SetVideoPath" . $id), "arPath" => array(), "select" => 'F', "operation" => 'O', "showUploadTab" => false, "showAddToMenuTab" => false, "fileFilter" => 'flv,mp4,mp3,wmv', "allowAllFiles" => true, "SaveConfig" => true)); CMedialib::ShowBrowseButton(array("id" => 'OpenFileBrowser_but_' . $id, "event" => "OpenFileBrowser_" . $id, 'MedialibConfig' => array("event" => "OpenFileBrowser_ml_" . $id, "arResultDest" => array("FUNCTION_NAME" => "SetVideoPath" . $id)))); ?> <br /> <a href="javascript: void(0)" onclick="return DisplayCont('bx_video_path_cont2_<?php echo $id; ?> ', 'bx_video_path_cont1_<?php echo $id; ?> ');" style="float: right;"><?php echo GetMessage('IBLOCK_PROP_VIDEO_PATH_FROM_PC'); ?> </a> </div> <div id="bx_video_path_cont2_<?php echo $id; ?> "> <input type="file" value="" id="bx_video_path_<?php echo $id; ?> " name= "<?php echo $name; ?> [FILE]" /> <br /> <a href="javascript: void(0)" onclick="return DisplayCont('bx_video_path_cont1_<?php echo $id; ?> ', 'bx_video_path_cont2_<?php echo $id; ?> ');" style="float: right;"><?php echo GetMessage('IBLOCK_PROP_VIDEO_PATH_FROM_FD'); ?> </a> </div> </td> </tr> <?php } else { ?> <tr> <td class="bx-pr-title"><?php echo GetMessage('IBLOCK_PROP_VIDEO_FILE'); ?> :</td> <td> <div id="bx_video_path_div_<?php echo $id; ?> " class="bx-path-div"> <input type="text" size="25" value="<?php echo htmlspecialcharsex($path); ?> " size="30" name="<?php echo $name; ?> [PATH]"/> </div> </td> </tr> <?php } ?> <tr> <td class="bx-pr-title"><?php echo GetMessage('IBLOCK_PROP_VIDEO_SIZE'); ?> :</td> <td> <input id="bx_video_width_<?php echo $id; ?> " type="text" size="10" style="width: 70px;" value="<?php echo $val['width']; ?> " name= "<?php echo $name; ?> [WIDTH]" /> x <input id="bx_video_height_<?php echo $id; ?> " type="text" size="10" style="width: 70px;" value="<?php echo $val['height']; ?> " name= "<?php echo $name; ?> [HEIGHT]" /> </td> </tr> <tr class="heading"><td colSpan="2"><?php echo GetMessage('IBLOCK_PROP_VIDEO_PARAMS_TITLE_INFO'); ?> </td></tr> <tr> <td class="bx-pr-title"><?php echo GetMessage('IBLOCK_PROP_VIDEO_TITLE'); ?> :</td> <td><input id="bx_video_title_<?php echo $id; ?> " type="text" size="30" value="<?php echo $val['title']; ?> " name="<?php echo $name; ?> [TITLE]" /></td> </tr> <tr> <td class="bx-pr-title"><?php echo GetMessage('IBLOCK_PROP_VIDEO_DURATION'); ?> :</td> <td><input id="bx_video_duration_<?php echo $id; ?> " type="text" size="30" value="<?php echo $val['duration']; ?> " name="<?php echo $name; ?> [DURATION]"/></td> </tr> <tr> <td class="bx-pr-title"><?php echo GetMessage('IBLOCK_PROP_VIDEO_AUTHOR'); ?> :</td> <td><input id="bx_video_author_<?php echo $id; ?> " type="text" size="30" value="<?php echo $val['author']; ?> " name="<?php echo $name; ?> [AUTHOR]"/></td> </tr> <tr> <td class="bx-pr-title"><?php echo GetMessage('IBLOCK_PROP_VIDEO_DATE'); ?> :</td> <td><input id="bx_video_date_<?php echo $id; ?> " type="text" size="30" value="<?php echo $val['date']; ?> " name="<?php echo $name; ?> [DATE]" /></td> </tr> <tr> <td class="bx-pr-title"><?php echo GetMessage('IBLOCK_PROP_VIDEO_DESC'); ?> :</td> <td><input id="bx_video_desc_<?php echo $id; ?> " type="text" size="30" value="<?php echo $val['desc']; ?> " name="<?php echo $name; ?> [DESC]"/></td> </tr> </table> <script> function DisplayCont(id1, id2) { var el1 = document.getElementById(id1), el2 = document.getElementById(id2); if (el1 && el2) { el1.style.display = "block"; el2.style.display = "none"; } return false; } function SetVideoPath<?php echo $id; ?> (filename, path, site) { var url, srcInput = document.getElementById("bx_video_path_<?php echo $id; ?> "); if (typeof filename == 'object') // Using medialibrary { url = filename.src; document.getElementById("bx_video_title_<?php echo $id; ?> ").value = filename.name || ''; document.getElementById("bx_video_desc_<?php echo $id; ?> ").value = filename.description || ''; } else // Using file dialog { url = (path == '/' ? '' : path) + '/'+filename; } srcInput.value = url; if(srcInput.onchange) srcInput.onchange(); srcInput.focus(); srcInput.select(); } function ChangeOrLeaveFile<?php echo $id; ?> (bChange) { var pDiv = document.getElementById("bx_video_path_div_<?php echo $id; ?> "), pDelRow = document.getElementById("bx_video_del_row_<?php echo $id; ?> "), pBNewFile = document.getElementById("bx_video_b_new_file_<?php echo $id; ?> "), pNewFileRow = document.getElementById("bx_video_new_path_row_<?php echo $id; ?> "), _display = jsUtils.IsIE() ? "inline" : "table-row"; if (pBNewFile) pBNewFile.value = bChange ? "Y" : "N"; if (pDelRow) pDelRow.style.display = bChange ? _display : 'none'; if (pNewFileRow) pNewFileRow.style.display = bChange ? _display : 'none'; pDiv.className = bChange ? "bx-path-div bx-path-div-changed" : "bx-path-div"; return false; } </script> </div> <?php $s = ob_get_contents(); ob_end_clean(); return $s; }
function ShowFileDialogsScripts() { global $arFD; $l = count($arFD); if ($l < 1) { return; } for ($i = 0; $i < $l; $i++) { if ($arFD[$i]['USE_ML']) { $MLRes = CMedialib::ShowBrowseButton(array('mode' => $arFD[$i]['ONLY_ML'] ? 'medialib' : 'select', 'value' => '...', 'event' => "BX_FD_" . $arFD[$i]['NAME'], 'id' => "bx_fd_input_" . strtolower($arFD[$i]['NAME']), 'MedialibConfig' => array("event" => "bx_ml_event_" . $arFD[$i]['NAME'], "arResultDest" => array("FUNCTION_NAME" => "BX_FD_ONRESULT_" . $arFD[$i]['NAME']), "types" => $arFD[$i]['ML_TYPES']), 'bReturnResult' => true)); ?> <script>window._bxMlBrowseButton_<?php echo strtolower($arFD[$i]['NAME']); ?> = '<?php echo CUtil::JSEscape($MLRes); ?> ';</script> <?php } CAdminFileDialog::ShowScript(array("event" => "BX_FD_" . $arFD[$i]['NAME'], "arResultDest" => array("FUNCTION_NAME" => "BX_FD_ONRESULT_" . $arFD[$i]['NAME']), "arPath" => array(), "select" => $arFD[$i]['TARGET'], "operation" => 'O', "showUploadTab" => $arFD[$i]['UPLOAD'], "showAddToMenuTab" => false, "fileFilter" => $arFD[$i]['EXT'], "allowAllFiles" => true, "SaveConfig" => true)); } }
public static function RequestAction($action = '') { global $USER, $APPLICATION; $result = array(); switch ($action) { case "load_site_template": if (!$USER->CanDoOperation('fileman_view_file_structure')) { break; } $siteTemplate = $_REQUEST['site_template']; $siteId = isset($_REQUEST['site_id']) ? $_REQUEST['site_id'] : SITE_ID; $result = self::GetSiteTemplateParams($siteTemplate, $siteId); break; case "load_components_list": if (!$USER->CanDoOperation('fileman_view_file_structure')) { break; } $siteTemplate = $_REQUEST['site_template']; $componentFilter = isset($_REQUEST['componentFilter']) ? $_REQUEST['componentFilter'] : false; $result = self::GetComponents($siteTemplate, true, $componentFilter); break; case "video_oembed": $result = self::GetVideoOembed($_REQUEST['video_source']); break; // Snippets actions // Snippets actions case "load_snippets_list": if (!$USER->CanDoOperation('fileman_view_file_structure')) { break; } $template = $_REQUEST['site_template']; $result = array('result' => true, 'snippets' => array($template => self::GetSnippets($template, $_REQUEST['clear_cache'] == 'Y'))); break; case "edit_snippet": if (!$USER->CanDoOperation('fileman_view_file_structure')) { break; } CUtil::JSPostUnEscape(); $template = $_REQUEST['site_template']; // Update if ($_REQUEST['current_path']) { $result = CSnippets::Update(array('template' => $template, 'path' => $_REQUEST['path'], 'code' => $_REQUEST['code'], 'title' => $_REQUEST['name'], 'current_path' => $_REQUEST['current_path'], 'description' => $_REQUEST['description'])); } else { $result = CSnippets::Add(array('template' => $template, 'path' => $_REQUEST['path'], 'code' => $_REQUEST['code'], 'title' => $_REQUEST['name'], 'description' => $_REQUEST['description'])); } if ($result && $result['result']) { $result['snippets'] = array($template => self::GetSnippets($template)); } break; case "remove_snippet": if (!$USER->CanDoOperation('fileman_view_file_structure')) { break; } CUtil::JSPostUnEscape(); $template = $_REQUEST['site_template']; $res = CSnippets::Remove(array('template' => $template, 'path' => $_REQUEST['path'])); if ($res) { $result = array('result' => true, 'snippets' => array($template => self::GetSnippets($template))); } else { $result = array('result' => false); } break; case "snippet_add_category": if (!$USER->CanDoOperation('fileman_view_file_structure')) { break; } CUtil::JSPostUnEscape(); $template = $_REQUEST['site_template']; $res = CSnippets::CreateCategory(array('template' => $template, 'name' => $_REQUEST['category_name'], 'parent' => $_REQUEST['category_parent'])); if ($res) { $result = array('result' => true, 'snippets' => array($template => self::GetSnippets($template))); } else { $result = array('result' => false); } break; case "snippet_remove_category": if (!$USER->CanDoOperation('fileman_view_file_structure')) { break; } CUtil::JSPostUnEscape(); $template = $_REQUEST['site_template']; $res = CSnippets::RemoveCategory(array('template' => $template, 'path' => $_REQUEST['category_path'])); if ($res) { $result = array('result' => true, 'snippets' => array($template => self::GetSnippets($template))); } else { $result = array('result' => false); } break; case "snippet_rename_category": if (!$USER->CanDoOperation('fileman_view_file_structure')) { break; } CUtil::JSPostUnEscape(); $template = $_REQUEST['site_template']; $res = CSnippets::RenameCategory(array('template' => $template, 'path' => $_REQUEST['category_path'], 'new_name' => $_REQUEST['category_new_name'])); if ($res) { $result = array('result' => true, 'snippets' => array($template => self::GetSnippets($template))); } else { $result = array('result' => false); } break; // END *** Snippets actions // spellcheck // END *** Snippets actions // spellcheck case "spellcheck_words": case "spellcheck_add_word": CUtil::JSPostUnEscape(); $spellChecker = new CSpellchecker(array("lang" => $_REQUEST['lang'], "skip_length" => 2, "use_pspell" => $_REQUEST['use_pspell'] !== "N", "use_custom_spell" => $_REQUEST['use_custom_spell'] !== "N", "mode" => PSPELL_FAST)); if ($action == "spellcheck_words") { $words = isset($_REQUEST['words']) && is_array($_REQUEST['words']) ? $_REQUEST['words'] : array(); $result = array('words' => $spellChecker->checkWords($words)); } else { $word = CFileMan::SecurePathVar($_REQUEST['word']); $spellChecker->addWord($word); } break; // END *** spellcheck // END *** spellcheck case "load_file_dialogs": $editorId = $_REQUEST['editor_id']; $editorId = preg_replace("/[^a-zA-Z0-9_-]/is", "_", $editorId); CAdminFileDialog::ShowScript(array("event" => "BxOpenFileBrowserWindFile" . $editorId, "arResultDest" => array("FUNCTION_NAME" => "OnFileDialogSelect" . $editorId), "arPath" => array("SITE" => SITE_ID), "select" => 'F', "operation" => 'O', "showUploadTab" => true, "showAddToMenuTab" => false, "fileFilter" => 'image', "allowAllFiles" => true, "SaveConfig" => true)); CMedialib::ShowBrowseButton(array('value' => '...', 'event' => "BxOpenFileBrowserWindFile" . $editorId, 'button_id' => "bx-open-file-link-medialib-but-" . $editorId, 'id' => "bx_open_file_link_medialib_button_" . $editorId, 'MedialibConfig' => array("event" => "BxOpenFileBrowserFileMl" . $editorId, "arResultDest" => array("FUNCTION_NAME" => "OnFileDialogSelect" . $editorId)), 'useMLDefault' => false)); CMedialib::ShowBrowseButton(array('value' => '...', 'event' => "BxOpenFileBrowserWindFile" . $editorId, 'button_id' => "bx-open-file-medialib-but-" . $editorId, 'id' => "bx_open_file_medialib_button_" . $editorId, 'MedialibConfig' => array("event" => "BxOpenFileBrowserImgFileMl" . $editorId, "arResultDest" => array("FUNCTION_NAME" => "OnFileDialogImgSelect" . $editorId), "types" => array('image')))); $result = array('result' => true); break; } self::ShowResponse(intVal($_REQUEST['reqId']), $result); }
CAdminFileDialog::ShowScript(array("event" => "OpenFileBrowserWindImage", "arResultDest" => array("FUNCTION_NAME" => "SetUrl"), "arPath" => array("SITE" => $_GET["site"], "PATH" => strlen($str_FILENAME) > 0 ? GetDirPath($str_FILENAME) : ''), "select" => 'F', "operation" => 'O', "showUploadTab" => true, "showAddToMenuTab" => false, "fileFilter" => 'image', "allowAllFiles" => true, "SaveConfig" => true)); ?> <?php ob_start(); ?> <table class="bx-image-dialog-tbl"> <tr> <td class="bx-par-title"><label for="bx_src"><?php echo GetMessage("FILEMAN_ED_IMG_PATH"); ?> </label></td> <td class="bx-par-val"> <input type="text" size="25" value="" id="bx_src" style="float: left;" /> <?php CMedialib::ShowBrowseButton(array('value' => '...', 'event' => 'OpenFileBrowserWindImage', 'id' => 'OpenFileBrowserWindImage_button', 'MedialibConfig' => array("arResultDest" => array("FUNCTION_NAME" => "SetUrl"), "types" => array('image')))); ?> </td> </tr> <tr> <td class="bx-par-title"><label for="bx_img_title"><?php echo GetMessage("FILEMAN_ED_IMG_TITLE"); ?> </label></td> <td class="bx-par-val"><input type="text" size="30" value="" id="bx_img_title" /></td> </tr> <tr> <td class="bx-par-title"><label for="bx_width"><?php echo GetMessage("FILEMAN_SIZES"); ?> :</label></td>
public static function DisplayFileDialogsScripts() { for($i = 0, $l = count(self::$fileDialogs); $i < $l; $i++) { $fd = self::$fileDialogs[$i]; if ($fd['USE_ML']) { $MLRes = CMedialib::ShowBrowseButton( array( 'mode' => $fd['ONLY_ML'] ? 'medialib' : 'select', 'value' => '...', 'event' => "BX_FD_".$fd['NAME'], 'id' => "bx_fd_input_".strtolower($fd['NAME']), 'MedialibConfig' => array( "event" => "bx_ml_event_".$fd['NAME'], "arResultDest" => Array("FUNCTION_NAME" => "BX_FD_ONRESULT_".$fd['NAME']), "types" => $fd['ML_TYPES'] ), 'bReturnResult' => true ) ); ?><script>window._bxMlBrowseButton_<?php echo strtolower($fd['NAME']); ?> = '<?php echo CUtil::JSEscape($MLRes); ?> ';</script><? } CAdminFileDialog::ShowScript(Array ( "event" => "BX_FD_".$fd['NAME'], "arResultDest" => Array("FUNCTION_NAME" => "BX_FD_ONRESULT_".$fd['NAME']), "arPath" => Array(), "select" => $fd['TARGET'], // F - file only, D - folder only, DF - files & dirs "operation" => 'O', "showUploadTab" => $fd['UPLOAD'], "showAddToMenuTab" => false, "fileFilter" => $fd['EXT'], "allowAllFiles" => true, "SaveConfig" => true )); } }