function __CrmFieldMultiEditRenderItem($item, $mnemonic, $typeID, $referenceData, $editorID) { $itemID = isset($item['ID']) ? $item['ID'] : ''; $itemVal = isset($item['VALUE']) ? $item['VALUE'] : ''; ?> <div class="bx-crm-edit-fm-item"> <input type="text" class="bx-crm-edit-input" name="<?php echo htmlspecialcharsbx($mnemonic); ?> [<?php echo htmlspecialcharsbx($typeID); ?> ][<?php echo htmlspecialcharsbx($itemID); ?> ][VALUE]" value="<?php echo htmlspecialcharsbx($itemVal); ?> "><?php echo SelectBoxFromArray(CUtil::JSEscape($mnemonic) . '[' . htmlspecialcharsbx($typeID) . '][' . htmlspecialcharsbx($itemID) . '][VALUE_TYPE]', $referenceData, isset($item['VALUE_TYPE']) ? $item['VALUE_TYPE'] : '', '', "class='bx-crm-edit-input bx-crm-edit-input-small'"); ?> <div class="delete-action" onclick="BX.CrmFieldMultiEditor.items['<?php echo CUtil::addslashes($editorID); ?> '].deleteItem('<?php echo CUtil::addslashes($itemID); ?> ');" title="<?php echo GetMessage('CRM_STATUS_LIST_DELETE'); ?> "></div> </div><?php }
function PageParams($bUrlEncode = true) { $amp = $bUrlEncode ? '&' : '&'; return 'component_name='.urlencode(CUtil::addslashes($_GET["component_name"])). $amp.'component_template='.urlencode(CUtil::addslashes($_GET["component_template"])). $amp.'template_id='.urlencode(CUtil::addslashes($_GET["template_id"])). $amp.'lang='.urlencode(CUtil::addslashes(LANGUAGE_ID)). $amp.'src_path='.urlencode(CUtil::addslashes($_GET["src_path"])). $amp.'src_line='.intval($_GET["src_line"]). $amp.'src_page='.urlencode(CUtil::addslashes($_GET["src_page"])). $amp.'src_site='.urlencode(CUtil::addslashes($_GET["src_site"])); }
if (<?php echo intVal($GLOBALS["USER"]->GetId()); ?> > 0) { var TID = CPHttpRequest.InitThread(); CPHttpRequest.SetAction(TID, function(data){window.location.reload(true);}) CPHttpRequest.Send(TID, '/bitrix/components/bitrix/photogallery.detail.list/user_settings.php', {"picture_sight":obj.value, "sessid":'<?php echo bitrix_sessid(); ?> '}); } else { jsUtils.Redirect([], '<?php echo CUtil::addslashes($GLOBALS["APPLICATION"]->GetCurPageParam("PICTURES_SIGHT=#pictures_sight#", array("PICTURES_SIGHT", "sessid"), false)); ?> '.replace('#pictures_sight#', obj.value)); } } function HideDescription(id) { if (document.getElementById('item_' + id)) document.getElementById('item_' + id).style.display = 'none'; } function ShowDescription(id) { if (document.getElementById('item_' + id)) document.getElementById('item_' + id).style.display = 'block'; } function SelectAll(oObj)
?> </td> </tr> <?php } ?> </table> </div> <?php } } if (substr($_REQUEST['backurl'], 0, 1) != "/") { $_REQUEST['backurl'] = "/" . $_REQUEST['backurl']; } ?> </div> <div class="bx-sonet-profile-edit-buttons"> <input type="submit" name="submit" value="<?php echo GetMessage('SOCNET_SUPE_TPL_SUBMIT'); ?> " /> <input type="button" name="cancel" value="<?php echo GetMessage('SOCNET_SUPE_TPL_CANCEL'); ?> " onclick="location.href = '<?php echo htmlspecialcharsbx(CUtil::addslashes($_REQUEST['backurl'] ? $_REQUEST['backurl'] : CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arParams["ID"])))); ?> '" /> </div> </div> </form>
<td><?echo GetMessage("user_sett_common_set")?></td> <td><input type="checkbox" name="default" value="Y"></td> </tr> <?endif;?> <? $tabControl->BeginNextTab(); ?> <tr> <td colspan="2"><a href="javascript:if(confirm('<?echo CUtil::addslashes(GetMessage("user_sett_del_pers_conf"))?>'))window.location='user_settings.php?action=clear&lang=<?echo LANG?>&<?echo freetrix_sessid_get()?>&tabControl_active_tab=edit2';"><?echo GetMessage("user_sett_del_pers1")?></a></td> </tr> <?if($USER->CanDoOperation('edit_other_settings')):?> <tr> <td colspan="2"><a href="javascript:if(confirm('<?echo CUtil::addslashes(GetMessage("user_sett_del_common_conf"))?>'))window.location='user_settings.php?action=clear_all&lang=<?echo LANG?>&<?echo freetrix_sessid_get()?>&tabControl_active_tab=edit2';"><?echo GetMessage("user_sett_del_common1")?></a></td> </tr> <tr> <td colspan="2"><a href="javascript:if(confirm('<?echo CUtil::addslashes(GetMessage("user_sett_del_user_conf"))?>'))window.location='user_settings.php?action=clear_all_user&lang=<?echo LANG?>&<?echo freetrix_sessid_get()?>&tabControl_active_tab=edit2';"><?echo GetMessage("user_sett_del_user1")?></a></td> </tr> <?endif;?> <? $tabControl->Buttons(); ?> <input<?if(!$editable) echo " disabled"?> type="submit" name="apply" value="<?echo GetMessage("admin_lib_edit_apply")?>" title="<?echo GetMessage("admin_lib_edit_apply_title")?>" class="adm-btn-save"> <? $tabControl->End(); $tabControl->ShowWarnings("form1", $message); ?> </form> <? require_once ($_SERVER["DOCUMENT_ROOT"].FX_ROOT."/modules/main/include/epilog_admin.php");
die; } //************************* Input params*************************************************************** //************************* BASE ********************************************************************** $arParams["FILE"] = is_array($arParams["FILE"]) ? $arParams["FILE"] : intVal($arParams["FILE"]); //************************* ADDITIONAL **************************************************************** $arParams["SHOW_MODE"] = in_array($arParams["SHOW_MODE"], array("LINK", "THUMB", "FULL", "RSS")) ? $arParams["SHOW_MODE"] : "FULL"; $arParams["MAX_FILE_SIZE"] = intVal($arParams["MAX_FILE_SIZE"] > 0 ? $arParams["MAX_FILE_SIZE"] : 100) * 1024 * 1024; //$arParams["SIZE"] user data in img tag <img width=... height=...> if (!is_array($arParams["MAX_SIZE"])) { $arParams["MAX_SIZE"] = ($arParams["WIDTH"] > 0 ? array("width" => $arParams["WIDTH"]) : array()) + ($arParams["HEIGHT"] > 0 ? array("height" => $arParams["HEIGHT"]) : array()); } //$arParams["HTML_SIZE"] html resize for image. This is helpful for disk space economy. $arParams["CONVERT"] = $arParams["CONVERT"] == "N" ? "N" : "Y"; $arParams["FAMILY"] = trim($arParams["FAMILY"]); $arParams["FAMILY"] = CUtil::addslashes(empty($arParams["FAMILY"]) ? "FORUM" : $arParams["FAMILY"]); $arParams["RETURN"] = $arParams["RETURN"] == "Y" || $arParams["RETURN"] == "ARRAY" ? $arParams["RETURN"] : "N"; //$arParams["SHOW_LINK"] = ($arParams["SHOW_LINK"] == "Y" ? "Y" : "N"); $arParams["ADDITIONAL_URL"] = htmlspecialcharsEx(trim($arParams["ADDITIONAL_URL"])); $arParams["SERVER_NAME"] = defined("SITE_SERVER_NAME") && strLen(SITE_SERVER_NAME) > 0 ? SITE_SERVER_NAME : COption::GetOptionString("main", "server_name"); $arParams["NAME_TEMPLATE"] = str_replace(array("#NOBR#", "#/NOBR#"), "", !!$arParams["NAME_TEMPLATE"] ? $arParams["NAME_TEMPLATE"] : CSite::GetDefaultNameFormat()); // *************************/Input params*************************************************************** // ************************* Default params************************************************************* $arResult["FILE"] = $arParams["FILE"]; if (!is_array($arParams["FILE"]) && intVal($arParams["FILE"]) > 0) { $arResult["FILE"] = CFile::GetFileArray($arParams["FILE"]); } $arResult["FILE"]["~SRC"] = $arResult["FILE"]["SRC"]; if (intVal($arResult["FILE"]["ID"]) > 0) { $arResult["FILE"]["SRC"] = "/bitrix/components/bitrix/forum.interface/show_file.php?fid=" . htmlspecialcharsbx($arResult["FILE"]["ID"]) . (!empty($arParams["ADDITIONAL_URL"]) ? "&" . $arParams["ADDITIONAL_URL"] : ""); }
echo GetMessage("MAIN_OPT_SAVE_TITLE"); ?> "> <?endif?> <input type="submit" name="Apply" value="<?php echo GetMessage("MAIN_OPT_APPLY"); ?> " title="<?php echo GetMessage("MAIN_OPT_APPLY_TITLE"); ?> "> <?if($_REQUEST["back_url_settings"] <> ''):?> <input type="button" name="Cancel" value="<?php echo GetMessage("MAIN_OPT_CANCEL"); ?> " title="<?php echo GetMessage("MAIN_OPT_CANCEL_TITLE"); ?> " onclick="window.location='<?echo htmlspecialcharsbx(CUtil::addslashes($_REQUEST["back_url_settings"]))?>'"> <input type="hidden" name="back_url_settings" value="<?php echo htmlspecialcharsbx($_REQUEST["back_url_settings"]); ?> "> <?endif?> <input type="submit" name="RestoreDefaults" title="<?echo GetMessage("MAIN_HINT_RESTORE_DEFAULTS")?>" onclick="return confirm('<?echo AddSlashes(GetMessage("MAIN_HINT_RESTORE_DEFAULTS_WARNING"))?>')" value="<?echo GetMessage("MAIN_RESTORE_DEFAULTS")?>"> <?php echo bitrix_sessid_post(); ?> <?$tabControl->End();?> </form>
function GetPanelHtml() { global $USER, $APPLICATION, $adminPage; if ($APPLICATION->ShowPanel === false || !$USER->IsAuthorized() && $APPLICATION->ShowPanel !== true) { return ""; } CTopPanel::InitPanelIcons(); $arPanelButtons =& $APPLICATION->arPanelButtons; $bShowPanel = false; foreach ($arPanelButtons as $arValue) { if (trim($arValue["HREF"]) != "" || is_array($arValue["MENU"]) && !empty($arValue["MENU"])) { //we have at least one button to show $bShowPanel = true; break; } } if ($bShowPanel == false) { $bShowPanel = self::IsShownForUser(); } if ($bShowPanel == false && $APPLICATION->ShowPanel !== true) { return ""; } $APPLICATION->PanelShowed = true; if (isset($_GET["back_url_admin"]) && $_GET["back_url_admin"] != "" && strpos($_GET["back_url_admin"], "/") === 0) { $_SESSION["BACK_URL_ADMIN"] = $_GET["back_url_admin"]; } $aUserOpt = CUserOptions::GetOption("admin_panel", "settings"); $aUserOptGlobal = CUserOptions::GetOption("global", "settings"); $toggleModeSet = false; if (isset($_GET["freetrix_include_areas"]) && $_GET["freetrix_include_areas"] != "") { $APPLICATION->SetShowIncludeAreas($_GET["freetrix_include_areas"] == "Y"); $toggleModeSet = true; } $params = DeleteParam(array("freetrix_include_areas", "freetrix_show_mode", "back_url_admin")); $href = $APPLICATION->GetCurPage(); $hrefEnc = htmlspecialcharsbx($href); $toggleModeDynamic = $aUserOptGlobal['panel_dynamic_mode'] == 'Y'; $toggleMode = $toggleModeDynamic && !$toggleModeSet ? $aUserOpt['edit'] == 'on' : $APPLICATION->GetShowIncludeAreas() == 'Y'; //Save if changed $old_edit = $aUserOpt['edit']; $aUserOpt['edit'] = $toggleMode ? 'on' : 'off'; if ($old_edit !== $aUserOpt['edit']) { CUserOptions::SetOption('admin_panel', 'settings', $aUserOpt); } $toggleModeLink = $hrefEnc . '?freetrix_include_areas=' . ($toggleMode ? 'N' : 'Y') . ($params != "" ? "&" . htmlspecialcharsbx($params) : ""); $result = CTopPanel::ShowPanelScripts(true); $result .= ' <!--[if lte IE 7]> <style type="text/css">#bx-panel {display:none !important;}</style> <div id="bx-panel-error">' . GetMessage("top_panel_browser") . '</div><![endif]--> <script type="text/javascript">BX.admin.dynamic_mode=' . ($toggleModeDynamic ? 'true' : 'false') . '; BX.admin.dynamic_mode_show_borders = ' . ($toggleMode ? 'true' : 'false') . ';</script> <div style="display:none; overflow:hidden;" id="bx-panel-back"></div> <div id="bx-panel"' . ($aUserOpt["collapsed"] == "on" ? ' class="bx-panel-folded"' : '') . '> <div id="bx-panel-top"> <div id="bx-panel-top-gutter"></div> <div id="bx-panel-tabs"> '; $result .= ' <a id="bx-panel-menu" href="" ' . CTopPanel::AddAttrHint(GetMessage('top_panel_start_menu_tooltip_title'), GetMessage('top_panel_start_menu_tooltip')) . '><span id="bx-panel-menu-icon"></span><span id="bx-panel-menu-text">' . GetMessage("top_panel_menu") . '</span></a><a id="bx-panel-view-tab"><span>' . GetMessage("top_panel_site") . '</span></a><a id="bx-panel-admin-tab" href="' . (isset($_SESSION["BACK_URL_ADMIN"]) && $_SESSION["BACK_URL_ADMIN"] != "" ? htmlspecialcharsbx($_SESSION["BACK_URL_ADMIN"]) . (strpos($_SESSION["BACK_URL_ADMIN"], "?") !== false ? "&" : "?") : '/freetrix/admin/index.php?lang=' . LANGUAGE_ID . '&') . 'back_url_pub=' . urlencode($href . ($params != "" ? "?" . $params : "")) . '"><span>' . GetMessage("top_panel_admin") . '</span></a>'; $back_url = CUtil::JSUrlEscape(CUtil::addslashes($href . ($params != "" ? "?" . $params : ""))); $arStartMenuParams = array('DIV' => 'bx-panel-menu', 'ACTIVE_CLASS' => 'bx-pressed', 'MENU_URL' => '/freetrix/admin/get_start_menu.php?lang=' . LANGUAGE_ID . '&back_url_pub=' . urlencode($back_url) . '&' . freetrix_sessid_get(), 'MENU_PRELOAD' => $aUserOptGlobal["start_menu_preload"] == 'Y'); $result .= '<script type="text/javascript">BX.message({MENU_ENABLE_TOOLTIP: ' . ($aUserOptGlobal['start_menu_title'] != 'N' ? 'true' : 'false') . '}); new BX.COpener(' . CUtil::PhpToJsObject($arStartMenuParams) . ');</script>'; $hkInstance = CHotKeys::getInstance(); $Execs = $hkInstance->GetCodeByClassName("top_panel_menu", GetMessage("top_panel_menu")); $result .= $hkInstance->PrintJSExecs($Execs); $Execs = $hkInstance->GetCodeByClassName("top_panel_admin", GetMessage("top_panel_admin")); $result .= $hkInstance->PrintJSExecs($Execs); if ($USER->CanDoOperation("cache_control")) { $result .= '<a id="bx-panel-clear-cache" href="" onclick="BX.clearCache(); return false;"><span id="bx-panel-clear-cache-icon"></span><span id="bx-panel-clear-cache-text">' . GetMessage("top_panel_cache_new_tooltip_title") . '</span></a>'; } $result .= ' </div> <div id="bx-panel-userinfo"> '; $bCanProfile = $USER->CanDoOperation('view_own_profile') || $USER->CanDoOperation('edit_own_profile'); $userName = CUser::FormatName(CSite::GetNameFormat(false), array("NAME" => $USER->GetFirstName(), "LAST_NAME" => $USER->GetLastName(), "SECOND_NAME" => $USER->GetSecondName(), "LOGIN" => $USER->GetLogin()), $bUseLogin = true, $bHTMLSpec = true); if ($bCanProfile) { $result .= '<a href="/freetrix/admin/user_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $USER->GetID() . '" id="bx-panel-user" ' . CTopPanel::AddAttrHint(GetMessage('top_panel_profile_tooltip')) . '><span id="bx-panel-user-icon"></span><span id="bx-panel-user-text">' . $userName . '</span></a>'; } else { $result .= '<a id="bx-panel-user"><span id="bx-panel-user-icon"></span><span id="bx-panel-user-text">' . $userName . '</span></a>'; } $result .= '<a href="' . $hrefEnc . '?logout=yes' . htmlspecialcharsbx(($s = DeleteParam(array("logout"))) == "" ? "" : "&" . $s) . '" id="bx-panel-logout" ' . CTopPanel::AddAttrHint(GetMessage('top_panel_logout_tooltip') . $hkInstance->GetTitle("bx-panel-logout", true)) . '>' . GetMessage("top_panel_logout") . '</a>'; $toggleCaptionOn = '<span id="bx-panel-toggle-caption-mode-on">' . GetMessage("top_panel_on") . '</span>'; $toggleCaptionOff = '<span id="bx-panel-toggle-caption-mode-off">' . GetMessage("top_panel_off") . '</span>'; $toggleCaptions = $toggleMode ? $toggleCaptionOn . $toggleCaptionOff : $toggleCaptionOff . $toggleCaptionOn; $toogle = '<a href="' . $toggleModeLink . '" id="bx-panel-toggle" class="bx-panel-toggle' . ($toggleMode ? '-on' : '-off') . '"' . ($toggleModeDynamic ? '' : ' ' . CTopPanel::AddAttrHint(GetMessage("top_panel_edit_mode_new_tooltip_title"), GetMessage('top_panel_toggle_tooltip') . $hkInstance->GetTitle("bx-panel-small-toggle", true))) . '><span id="bx-panel-switcher-gutter-left"></span><span id="bx-panel-toggle-indicator"><span id="bx-panel-toggle-icon"></span><span id="bx-panel-toggle-icon-overlay"></span></span><span class="bx-panel-break"></span><span id="bx-panel-toggle-caption">' . GetMessage("top_panel_edit_mode_new") . '</span><span class="bx-panel-break"></span><span id="bx-panel-toggle-caption-mode">' . $toggleCaptions . '</span><span id="bx-panel-switcher-gutter-right"></span></a>'; if ($aUserOpt["collapsed"] == "on") { $result .= $toogle; } $result .= '<a href="" id="bx-panel-expander" ' . CTopPanel::AddAttrHint(GetMessage("top_panel_expand_tooltip_title"), GetMessage("top_panel_expand_tooltip") . $hkInstance->GetTitle("bx-panel-expander", true)) . '><span id="bx-panel-expander-text">' . GetMessage("top_panel_expand") . '</span><span id="bx-panel-expander-arrow"></span></a>'; if ($hkInstance->IsActive()) { $result .= '<a id="bx-panel-hotkeys" href="javascript:void(0)" onclick="BXHotKeys.ShowSettings();" ' . CTopPanel::AddAttrHint(GetMessage("HK_PANEL_TITLE") . $hkInstance->GetTitle("bx-panel-hotkeys", true)) . '></a>'; } $result .= '<a href="javascript:void(0)" id="bx-panel-pin"' . ($aUserOpt['fix'] == 'on' ? ' class="bx-panel-pin-fixed"' : '') . ' ' . CTopPanel::AddAttrHint(GetMessage('top_panel_pin_tooltip')) . '></a>'; $Execs = $hkInstance->GetCodeByClassName("bx-panel-logout", GetMessage('top_panel_logout_tooltip')); $result .= $hkInstance->PrintJSExecs($Execs); $Execs = $hkInstance->GetCodeByClassName("bx-panel-small-toggle", GetMessage("top_panel_edit_mode_new_tooltip_title"), 'location.href="' . $href . '?freetrix_include_areas=' . ($toggleMode ? 'N' : 'Y') . ($params != "" ? "&" . $params : "") . '";'); $result .= $hkInstance->PrintJSExecs($Execs); $Execs = $hkInstance->GetCodeByClassName("bx-panel-expander", GetMessage("top_panel_expand_tooltip_title") . "/" . GetMessage("top_panel_collapse_tooltip_title")); $result .= $hkInstance->PrintJSExecs($Execs); $result .= ' </div> </div> '; /* BUTTONS */ $result .= '<div id="bx-panel-site-toolbar"><div id="bx-panel-buttons-gutter"></div><div id="bx-panel-switcher">'; if ($aUserOpt["collapsed"] != "on") { $result .= $toogle; } $result .= '<a href="" id="bx-panel-hider" ' . CTopPanel::AddAttrHint(GetMessage("top_panel_collapse_tooltip_title"), GetMessage("top_panel_collapse_tooltip") . $hkInstance->GetTitle("bx-panel-expander", true)) . '>' . GetMessage("top_panel_collapse") . '<span id="bx-panel-hider-arrow"></span></a>'; $result .= '</div><div id="bx-panel-buttons"><div id="bx-panel-buttons-inner">'; $main_sort = ""; $last_btn_type = ''; $last_btn_small_cnt = 0; $groupId = -1; $result .= '<span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">'; sortByColumn($arPanelButtons, array("MAIN_SORT" => SORT_ASC, "SORT" => SORT_ASC)); foreach ($arPanelButtons as $key => $arButton) { $result .= $hkInstance->PrintTPButton($arButton); if ($main_sort != $arButton["MAIN_SORT"] && $main_sort != "") { $result .= '</span><span class="bx-panel-button-separator"></span><span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">'; $last_btn_small_cnt = 0; } if (!isset($arButton['TYPE']) || $arButton['TYPE'] != 'BIG') { $arButton['TYPE'] = 'SMALL'; } //very old behaviour if (is_set($arButton, "SRC_0")) { $arButton["SRC"] = $arButton["SRC_0"]; } $arButton['HREF'] = isset($arButton['HREF']) ? trim($arButton['HREF']) : ''; $bHasAction = $arButton['HREF'] != ''; if (array_key_exists("RESORT_MENU", $arButton) && $arButton["RESORT_MENU"] === true && is_array($arButton['MENU']) && !empty($arButton['MENU'])) { sortByColumn($arButton['MENU'], "SORT", '', PHP_INT_MAX); } $bHasMenu = is_array($arButton['MENU']) && count($arButton['MENU']) > 0; if ($bHasMenu && !$bHasAction) { foreach ($arButton['MENU'] as $arItem) { if (isset($arItem['DEFAULT']) && $arItem['DEFAULT']) { $arButton['HREF'] = $arItem['HREF']; $bHasAction = true; } } } if ($last_btn_type != '' && $arButton['TYPE'] != $last_btn_type && $main_sort == $arButton["MAIN_SORT"]) { $result .= '</span><span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">'; $last_btn_small_cnt = 0; } if ($bHasAction && substr(strtolower($arButton['HREF']), 0, 11) == 'javascript:') { $arButton['ONCLICK'] = substr($arButton['HREF'], 11); $arButton['HREF'] = 'javascript:void(0)'; } if ($arButton['HINT']) { if (isset($arButton['HINT']['ID']) && $arButton['HINT']['ID']) { $hintOptions = CUtil::GetPopupOptions($arButton['HINT']['ID']); if ($hintOptions['display'] == 'off') { unset($arButton['HINT']); } } if ($arButton['HINT']) { unset($arButton['ALT']); } if ($bHasMenu && (!isset($arButton['HINT_MENU']) || !$arButton['HINT_MENU'])) { $arButton['HINT']['TARGET'] = 'parent'; } } $title = isset($arButton['ALT']) ? htmlspecialcharsbx($arButton['ALT']) : ''; $onClick = isset($arButton['ONCLICK']) ? htmlspecialcharsbx($arButton['ONCLICK']) : ''; $onClickJs = isset($arButton['ONCLICK']) ? CUtil::JSEscape($arButton['ONCLICK']) : ''; $hintMenu = isset($arButton['HINT_MENU']) ? CUtil::PhpToJsObject($arButton['HINT_MENU']) : ''; switch ($arButton['TYPE']) { case 'SMALL': if ($last_btn_small_cnt >= 3 && $main_sort == $arButton["MAIN_SORT"]) { $result .= '</span><span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">'; $last_btn_small_cnt = 0; } elseif ($last_btn_small_cnt > 0) { $result .= '<span class="bx-panel-break"></span>'; } $result .= '<span class="bx-panel-small-button"><span class="bx-panel-small-button-inner">'; $button_icon = '<span class="bx-panel-small-button-icon' . ($arButton['ICON'] ? ' ' . $arButton['ICON'] : '') . '"' . (isset($arButton['SRC']) && $arButton['SRC'] ? ' style="background: scroll transparent url(' . htmlspecialcharsbx($arButton['SRC']) . ') no-repeat center center !important;"' : '') . '></span>'; $button_text = '<span class="bx-panel-small-button-text">' . htmlspecialcharsbx($arButton['TEXT']) . '</span>'; $button_text_js = CUtil::JSEscape($arButton['TEXT']); if ($bHasAction) { $result .= '<a href="' . htmlspecialcharsbx($arButton['HREF']) . '" onclick="' . $onClick . ';BX.removeClass(this.parentNode.parentNode, \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-active\')" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . $hkInstance->GetTitle("bx_topmenu_btn_" . $key) . '"' : '"' . $hkInstance->GetTitle("bx_topmenu_btn_" . $key) . '"') . '>' . $button_icon . $button_text . '</a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'SMALL\', ACTIVE_CSS: \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-active\', HOVER_CSS: \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', SKIP : ' . ($bHasMenu ? "true" : "false") . ', LINK: "' . CUtil::JSEscape($arButton['HREF']) . '", ACTION : "' . $onClickJs . '",TEXT : "' . $button_text_js . '" })</script>'; if ($bHasMenu) { $result .= '<a href="javascript:void(0)" class="bx-panel-small-button-arrow" id="bx_topmenu_btn_' . $key . '_menu"><span class="bx-panel-small-button-arrow"></span></a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '_menu\', TYPE: \'SMALL\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-small-button-arrow-active\', HOVER_CSS: \'bx-panel-small-button-arrow-hover\'' . ($hintMenu ? ', HINT: ' . $hintMenu : '') . ', GROUP_ID : ' . $groupId . ', TEXT : "' . $button_text_js . '"})</script>'; } } elseif ($bHasMenu) { $result .= '<a href="javascript:void(0)" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . '"' : '') . '>' . $button_icon . $button_text . '<span class="bx-panel-small-single-button-arrow"></span></a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'SMALL\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-small-button-active\', HOVER_CSS: \'bx-panel-small-button-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', TEXT : "' . $button_text_js . '"})</script>'; } $result .= '</span></span>'; $last_btn_small_cnt++; break; case 'BIG': $last_btn_small_cnt = 0; $result .= '<span class="bx-panel-button"><span class="bx-panel-button-inner">'; $button_icon = '<span class="bx-panel-button-icon' . ($arButton['ICON'] ? ' ' . $arButton['ICON'] : '') . '"' . (isset($arButton['SRC']) && $arButton['SRC'] ? ' style="background: scroll transparent url(' . htmlspecialcharsbx($arButton['SRC']) . ') no-repeat center center !important;"' : '') . '></span>'; $button_text_js = CUtil::JSEscape(str_replace('#BR#', ' ', $arButton['TEXT'])); if ($bHasAction && $bHasMenu) { $button_text = '<span class="bx-panel-button-text">' . str_replace('#BR#', '<span class="bx-panel-break"></span>', $arButton['TEXT']) . ' <span class="bx-panel-button-arrow"></span></span>'; $result .= '<a href="' . htmlspecialcharsbx($arButton['HREF']) . '" onclick="' . $onClick . ';BX.removeClass(this.parentNode.parentNode, \'bx-panel-button-icon-active\');" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . '"' : '') . '>' . $button_icon . '</a><a id="bx_topmenu_btn_' . $key . '_menu" href="javascript:void(0)">' . $button_text . '</a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'BIG\', ACTIVE_CSS: \'bx-panel-button-icon-active\', HOVER_CSS: \'bx-panel-button-icon-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', SKIP : true }); BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '_menu\', TYPE: \'BIG\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-button-text-active\', HOVER_CSS: \'bx-panel-button-text-hover\'' . ($hintMenu ? ', HINT: ' . $hintMenu : '') . ', GROUP_ID : ' . $groupId . ', TEXT : "' . $button_text_js . '"})</script>'; } else { if ($bHasAction) { $button_text = '<span class="bx-panel-button-text">' . str_replace('#BR#', '<span class="bx-panel-break"></span>', $arButton['TEXT']) . '</span>'; $result .= '<a href="' . htmlspecialcharsbx($arButton['HREF']) . '" onclick="' . $onClick . ';BX.removeClass(this.parentNode.parentNode, \'bx-panel-button-active\');" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . '"' : '') . '>' . $button_icon . $button_text . '</a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'BIG\', ACTIVE_CSS: \'bx-panel-button-active\', HOVER_CSS: \'bx-panel-button-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', LINK: "' . CUtil::JSEscape($arButton['HREF']) . '", ACTION : "' . $onClickJs . '", TEXT : "' . $button_text_js . '"});</script>'; } else { $button_text = '<span class="bx-panel-button-text">' . str_replace('#BR#', '<span class="bx-panel-break"></span>', $arButton['TEXT']) . ' <span class="bx-panel-button-arrow"></span></span>'; $result .= '<a href="javascript:void(0)" id="bx_topmenu_btn_' . $key . '_menu">' . $button_icon . $button_text . '</a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '_menu\', TYPE: \'BIG\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-button-active\', HOVER_CSS: \'bx-panel-button-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', TEXT : "' . $button_text_js . '"});</script>'; } } $result .= '</span></span>'; break; } $main_sort = $arButton["MAIN_SORT"]; $last_btn_type = $arButton['TYPE']; } $result .= '</span>'; $result .= '</div> </div> </div>'; if ($USER->IsAdmin()) { $result .= CAdminNotify::GetHtml(); } $result .= ' </div> '; $result .= '<script type="text/javascript"> BX.admin.panel.state = { fixed: ' . ($aUserOpt["fix"] == "on" ? 'true' : 'false') . ', collapsed: ' . ($aUserOpt["collapsed"] == "on" ? 'true' : 'false') . ' } BX.admin.moreButton.init({ buttonTitle : "' . GetMessageJS("top_panel_more_button_title") . '"}); </script>'; //start menu preload // if($aUserOptGlobal["start_menu_preload"] == 'Y') // $result .= '<script type="text/javascript">BX.ready(function(){jsStartMenu.PreloadMenu(\''.CUtil::JSEscape($href.($params<>""? "?".$params:"")).'\');});</script>'; //show script to play sound $result .= $adminPage->ShowSound(); return $result; }
function TxtToHTML( $str, // текст для преобразования $bMakeUrls = true, // true - преобразовавыть URL в <a href="URL">URL</a> $iMaxStringLen = 0, // максимальная длина фразы без пробелов или символов перевода каретки $QUOTE_ENABLED = "N", // Y - преобразовать <QUOTE>...</QUOTE> в рамку цитаты $NOT_CONVERT_AMPERSAND = "Y", // Y - не преобразовывать символ "&" в "&" $CODE_ENABLED = "N", // Y - преобразовать <CODE>...</CODE> в readonly textarea $BIU_ENABLED = "N", // Y - преобразовать <B>...</B> и т.д. в соответствующие HTML тэги $quote_table_class = "quotetable", // css класс на таблицу цитаты $quote_head_class = "tdquotehead", // css класс на первую TD таблицы цитаты $quote_body_class = "tdquote", // css класс на вторую TD таблицы цитаты $code_table_class = "codetable", // css класс на таблицу кода $code_head_class = "tdcodehead", // css класс на первую TD таблицы кода $code_body_class = "tdcodebody", // css класс на вторую TD таблицы кода $code_textarea_class = "codetextarea", // css класс на textarea в таблице кода $link_class = "txttohtmllink", // css класс на ссылках $arUrlEvent = array(), // массив в нем если заданы ключи EVENT1, EVENT2, EVENT3 то ссылки будут через // $arUrlEvent["SCRIPT"] (по умолчанию равен "/bitrix/redirect.php") $link_target = "_self" // tagret открытия страницы ) { global $QUOTE_ERROR, $QUOTE_OPENED, $QUOTE_CLOSED; $QUOTE_ERROR = $QUOTE_OPENED = $QUOTE_CLOSED = 0; $str = delete_special_symbols($str); //echo "\n<br>=====================\n<br><pre>".htmlspecialcharsbx($str)."</pre>\n<br>=======================\n<br>"; // вставим спецсимвол chr(2) там где в дальнейшем необходимо вставить пробел if($iMaxStringLen>0) $str = InsertSpaces($str, $iMaxStringLen, chr(2), true); // \ => chr(8) $str = str_replace("\\", chr(8), $str); // спецсимвол заменяющий слэш "\" // <quote>...</quote> => [quote]...[/quote] if ($QUOTE_ENABLED=="Y") $str = preg_replace("#(?:<|\[)(/?)quote(.*?)(?:>|\])#is", " [\\1quote]", $str); // <code>...</code> => [code]...[/code] // \n => chr(4) // \r => chr(5) if ($CODE_ENABLED=="Y") { $str = preg_replace("#<code(\s+[^>]*>|>)(.+?)</code(\s+[^>]*>|>)#is", "[code]\\2[/code]", $str); $str = preg_replace("#\[code(\s+[^\]]*\]|\])(.+?)\[/code(\s+[^\]]*\]|\])#ies", "convert_code_tag_for_html_before('\\2')", $str); } // <b>...</b> => [b]...[/b] // <i>...</i> => [i]...[/i] // <u>...</u> => [u]...[/u] if ($BIU_ENABLED=="Y") { $str = preg_replace("#<b(\s+[^>]*>|>)(.+?)</b(\s+[^>]*>|>)#is", "[b]\\2[/b]", $str); $str = preg_replace("#<i(\s+[^>]*>|>)(.+?)</i(\s+[^>]*>|>)#is", "[i]\\2[/i]", $str); $str = preg_replace("#<u(\s+[^>]*>|>)(.+?)</u(\s+[^>]*>|>)#is", "[u]\\2[/u]", $str); } // URL => chr(1).URL."/".chr(1) // EMail => chr(3).E-Mail.chr(3) if($bMakeUrls) { //hide @ from next regexp with chr(11) $str = preg_replace("#((http|https|ftp):\/\/[a-z:@,.'/\#\%=~\\&?*+\[\]_0-9\x01-\x08-]+)#ies", "extract_url(str_replace('@', chr(11), '\\1'))", $str); $str = preg_replace("#(([=_\.'0-9a-z+~\x01-\x08-]+)@([_0-9a-z\x01-\x08-]+\.)+[a-z]{2,10})#is", chr(3)."\\1".chr(3), $str); //replace back to @ $str = str_replace(chr(11), '@', $str); } // конвертация критичных символов if ($NOT_CONVERT_AMPERSAND!="Y") $str = str_replace("&", "&", $str); static $search=array("<",">","\"","'","%",")","(","+"); static $replace=array("<",">",""","'","%",")","(","+"); $str = str_replace($search, $replace, $str); // chr(1).URL."/".chr(1) => <a href="URL">URL</a> // chr(3).E-Mail.chr(3) => <a href="mailto:E-Mail">E-Mail</a> if($bMakeUrls) { $event1 = $arUrlEvent["EVENT1"]; $event2 = $arUrlEvent["EVENT2"]; $event3 = $arUrlEvent["EVENT3"]; $script = $arUrlEvent["SCRIPT"]; $str = preg_replace("#\x01([^\n\x01]+?)/\x01#ies", "convert_to_href('\\1', '".CUtil::addslashes($link_class)."', '".CUtil::addslashes($event1)."', '".CUtil::addslashes($event2)."', '".CUtil::addslashes($event3)."', '".CUtil::addslashes($script)."', '".CUtil::addslashes($link_target)."')", $str); $str = preg_replace("#\x03([^\n\x03]+?)\x03#ies", "convert_to_mailto('\\1', '".CUtil::addslashes($link_class)."')", $str); } $str = str_replace("\r\n", "\n", $str); $str = str_replace("\n", "<br />\n", $str); $str = preg_replace("# {2}#", " ", $str); $str = preg_replace("#\t#", " ", $str); // chr(2) => " " if($iMaxStringLen>0) $str = str_replace(chr(2), "<wbr>", $str); // [quote]...[/quote] => <table>...</table> if ($QUOTE_ENABLED=="Y") $str = preg_replace("#(\[quote(.*?)\](.*)\[/quote(.*?)\])#ies", "convert_quote_tag('\\1', '".CUtil::addslashes($quote_table_class)."', '".CUtil::addslashes($quote_head_class)."', '".CUtil::addslashes($quote_body_class)."')", $str); // [code]...[/code] => <textarea>...</textarea> // chr(4) => \n // chr(5) => \r if ($CODE_ENABLED=="Y") { $str = preg_replace("#\[code\](.*?)\[/code\]#ies", "convert_code_tag_for_html_after('\\1', '".CUtil::addslashes($code_table_class)."', '".CUtil::addslashes($code_head_class)."', '".CUtil::addslashes($code_body_class)."', '".CUtil::addslashes($code_textarea_class)."')", $str); $str = str_replace(chr(4), "\n", $str); $str = str_replace(chr(5), "\r", $str); $str = str_replace(chr(6), " ", $str); $str = str_replace(chr(7), "\t", $str); $str = str_replace(chr(16), "[", $str); $str = str_replace(chr(17), "]", $str); } // [b]...[/b] => <b>...</b> // [i]...[/i] => <i>...</i> // [u]...[/u] => <u>...</u> if ($BIU_ENABLED=="Y") { $str = preg_replace("#\[b\](.*?)\[/b\]#is", "<b>\\1</b>", $str); $str = preg_replace("#\[i\](.*?)\[/i\]#is", "<i>\\1</i>", $str); $str = preg_replace("#\[u\](.*?)\[/u\]#is", "<u>\\1</u>", $str); } // chr(8) => \ $str = str_replace(chr(8), "\\", $str); $str = delete_special_symbols($str); return $str; }
echo CUtil::JSEscape(GetMessage("interface_grid_sort_asc")); ?> ', 'ONCLICK':'bxGrid_<?php echo $arParams["GRID_ID"]; ?> .Sort(\'<?php echo CUtil::addslashes($header["sort_url"]); ?> \', \'desc\')', 'ICONCLASS':'grid-sort-asc'}, {'TEXT': '<?php echo CUtil::JSEscape(GetMessage("interface_grid_sort_desc")); ?> ', 'ONCLICK':'bxGrid_<?php echo $arParams["GRID_ID"]; ?> .Sort(\'<?php echo CUtil::addslashes($header["sort_url"]); ?> \', \'asc\')', 'ICONCLASS':'grid-sort-desc'}, {'TEXT': '<?php echo CUtil::JSEscape(GetMessage("interface_grid_hide_col")); ?> ', 'ONCLICK':'bxGrid_<?php echo $arParams["GRID_ID"]; ?> .HideColumn(\'<?php echo CUtil::JSEscape($id); ?> \')', 'DISABLED':<?php echo $USER->IsAuthorized() ? 'false' : 'true'; ?> }]" title="<?php
"; oHelp['URL'] = "<?php echo CUtil::addslashes(GetMessage("FORUM_HELP_URL")); ?> "; oHelp['IMG'] = "<?php echo CUtil::addslashes(GetMessage("FORUM_HELP_IMG")); ?> "; oHelp['QUOTE'] = "<?php echo CUtil::addslashes(GetMessage("FORUM_HELP_QUOTE")); ?> "; oHelp['LIST'] = "<?php echo CUtil::addslashes(GetMessage("FORUM_HELP_LIST")); ?> "; oHelp['CODE'] = "<?php echo CUtil::addslashes(GetMessage("FORUM_HELP_CODE")); ?> "; oHelp['CLOSE_CLICK'] = "<?php echo CUtil::addslashes(GetMessage("FORUM_HELP_CLICK_CLOSE")); ?> "; oHelp['TRANSLIT'] = "<?php echo CUtil::addslashes(GetMessage("FORUM_HELP_TRANSLIT")); ?> "; </script>
function __build_item_info(&$res, $arParams, $WrapLongWords = false) { global $DB, $USER; static $bTheFirstTimeonPage = true; static $bShowWebdav = true; static $arBPTemplates = array(); static $arOfficeExtensions = false; static $checkParentSectionIsLink = array(); $nameTemplate = "#NOBR##LAST_NAME# #NAME##/NOBR#"; static $arNameFormats = array(); if (!isset($arNameFormats[SITE_ID])) { $arNameFormats[SITE_ID] = CSite::GetNameFormat(false); } if (isset($arNameFormats[SITE_ID])) { $nameTemplate = $arNameFormats[SITE_ID]; } if (!$arOfficeExtensions) { $arOfficeExtensions = __wd_get_office_extensions(); } if (!isset($arParams["OBJECT"])) { return; } $ob = $arParams["OBJECT"]; static $allowExtDocServices = null; if ($allowExtDocServices === null) { $allowExtDocServicesGlobal = CWebDavTools::allowUseExtServiceGlobal(); $allowExtDocServicesLocal = CWebDavTools::allowUseExtServiceLocal(); $allowExtDocServices = $allowExtDocServicesGlobal; if ($ob->arRootSection['UF_USE_EXT_SERVICES'] && $allowExtDocServicesLocal) { $allowExtDocServices = 'Y' == CWebDavIblock::resolveDefaultUseExtServices($ob->arRootSection['UF_USE_EXT_SERVICES']); } } static $rootDataForCurrentUser = null; static $isUserLib = null; if ($rootDataForCurrentUser === null && $USER->getId()) { $rootDataForCurrentUser = CWebDavIblock::getRootSectionDataForUser($USER->getId()); $isUserLib = $ob->attributes['user_id'] == $USER->getId() && !($ob->meta_state == CWebDavIblock::DROPPED); } static $isExtranetUser = null; if ($isExtranetUser === null) { $isExtranetUser = !$USER->getId() || !CWebDavTools::isIntranetUser($USER->getId()); } $bInTrash = "/" . $ob->meta_names["TRASH"]["alias"] == $ob->_udecode($ob->_path); if ($res["TYPE"] != "S" && $arBPTemplates != $arParams["TEMPLATES"]) { $bShowWebdav = true; $arBPTemplates = $arParams["TEMPLATES"]; if (is_array($arParams["TEMPLATES"]) && !empty($arParams["TEMPLATES"])) { foreach ($arParams["TEMPLATES"] as $key => $arTemplateState) { if (in_array($arTemplateState["AUTO_EXECUTE"], array(2, 3, 6, 7)) && (is_array($arTemplateState["PARAMETERS"]) || is_array($arTemplateState["TEMPLATE_PARAMETERS"]))) { $arTemplateState["TEMPLATE_PARAMETERS"] = is_array($arTemplateState["PARAMETERS"]) ? $arTemplateState["PARAMETERS"] : $arTemplateState["TEMPLATE_PARAMETERS"]; foreach ($arTemplateState["TEMPLATE_PARAMETERS"] as $val) { if ($val["Required"] == 1 && empty($val["Default"])) { $bShowWebdav = false; break; } } } } } } $res["bShowWebDav"] = $bShowWebdav; /************** Grid Data ******************************************/ $arActions = array(); if ($res["TYPE"] == "S") { $arActions["section_open"] = array("ICONCLASS" => "section_open", "TITLE" => GetMessage("WD_OPEN_SECTION"), "TEXT" => GetMessage("WD_OPEN"), "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"]["~THIS"]) . "');", "DEFAULT" => true); if ($res["SHOW"]["UNDELETE"] == "Y") { $arActions["section_undelete"] = array("ICONCLASS" => "section_download", "TITLE" => GetMessage("WD_UNDELETE_SECTION"), "TEXT" => GetMessage("WD_UNDELETE"), "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape(WDAddPageParams($res["URL"]["~UNDELETE"], array("edit_section" => "Y", "sessid" => bitrix_sessid()), false)) . "');", "DEFAULT" => false); } if ($res["SHOW"]["EDIT"] == "Y") { if ($ob->Type == "iblock" && $arParams["OBJECT"]->CheckWebRights("", false, array("action" => "create"))) { //sharing with antoher user. Only user_lib files. global $USER; if (!empty($arParams["OBJECT"]->attributes['user_id']) && $arParams["OBJECT"]->attributes['user_id'] == $USER->getID() && !$isExtranetUser) { if (empty($res['LINK'])) { if (!empty($res['SHARED_SECTION'])) { //usage. Show list user $uriToShareSection = $GLOBALS['APPLICATION']->GetCurUri(http_build_query(array('toWDController' => 1, 'wdaction' => 'detail_user_share', 'shareSectionId' => $res["ID"]))); $arActions["section_share"] = array("ICONCLASS" => "section_share", "TITLE" => GetMessage("WD_SHARE_TITLE_2"), "TEXT" => GetMessage("WD_SHARE_NAME_2"), "ONCLICK" => "WDShareFolder('{$uriToShareSection}', {$res["ID"]}, null, '" . CUtil::JSEscape($res["NAME"]) . "')"); } else { if (!isset($checkParentSectionIsLink[$res['IBLOCK_SECTION_ID']])) { $checkParentSectionIsLink[$res['IBLOCK_SECTION_ID']] = CWebDavSymlinkHelper::isLink(CWebDavSymlinkHelper::ENTITY_TYPE_USER, $arParams["OBJECT"]->attributes['user_id'], array('ID' => $res['IBLOCK_SECTION_ID'], 'IBLOCK_ID' => $res['IBLOCK_ID'])); } //if element in link - don't share if (!$checkParentSectionIsLink[$res['IBLOCK_SECTION_ID']]) { $uriToShareSection = $GLOBALS['APPLICATION']->GetCurUri(http_build_query(array('toWDController' => 1, 'wdaction' => 'detail_user_share', 'shareSectionId' => $res["ID"]))); $arActions["section_share"] = array("ICONCLASS" => "section_share", "TITLE" => GetMessage("WD_SHARE_TITLE_2"), "TEXT" => GetMessage("WD_SHARE_NAME_2"), "ONCLICK" => "WDShareFolder('{$uriToShareSection}', {$res["ID"]}, null, '" . CUtil::JSEscape($res["NAME"]) . "')"); } } } else { //usage. Show list user $uriToShareSection = $GLOBALS['APPLICATION']->GetCurUri(http_build_query(array('toWDController' => 1, 'wdaction' => 'info_user_share', 'shareSectionId' => $res['LINK']['SECTION_ID']))); $arActions["section_share"] = array("ICONCLASS" => "section_share", "TITLE" => GetMessage("WD_MANAGE_SHARE_TITLE"), "TEXT" => GetMessage("WD_MANAGE_SHARE_NAME"), "ONCLICK" => "WDShareFolder('{$uriToShareSection}', {$res['LINK']['SECTION_ID']}, '" . CUtil::JSEscape($res["URL"]["~DELETE"]) . "', '" . CUtil::JSEscape($res["NAME"]) . "')"); } } elseif (CWebDavIblock::$possibleUseSymlinkByInternalSections && !$isExtranetUser) { if (empty($res['LINK'])) { if (!empty($res['SHARED_SECTION'])) { //usage. Show list user $uriToShareSection = $GLOBALS['APPLICATION']->GetCurUri(http_build_query(array('toWDController' => 1, 'wdaction' => 'info_user_share', 'shareSectionId' => $res["ID"]))); $uriToDisconnectSection = $GLOBALS['APPLICATION']->GetCurUri(http_build_query(array('toWDController' => 1, 'wdaction' => 'disconnect', 'shareSectionId' => $res["ID"]))); $arActions["section_share"] = array("ICONCLASS" => "section_share", "TITLE" => GetMessage("WD_MANAGE_SHARE_TITLE"), "TEXT" => GetMessage("WD_MANAGE_SHARE_TITLE"), "ONCLICK" => "WDShareFolderInSharedDocs('{$uriToShareSection}', {$res["ID"]}, '{$uriToDisconnectSection}', '" . CUtil::JSEscape($res["NAME"]) . "')"); } else { $uriToShareSection = $GLOBALS['APPLICATION']->GetCurUri(http_build_query(array('toWDController' => 1, 'wdaction' => 'connect', 'shareSectionId' => $res["ID"]))); $arActions["section_share"] = array("ICONCLASS" => "section_share", "TITLE" => GetMessage("WD_SHARE_SECTION_CONNECT_TITLE"), "TEXT" => GetMessage("WD_SHARE_SECTION_CONNECT_NAME"), "ONCLICK" => "showWebdavSharedSectionDiskPopup('{$uriToShareSection}', {$res["ID"]}, null, '" . CUtil::JSEscape($res["NAME"]) . "')"); } } } } $arActions["section_rename"] = array("ICONCLASS" => "section_rename", "TITLE" => GetMessage("WD_RENAME_SECTION_TITLE"), "TEXT" => GetMessage("WD_RENAME_NAME"), "ONCLICK" => "WDRename(BX('ID_" . $res["TYPE"] . $res["ID"] . "'), bxGrid_" . $arParams["GRID_ID"] . ", '" . $arParams["GRID_ID"] . "')"); if ($ob->Type == "iblock" && $arParams["OBJECT"]->CheckWebRights("", false, array("action" => "create"))) { $url = WDAddPageParams($res["URL"]["SECTIONS_DIALOG"], array("ACTION" => "COPY", "NAME" => urlencode($res["NAME"]), "ID" => "S" . $res["ID"]), false); $arActions["section_copy"] = array("ICONCLASS" => "section_copy", "TITLE" => GetMessage("WD_COPY_SECTION_TITLE"), "TEXT" => GetMessage("WD_COPY_NAME"), "ONCLICK" => "(new BX.CDialog({'width': 450, 'heght':400, 'content_url':'" . CUtil::JSEscape($url) . "'})).Show()"); $url = WDAddPageParams($res["URL"]["SECTIONS_DIALOG"], array("ACTION" => "MOVE", "NAME" => urlencode($res["NAME"]), "ID" => "S" . $res["ID"]), false); $arActions["section_move"] = array("ICONCLASS" => "section_move", "TITLE" => GetMessage("WD_MOVE_SECTION_TITLE"), "TEXT" => GetMessage("WD_MOVE_NAME"), "ONCLICK" => "(new BX.CDialog({'width': 450, 'heght':400, 'content_url':'" . CUtil::JSEscape($url) . "'})).Show()"); } } if ($res["SHOW"]["RIGHTS"] == "Y") { $urlParams = array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "ENTITY_TYPE" => "SECTION", "ENTITY_ID" => $res['ID'], "back_url" => urlencode($GLOBALS['APPLICATION']->GetCurPage())); if (isset($ob->attributes['user_id'])) { $urlParams['SOCNET_TYPE'] = 'user'; $urlParams['SOCNET_ID'] = $ob->attributes['user_id']; } elseif (isset($ob->attributes['group_id'])) { $urlParams['SOCNET_TYPE'] = 'group'; $urlParams['SOCNET_ID'] = $ob->attributes['group_id']; } $url = WDAddPageParams("/bitrix/components/bitrix/webdav.section.list/templates/.default/iblock_e_rights.php", $urlParams, false); $arActions["section_permissions"] = array("ICONCLASS" => "section_permissions", "TITLE" => GetMessage("WD_SECTION_PERMISSIONS"), "TEXT" => GetMessage("WD_PERMISSIONS"), "ONCLICK" => "(new BX.CDialog({'width': 750, 'heght':400, 'content_url':'" . CUtil::JSEscape($url) . "'})).Show()"); } if ($res["SHOW"]["DELETE"] == "Y" && (!$bInTrash || $bInTrash && $arParams["PERMISSION"] > "W")) { if (!empty($res['LINK'])) { $arActions["section_unshare"] = array("ICONCLASS" => "section_drop", "TITLE" => GetMessage("WD_UNSHARE_SECTION"), "TEXT" => GetMessage("WD_UNSHARE"), "ONCLICK" => "WDConfirm('" . CUtil::JSEscape(GetMessage("WD_UNSHARE_TITLE")) . "', '" . CUtil::JSEscape(GetMessage("WD_UNSHARE_SECTION_CONFIRM", array('#NAME#' => $res['NAME']))) . "', function() {jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"]["~DELETE"]) . "')})"); } elseif (!empty($res['SHARED_SECTION']) && isset($arActions["section_share"])) { $arActions["section_drop"] = array("ICONCLASS" => "section_drop", "TITLE" => GetMessage("WD_DELETE_SECTION"), "TEXT" => GetMessage("WD_DELETE"), "ONCLICK" => "WDConfirm('" . CUtil::JSEscape(GetMessage("WD_DELETE_OWN_SHARE_SECTION_TITLE")) . "', '" . CUtil::JSEscape(GetMessage("WD_DELETE_OWN_SHARE_SECTION_CONFIRM", array('#NAME#' => $res['NAME']))) . "', function() {jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"]["~DELETE"]) . "')})"); } else { $forceDeleteUrl = CHTTP::urlAddParams($res["URL"]["~DELETE"], array('delete_without_trash' => 1)); $arActions["section_drop"] = array("ICONCLASS" => "section_drop", "TITLE" => GetMessage("WD_DELETE_SECTION"), "TEXT" => GetMessage("WD_DELETE")); if ($res["SHOW"]["UNDELETE"] == "Y") { $arActions["section_drop"]['ONCLICK'] = "WDConfirm('" . CUtil::JSEscape(GetMessage("WD_DELETE_TITLE")) . "', '" . CUtil::JSEscape(GetMessage($res["SHOW"]["UNDELETE"] == "Y" ? "WD_DESTROY_SECTION_CONFIRM" : "WD_DELETE_SECTION_CONFIRM", array('#NAME#' => $res['NAME']))) . "', function() {jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"]["~DELETE"]) . "')})"; } elseif ($arParams['OBJECT']->CheckRight($res["E_RIGHTS"], "iblock_edit") >= "X") { $arActions["section_drop"]['ONCLICK'] = "WDConfirmDelete('" . CUtil::JSEscape(GetMessage("WD_DELETE_TITLE")) . "', '" . CUtil::JSEscape(GetMessage("WD_TRASH_DELETE_DESTROY_SECTION_CONFIRM", array("#NAME#" => $res['NAME']))) . "'" . ", '" . CUtil::JSEscape(GetMessage("WD_TRASH_DELETE_BUTTON")) . "'" . ", '" . CUtil::JSEscape(GetMessage("WD_TRASH_DESTROY_BUTTON")) . "'" . ", '" . CUtil::JSEscape(GetMessage("WD_TRASH_CANCEL_DELETE_BUTTON")) . "'" . ", function() { var urlDelete = '" . CUtil::JSEscape($res["URL"]["~DELETE"]) . "'; jsUtils.Redirect([], urlDelete)}" . ", function() { var urlDelete = '" . CUtil::JSEscape($forceDeleteUrl) . "'; jsUtils.Redirect([], urlDelete)})"; } else { $arActions["section_drop"]['ONCLICK'] = "WDConfirm('" . CUtil::JSEscape(GetMessage("WD_DELETE_TITLE")) . "', '" . CUtil::JSEscape(GetMessage("WD_DELETE_SECTION_CONFIRM", array("#NAME#" => $res['NAME']))) . "', function() { var urlDelete = '" . CUtil::JSEscape($res["URL"]["~DELETE"]) . "'; jsUtils.Redirect([], urlDelete)})"; } } } $arActions['preview_launch'] = array('type' => 'folder', 'src' => $res["URL"]["~THIS"], 'title' => $res['NAME'], 'owner' => CUser::FormatName(CSite::GetNameFormat(false), array('LOGIN' => $res['CREATED_BY']['LOGIN'], 'NAME' => $res['CREATED_BY']['NAME'], 'SECOND_NAME' => $res['CREATED_BY']['SECOND_NAME'], 'LAST_NAME' => $res['CREATED_BY']['LAST_NAME']), true, false), 'size' => CFile::FormatSize($res['PROPERTY_WEBDAV_SIZE_VALUE']), 'dateModify' => FormatDate('FULL', MakeTimeStamp($res["TIMESTAMP_X"]))); } else { $arActions["element_open"] = array("ICONCLASS" => "element_open", "TITLE" => GetMessage("WD_OPEN_DOCUMENT"), "TEXT" => GetMessage("WD_OPEN"), "ONCLICK" => "OpenDoc('" . CUtil::JSEscape(htmlspecialcharsbx($res["URL"]["~THIS"])) . "', " . (in_array($res["FILE_EXTENTION"], $arOfficeExtensions) && $arParams['DEFAULT_EDIT'] === 'Y' ? "true" : "false") . ");", "DEFAULT" => true); if ($allowExtDocServices && CWebDavTools::allowPreviewFile($res["FILE_EXTENTION"], $res['PROPERTY_WEBDAV_SIZE_VALUE'])) { //showInViewer $downloadUrl = CUtil::JSEscape($res["URL"]["~DOWNLOAD"]); $editInUrl = $editrUrl = CUtil::JSEscape(($GLOBALS['APPLICATION']->IsHTTPS() ? 'https' : 'http') . '://' . str_replace("//", "/", $_SERVER['HTTP_HOST'] . "/" . $res["URL"]["THIS"])) . '?' . bitrix_sessid_get() . '&editIn=' . CWebDavLogOnlineEditBase::DEFAULT_SERVICE_NAME . '&start=1'; $downloadUrl .= (strpos($downloadUrl, "?") === false ? "?" : "&") . "ncc=1&force_download=1"; $viewerUrl = CUtil::JSEscape(($GLOBALS['APPLICATION']->IsHTTPS() ? 'https' : 'http') . '://' . str_replace("//", "/", $_SERVER['HTTP_HOST'] . "/" . $res["URL"]["THIS"])) . '?showInViewer=1'; $arActions['preview_launch'] = array('type' => 'iframe', 'src' => $viewerUrl, 'download' => $downloadUrl, 'history' => CHTTP::urlAddParams($res['URL']['VIEW'], array('webdavForm' . $res['IBLOCK_ID'] . '_active_tab' => 'tab_history')), 'edit' => $res['LOCK_STATUS'] == 'green' && CWebDavEditDocGoogle::isEditable($res["FILE_EXTENTION"]) && $res['E_RIGHTS']['element_edit'] ? $editInUrl : '', 'askConvert' => CWebDavEditDocGoogle::isNeedConvertExtension($res["FILE_EXTENTION"]), 'title' => $res['NAME'], 'inPersonalLib' => $isUserLib && $res['LOCK_STATUS'] == 'green' && $res['E_RIGHTS']['element_edit'] ? '1' : '', 'externalId' => $isUserLib ? "st{$rootDataForCurrentUser['IBLOCK_ID']}|{$rootDataForCurrentUser['SECTION_ID']}|f{$res['ID']}" : '', 'relativePath' => $res['PATH']); } elseif ($allowExtDocServices && CWebDavEditDocGoogle::isEditable($res["FILE_EXTENTION"])) { //showInViewer $downloadUrl = CUtil::JSEscape($res["URL"]["~DOWNLOAD"]); $editInUrl = $editrUrl = CUtil::JSEscape(($GLOBALS['APPLICATION']->IsHTTPS() ? 'https' : 'http') . '://' . str_replace("//", "/", $_SERVER['HTTP_HOST'] . "/" . $res["URL"]["THIS"])) . '?' . bitrix_sessid_get() . '&editIn=' . CWebDavLogOnlineEditBase::DEFAULT_SERVICE_NAME . '&start=1'; $downloadUrl .= (strpos($downloadUrl, "?") === false ? "?" : "&") . "ncc=1&force_download=1"; $viewerUrl = CUtil::JSEscape(($GLOBALS['APPLICATION']->IsHTTPS() ? 'https' : 'http') . '://' . str_replace("//", "/", $_SERVER['HTTP_HOST'] . "/" . $res["URL"]["THIS"])) . '?showInViewer=1'; $arActions['preview_launch'] = array('type' => 'onlyedit', 'src' => $viewerUrl, 'download' => $downloadUrl, 'history' => CHTTP::urlAddParams($res['URL']['VIEW'], array('webdavForm' . $res['IBLOCK_ID'] . '_active_tab' => 'tab_history')), 'edit' => $res['LOCK_STATUS'] == 'green' && CWebDavEditDocGoogle::isEditable($res["FILE_EXTENTION"]) && $res['E_RIGHTS']['element_edit'] ? $editInUrl : '', 'askConvert' => CWebDavEditDocGoogle::isNeedConvertExtension($res["FILE_EXTENTION"]), 'title' => $res['NAME'], 'owner' => CUser::FormatName(CSite::GetNameFormat(false), array('LOGIN' => $res['CREATED_BY']['LOGIN'], 'NAME' => $res['CREATED_BY']['NAME'], 'SECOND_NAME' => $res['CREATED_BY']['SECOND_NAME'], 'LAST_NAME' => $res['CREATED_BY']['LAST_NAME']), true, false), 'size' => CFile::FormatSize($res['PROPERTY_WEBDAV_SIZE_VALUE']), 'dateModify' => FormatDate('FULL', MakeTimeStamp($res["TIMESTAMP_X"])), 'tooBigSizeMsg' => true, 'inPersonalLib' => $isUserLib && $res['LOCK_STATUS'] == 'green' && $res['E_RIGHTS']['element_edit'] ? '1' : '', 'externalId' => $isUserLib ? "st{$rootDataForCurrentUser['IBLOCK_ID']}|{$rootDataForCurrentUser['SECTION_ID']}|f{$res['ID']}" : '', 'relativePath' => $res['PATH']); } elseif (CFile::IsImage($res['NAME'])) { $downloadUrl = CUtil::JSEscape($res["URL"]["~DOWNLOAD"]); $downloadUrl .= (strpos($downloadUrl, "?") === false ? "?" : "&") . "ncc=1&force_download=1"; $arActions['preview_launch'] = array('type' => 'image', 'src' => $downloadUrl, 'download' => $downloadUrl, 'title' => $res['NAME']); } else { $downloadUrl = CUtil::JSEscape($res["URL"]["~DOWNLOAD"]); $downloadUrl .= (strpos($downloadUrl, "?") === false ? "?" : "&") . "ncc=1&force_download=1"; $arActions['preview_launch'] = array('type' => 'unknown', 'src' => $downloadUrl, 'download' => $downloadUrl, 'title' => $res['NAME'], 'owner' => CUser::FormatName(CSite::GetNameFormat(false), array('LOGIN' => $res['CREATED_BY']['LOGIN'], 'NAME' => $res['CREATED_BY']['NAME'], 'SECOND_NAME' => $res['CREATED_BY']['SECOND_NAME'], 'LAST_NAME' => $res['CREATED_BY']['LAST_NAME']), true, false), 'size' => CFile::FormatSize($res['PROPERTY_WEBDAV_SIZE_VALUE']), 'dateModify' => FormatDate('FULL', MakeTimeStamp($res["TIMESTAMP_X"])), 'tooBigSizeMsg' => $allowExtDocServices && CWebDavTools::allowPreviewFile($res["FILE_EXTENTION"], $res['PROPERTY_WEBDAV_SIZE_VALUE'], false), 'inPersonalLib' => $isUserLib && $res['LOCK_STATUS'] == 'green' && $res['E_RIGHTS']['element_edit'] ? '1' : '', 'externalId' => $isUserLib ? "st{$rootDataForCurrentUser['IBLOCK_ID']}|{$rootDataForCurrentUser['SECTION_ID']}|f{$res['ID']}" : '', 'relativePath' => $res['PATH']); } $downloadUrl = CUtil::JSEscape($res["URL"]["~DOWNLOAD"]); $downloadUrl .= (strpos($downloadUrl, "?") === false ? "?" : "&") . "ncc=1&force_download=1"; $arActions["element_download"] = array("ICONCLASS" => "element_download", "TITLE" => GetMessage("WD_DOWNLOAD_ELEMENT"), "TEXT" => GetMessage("WD_DOWNLOAD"), "ONCLICK" => "window.location.href = '" . $downloadUrl . "';", "DEFAULT" => false); if ($arParams["PERMISSION"] >= "U") { $urlT = CUtil::JSEscape(($GLOBALS['APPLICATION']->IsHTTPS() ? 'https' : 'http') . '://' . str_replace("//", "/", $_SERVER['HTTP_HOST'] . "/" . $res["URL"]["THIS"])); $arActions["copy_ext_link"] = array("ICONCLASS" => "element_ext_link", "TITLE" => GetMessage("WD_COPY_EXT_LINK_TITLE"), "TEXT" => GetMessage("WD_COPY_EXT_LINK"), "ONCLICK" => CWebDavExtLinks::InsertDialogCallText($urlT)); } if ($res["SHOW"]["UNDELETE"] == "Y") { $arActions["element_undelete"] = array("ICONCLASS" => "element_download", "TITLE" => GetMessage("WD_UNDELETE_ELEMENT"), "TEXT" => GetMessage("WD_UNDELETE"), "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape(WDAddPageParams($res["URL"]["~UNDELETE"], array("edit" => "Y", "sessid" => bitrix_sessid()), false)) . "');", "DEFAULT" => false); } if ($arParams["PERMISSION"] >= "U") { if ($res["SHOW"]["LOCK"] == "Y" || $res["SHOW"]["UNLOCK"] == "Y") { $arActions["element_upload"] = array("ICONCLASS" => "element_edit", "TITLE" => GetMessage("WD_UPLOAD_ELEMENT"), "TEXT" => GetMessage("WD_UPLOAD"), "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"][$arParams["OBJECT"]->Type == "folder" ? "EDIT" : "~VIEW"] . '#upload') . "');"); } if ($ob->Type == "iblock" && $res["SHOW"]["UNLOCK"] == "Y") { $arActions["element_unlock"] = array("ICONCLASS" => "element_unlock", "TITLE" => GetMessage("WD_UNLOCK_ELEMENT"), "TEXT" => GetMessage("WD_UNLOCK"), "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"]["~UNLOCK"]) . "');"); } if ($ob->Type == "iblock" && $res["SHOW"]["LOCK"] == "Y") { $arActions["element_lock"] = array("ICONCLASS" => "element_unlock", "TITLE" => GetMessage("WD_LOCK_ELEMENT"), "TEXT" => GetMessage("WD_LOCK"), "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"]["~LOCK"]) . "');"); } if (($res["SHOW"]["LOCK"] == "Y" || $res["SHOW"]["UNLOCK"] == "Y") && in_array($res["FILE_EXTENTION"], $arOfficeExtensions)) { $arActions["element_edit_office"] = array("ICONCLASS" => "element_edit", "TITLE" => GetMessage("WD_EDIT_MSOFFICE"), "TEXT" => GetMessage("WD_EDIT_MSOFFICE_MENU"), "OFFICECHECK" => true, "DISABLED" => !($bShowWebdav && $res["SHOW"]["EDIT"] == "Y"), "ONCLICK" => 'return EditDocWithProgID(\'' . CUtil::addslashes($res["URL"]["~THIS"]) . '\');'); } } $arActions["element_view"] = array("ICONCLASS" => "element_view", "TITLE" => GetMessage("WD_VIEW_ELEMENT"), "TEXT" => GetMessage($res["~TYPE"] == "FILE" ? "WD_PROPERTIES" : "WD_VIEW"), "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"][$res["~TYPE"] == "FILE" ? "EDIT" : "~VIEW"]) . "');"); if ($arParams["USE_COMMENTS"] == "Y" && IsModuleInstalled("forum")) { $arActions["element_comment"] = array("ICONCLASS" => "element_comment", "TITLE" => GetMessage("WD_ELEMENT_COMMENT_NAME"), "TEXT" => GetMessage("WD_ELEMENT_COMMENT_TITLE"), "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"]["~VIEW"] . "?webdavForm" . $arParams["IBLOCK_ID"] . "_active_tab=tab_comments") . "');"); } if ($arParams["PERMISSION"] >= "U") { $arActions["copy_link"] = array("ICONCLASS" => "element_download", "TITLE" => GetMessage("WD_COPY_LINK_TITLE"), "TEXT" => GetMessage("WD_COPY_LINK"), "ONCLICK" => "WDCopyLinkDialog('" . CUtil::JSEscape(($GLOBALS['APPLICATION']->IsHTTPS() ? 'https' : 'http') . '://' . str_replace("//", "/", $_SERVER['HTTP_HOST'] . "/" . $res["URL"]["THIS"])) . "')"); /* $urlT = CUtil::JSEscape(($GLOBALS['APPLICATION']->IsHTTPS() ? 'https' : 'http').'://'.str_replace("//", "/", $_SERVER['HTTP_HOST']."/".$res["URL"]["THIS"])); $arActions["copy_ext_link"] = array( "ICONCLASS" => "element_download", "TITLE" => GetMessage("WD_COPY_EXT_LINK_TITLE"), "TEXT" => GetMessage("WD_COPY_EXT_LINK"), "ONCLICK" => CWebDavExtLinks::InsertDialogCallText($urlT) ); */ if ($res["SHOW"]["HISTORY"] == "Y") { $arActions["element_history"] = array("ICONCLASS" => "element_history" . ($res["SHOW"]["BP"] == "Y" ? " bizproc_history" : ""), "TITLE" => GetMessage("WD_HIST_ELEMENT_ALT"), "TEXT" => GetMessage("WD_HIST_ELEMENT"), "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"]["~VIEW"] . "?webdavForm" . $arParams["IBLOCK_ID"] . "_active_tab=tab_history") . "');"); } if ($res["SHOW"]["LOCK"] == "Y" || $res["SHOW"]["UNLOCK"] == "Y") { if ($res["SHOW"]["BP_VIEW"] == "Y") { $arActionsBpTmp[] = array("ICONCLASS" => "bizproc_document", "TITLE" => GetMessage("IBLIST_A_BP_H"), "TEXT" => GetMessage("IBLIST_A_BP_H"), "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"]["~BP"]) . "');"); } if ($res["SHOW"]["BP_START"] == "Y" && is_array($arParams["TEMPLATES"])) { $arr = array(); foreach ($arParams["TEMPLATES"] as $key => $arWorkflowTemplate) { if (!CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::StartWorkflow, $GLOBALS["USER"]->GetID(), $res["DOCUMENT_ID"], array("UserGroups" => $res["USER_GROUPS"], "DocumentStates" => $res["~arDocumentStates"], "WorkflowTemplateList" => $arTemplates, "WorkflowTemplateId" => $arWorkflowTemplate["ID"]))) { continue; } $url = $res["URL"]["~BP_START"]; $url .= (strpos($url, "?") === false ? "?" : "&") . "workflow_template_id=" . $arWorkflowTemplate["ID"] . '&' . bitrix_sessid_get(); $arr[] = array("ICONCLASS" => "", "TITLE" => $arWorkflowTemplate["DESCRIPTION"], "TEXT" => $arWorkflowTemplate["NAME"], "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "');"); } if (!empty($arr)) { $arActionsBpTmp[] = array("ICONCLASS" => "bizproc_start", "TITLE" => GetMessage("WD_START_BP_TITLE"), "TEXT" => GetMessage("WD_START_BP"), "MENU" => $arr); } } //if ($res["SHOW"]["BP_CLONE"] == "Y") //{ //$arActionsBpTmp[] = array( //"ICONCLASS" => "bizproc_document", //"TITLE" => GetMessage("WD_CREATE_VERSION_ALT"), //"TEXT" => GetMessage("WD_CREATE_VERSION"), //"ONCLICK" => "jsUtils.Redirect([], '".CUtil::JSEscape($res["URL"]["~CLONE"])."');"); //$arActionsBpTmp[] = array( //"ICONCLASS" => "bizproc_document", //"TITLE" => GetMessage("WD_VERSIONS_ALT"), //"TEXT" => GetMessage("WD_VERSIONS"), //"ONCLICK" => "jsUtils.Redirect([], '".CUtil::JSEscape($res["URL"]["~VERSIONS"])."');"); //} if (!empty($arActionsBpTmp)) { $arActions += $arActionsBpTmp; } $arActions["separator_del"] = array("SEPARATOR" => true); if ($ob->Type == "folder" || $ob->Type == "iblock" && $res["WF_PARENT_ELEMENT_ID"] === null) { $arActions["element_rename"] = array("ICONCLASS" => "element_rename", "TITLE" => GetMessage("WD_RENAME_TITLE"), "TEXT" => GetMessage("WD_RENAME_NAME"), "ONCLICK" => "WDRename(BX('ID_" . $res["TYPE"] . $res["ID"] . "'), bxGrid_" . $arParams["GRID_ID"] . ", '" . $arParams["GRID_ID"] . "')"); } } if ($res["SHOW"]["COPY"] == 'Y') { $url = WDAddPageParams($res["URL"]["SECTIONS_DIALOG"], array("ACTION" => "COPY", "NAME" => urlencode($res["NAME"]), "ID" => "E" . $res["ID"]), false); $arActions["element_copy"] = array("ICONCLASS" => "element_copy", "TITLE" => GetMessage("WD_COPY_TITLE"), "TEXT" => GetMessage("WD_COPY_NAME"), "ONCLICK" => "(new BX.CDialog({'width': 450, 'heght':400, 'content_url':'" . CUtil::JSEscape($url) . "'})).Show()"); } if ($ob->Type == "iblock" && $res["WF_PARENT_ELEMENT_ID"] === null && $res["SHOW"]["EDIT"] == "Y") { $url = WDAddPageParams($res["URL"]["SECTIONS_DIALOG"], array("ACTION" => "MOVE", "NAME" => urlencode($res["NAME"]), "ID" => "E" . $res["ID"]), false); $arActions["element_move"] = array("ICONCLASS" => "element_move", "TITLE" => GetMessage("WD_MOVE_TITLE"), "TEXT" => GetMessage("WD_MOVE_NAME"), "ONCLICK" => "(new BX.CDialog({'width': 450, 'heght':400, 'content_url':'" . CUtil::JSEscape($url) . "'})).Show()"); } if ($res["SHOW"]["RIGHTS"] == "Y") { $urlParams = array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "ENTITY_TYPE" => "ELEMENT", "ENTITY_ID" => $res['ID'], "back_url" => urlencode($GLOBALS['APPLICATION']->GetCurPageParam())); if (isset($ob->attributes['user_id'])) { $urlParams['SOCNET_TYPE'] = 'user'; $urlParams['SOCNET_ID'] = $ob->attributes['user_id']; } elseif (isset($ob->attributes['group_id'])) { $urlParams['SOCNET_TYPE'] = 'group'; $urlParams['SOCNET_ID'] = $ob->attributes['group_id']; } $url = WDAddPageParams("/bitrix/components/bitrix/webdav.section.list/templates/.default/iblock_e_rights.php", $urlParams, false); $arActions["element_permissions"] = array("ICONCLASS" => "element_permissions", "TITLE" => GetMessage("WD_ELEMENT_PERMISSIONS"), "TEXT" => GetMessage("WD_PERMISSIONS"), "ONCLICK" => "(new BX.CDialog({'width': 750, 'heght':400, 'content_url':'" . CUtil::JSEscape($url) . "'})).Show()"); } if ($res["SHOW"]["DELETE"] == "Y" && (!$bInTrash || $bInTrash && $arParams["PERMISSION"] >= "X")) { $forceDeleteUrl = CHTTP::urlAddParams($res["URL"]["~DELETE"], array('delete_without_trash' => 1)); $arActions["element_delete"] = array("ICONCLASS" => "element_delete", "TITLE" => GetMessage("WD_DELETE_ELEMENT"), "TEXT" => GetMessage("WD_DELETE")); if ($res["SHOW"]["UNDELETE"] == "Y") { $arActions["element_delete"]["ONCLICK"] = "WDConfirm('" . CUtil::JSEscape(GetMessage("WD_DELETE_TITLE")) . "', '" . CUtil::JSEscape(GetMessage($res["SHOW"]["UNDELETE"] == "Y" ? "WD_DESTROY_CONFIRM" : "WD_DELETE_CONFIRM", array("#NAME#" => $res['NAME']))) . "', function() {jsUtils.Redirect([], '" . CUtil::JSEscape($res["URL"]["~DELETE"]) . "')})"; } elseif ($arParams['OBJECT']->CheckRight($res["E_RIGHTS"], "iblock_edit") >= "X") { $arActions["element_delete"]['ONCLICK'] = "WDConfirmDelete('" . CUtil::JSEscape(GetMessage("WD_DELETE_TITLE")) . "', '" . CUtil::JSEscape(GetMessage("WD_TRASH_DELETE_DESTROY_ELEMENT_CONFIRM", array("#NAME#" => $res['NAME']))) . "'" . ", '" . CUtil::JSEscape(GetMessage("WD_TRASH_DELETE_BUTTON")) . "'" . ", '" . CUtil::JSEscape(GetMessage("WD_TRASH_DESTROY_BUTTON")) . "'" . ", '" . CUtil::JSEscape(GetMessage("WD_TRASH_CANCEL_DELETE_BUTTON")) . "'" . ", function() { var urlDelete = '" . CUtil::JSEscape($res["URL"]["~DELETE"]) . "'; jsUtils.Redirect([], urlDelete)}" . ", function() { var urlDelete = '" . CUtil::JSEscape($forceDeleteUrl) . "'; jsUtils.Redirect([], urlDelete)})"; } else { $arActions["element_delete"]['ONCLICK'] = "WDConfirm('" . CUtil::JSEscape(GetMessage("WD_DELETE_TITLE")) . "', '" . CUtil::JSEscape(GetMessage("WD_DELETE_CONFIRM", array("#NAME#" => $res['NAME']))) . "', function() { var urlDelete = '" . CUtil::JSEscape($res["URL"]["~DELETE"]) . "'; jsUtils.Redirect([], urlDelete)})"; } } } } foreach (array("MODIFIED_BY", "CREATED_BY", "WF_LOCKED_BY") as $user_key) { $aCols[$user_key] = is_array($res[$user_key]) ? $res[$user_key] : __parse_user($res[$user_key], $arParams["USER_VIEW_URL"], isset($arParams["NAME_TEMPLATE"]) ? $arParams["NAME_TEMPLATE"] : null); $aCols[$user_key] = "<div class=\"wd-user-link\">" . $aCols[$user_key]['main_user_link'] . "</div>"; } if ($res["TYPE"] == "S") { $classNameForIcon = !empty($res['LINK']) || !empty($res['SHARED_SECTION']) ? 'shared-section-icon' : 'section-icon'; $res["FTYPE"] = "folder"; $aCols["PLAIN_NAME"] = $res["NAME"]; $aCols["NAME"]['shared'] = $res["SHOW"]["SHARED"] ? '<div class="element-shared"></div>' : ''; $aCols["NAME"] = '<div class="section-name"> <div class="' . $classNameForIcon . '"></div>' . $aCols["NAME"]['shared'] . '<a class="section-title" id="sec' . $res['ID'] . '" href="' . $res["URL"]["THIS"] . '"' . 'data-bx-viewer="' . $arActions['preview_launch']['type'] . '" ' . 'data-bx-title="' . htmlspecialcharsbx($arActions['preview_launch']['title']) . '" ' . 'data-bx-src="' . $arActions['preview_launch']['src'] . '" ' . 'data-bx-size="' . $arActions['preview_launch']['size'] . '" ' . 'data-bx-owner="' . htmlspecialcharsbx($arActions['preview_launch']['owner']) . '" ' . 'data-bx-dateModify="' . htmlspecialcharsbx($arActions['preview_launch']['dateModify']) . '" ' . '>' . $res["NAME"] . '</a> </div>'; if ((!empty($res['LINK']) || !empty($res['SHARED_SECTION'])) && isset($arActions["section_share"])) { $aCols['FILE_SIZE'] = '<div id="sec' . $res['ID'] . '-share" class="wd-share-hotkey-share section-name" onclick="' . $arActions["section_share"]['ONCLICK'] . '">' . GetMessage('WD_ALREADY_SHARE_SECTION') . '</div></div> '; } elseif (!empty($arParams["OBJECT"]->attributes['user_id']) && $arParams["OBJECT"]->attributes['user_id'] == $USER->getId() && !empty($arActions["section_share"]) && !$isExtranetUser) { $aCols['FILE_SIZE'] = '<div id="sec' . $res['ID'] . '-share" class="wd-share-hotkey-potential-share section-name" onclick="' . $arActions["section_share"]['ONCLICK'] . '"><div class="shared-section-icon"></div> ' . GetMessage('WD_MAKE_SHARE_SECTION') . '</div> '; } elseif (empty($arParams["OBJECT"]->attributes['user_id']) && CWebDavIblock::$possibleUseSymlinkByInternalSections && !empty($arActions["section_share"]) && !$isExtranetUser) { $aCols['FILE_SIZE'] = '<div id="sec' . $res['ID'] . '-share" class="wd-share-hotkey-potential-share section-name" onclick="' . $arActions["section_share"]['ONCLICK'] . '"><div class="shared-section-icon"></div> ' . GetMessage('WD_SHARE_SECTION_CONNECT_IN_GRID') . '</div> '; } } else { $aCols["NAME"] = array(); $hintLink = __make_hint($res); if (!isset($arParams['MERGE_VIEW'])) { $aCols["NAME"]['hint'] = $res['HINT']; } else { $aCols["NAME"]['hint'] = ''; $hintLink = ''; } $aCols["NAME"]['icon'] = '<div class="element-icon icons icon-' . substr($res["FILE_EXTENTION"], 1) . '"></div>'; $aCols["NAME"]['shared'] = $res["SHOW"]["SHARED"] ? '<div class="element-shared"></div>' : ''; if (strlen($res["NAME"]) == 0) { $aCols["NAME"]["name"] = "<span> </span>"; } else { $resName = $WrapLongWords ? WrapLongWords(htmlspecialcharsbx($res["NAME"])) : htmlspecialcharsbx($res["NAME"]); if ($ob->Type != "iblock") { $aCols["NAME"]['name'] = '<a class="element-title ' . (strlen($hintLink) > 0 ? 'element-hint ' : ' ') . '" id="doc' . $res['ID'] . '" ' . $hintLink . 'href="' . htmlspecialcharsbx($res["URL"]["THIS"]) . '" onclick="return OpenDoc(this, ' . (in_array($res["FILE_EXTENTION"], $arOfficeExtensions) && $arParams['DEFAULT_EDIT'] == 'Y' ? "true" : "false") . ')"' . ' target="_blank"' . (strlen($hintLink) > 0 ? '' : ' title="' . GetMessage("WD_DOWNLOAD_ELEMENT") . '"') . '>' . $resName . '</a>'; } else { $aCols["NAME"]['name'] = '<a class="element-title ' . (strlen($hintLink) > 0 ? 'element-hint ' : ' ') . '" id="doc' . $res['ID'] . '" ' . $hintLink . ' ' . 'data-bx-viewer="' . $arActions['preview_launch']['type'] . '" ' . 'data-bx-title="' . htmlspecialcharsbx($arActions['preview_launch']['title']) . '" ' . 'data-bx-src="' . $arActions['preview_launch']['src'] . '" ' . 'data-bx-historyPage="' . $arActions['preview_launch']['history'] . '" ' . 'data-bx-edit="' . $arActions['preview_launch']['edit'] . '" ' . 'data-bx-isFromUserLib="' . $arActions['preview_launch']['inPersonalLib'] . '" ' . 'data-bx-externalId="' . $arActions['preview_launch']['externalId'] . '" ' . 'data-bx-relativePath="' . $arActions['preview_launch']['relativePath'] . '" ' . 'data-bx-askConvert="' . $arActions['preview_launch']['askConvert'] . '" ' . 'data-bx-download="' . $arActions['preview_launch']['download'] . '" ' . 'data-bx-size="' . $arActions['preview_launch']['size'] . '" ' . 'data-bx-owner="' . htmlspecialcharsbx($arActions['preview_launch']['owner']) . '" ' . 'data-bx-dateModify="' . htmlspecialcharsbx($arActions['preview_launch']['dateModify']) . '" ' . 'data-bx-tooBigSizeMsg="' . htmlspecialcharsbx($arActions['preview_launch']['tooBigSizeMsg']) . '" ' . '>' . $resName . '</a>'; } } $aCols["NAME"]['status'] = ''; if ($arParams["PERMISSION"] >= "U" && in_array($res['LOCK_STATUS'], array("red", "yellow"))) { $aCols["NAME"]['status'] .= '<div class="element-status-' . $res['LOCK_STATUS'] . '">'; if ($res['LOCK_STATUS'] == "yellow") { $aCols["NAME"]['status'] .= '[' . GetMessage("IBLOCK_YELLOW_MSG") . ']'; } else { if (!is_array($res['WF_LOCKED_BY']) && intval($res['WF_LOCKED_BY']) > 0) { $rUserLockedBy = CUser::GetByID($res['WF_LOCKED_BY']); $res['WF_LOCKED_BY'] = $rUserLockedBy->Fetch(); } if (isset($res['WF_LOCKED_BY']['ID']) && $res['WF_LOCKED_BY']['ID'] > 0) { $res['LOCKED_USER_NAME'] = CUser::FormatName($nameTemplate, $res['WF_LOCKED_BY']); $aCols["NAME"]['status'] .= '[' . trim(GetMessage("IBLOCK_RED_MSG", array('#NAME#' => $res['LOCKED_USER_NAME']))) . ']'; } else { $aCols["NAME"]['status'] .= '[' . GetMessage("IBLOCK_RED_MSG_OTHER") . ']'; } } $aCols["NAME"]['status'] .= '</div>'; } if ($arParams["USE_COMMENTS"] == "Y" && intVal($res["PROPERTY_FORUM_MESSAGE_CNT_VALUE"]) > 0) { $aCols["NAME"]['comments'] = '<a href="' . $res["URL"]["VIEW"] . '?webdavForm' . $arParams["IBLOCK_ID"] . '_active_tab=tab_comments" class="element-properties element-comments" title="' . GetMessage("WD_COMMENTS_FOR_DOCUMENT") . " " . intVal($res["PROPERTY_FORUM_MESSAGE_CNT_VALUE"]) . '">' . intVal($res["PROPERTY_FORUM_MESSAGE_CNT_VALUE"]) . '</a>'; } $aCols["PROPERTY_FORUM_MESSAGE_CNT"] = '<a href="' . $res["URL"]["VIEW"] . '">' . intVal($res["PROPERTY_FORUM_MESSAGE_CNT_VALUE"]) . '</a>'; $aCols["BP_PUBLISHED"] = "<div class=\"wd-bp-published wd-bp-published-" . ($res["BP_PUBLISHED"] != "Y" ? "n" : "y") . "\"></div>"; $aCols["NAME"]["version"] = ""; if ($arParams["WORKFLOW"] == "bizproc" && $res["WF_PARENT_ELEMENT_ID"] > 0) { $aCols["NAME"]["version"] = "<span class=\"wd-element-version\">" . GetMessage("WD_NAME_VERSION") . "</span>"; } $aCols["BIZPROC"] = ""; if ($arParams["WORKFLOW"] == "bizproc" && !empty($res["arDocumentStates"])) { $arDocumentStates = $res["arDocumentStates"]; if (count($arDocumentStates) == 1) { $arDocumentState = reset($arDocumentStates); $arTasksWorkflow = CBPDocument::GetUserTasksForWorkflow($GLOBALS["USER"]->GetID(), $arDocumentState["ID"]); $aColss["BIZPROC"] = '<div class="bizproc-item-title">' . (!empty($arDocumentState["TEMPLATE_NAME"]) ? htmlspecialcharsbx(htmlspecialcharsbx($arDocumentState["TEMPLATE_NAME"])) : GetMessage("IBLIST_BP")) . ': ' . '<span class="bizproc-item-title bizproc-state-title" style="">' . '<a href="' . $res["URL"]["BP"] . '">' . (strlen($arDocumentState["STATE_TITLE"]) > 0 ? htmlspecialcharsbx(htmlspecialcharsbx($arDocumentState["STATE_TITLE"])) : htmlspecialcharsbx(htmlspecialcharsbx($arDocumentState["STATE_NAME"]))) . '</a>' . '</span>' . '</div>'; $aColss["BIZPROC"] = str_replace("'", "\"", $aColss["BIZPROC"]); $aCols["NAME"]['bizproc'] = "<div class=\"element-bizproc-status bizproc-statuses " . (!(strlen($arDocumentState["ID"]) <= 0 || strlen($arDocumentState["WORKFLOW_STATUS"]) <= 0) ? 'bizproc-status-' . (empty($arTasksWorkflow) ? "inprogress" : "attention") : '') . "\" onmouseover='BX.hint(this, \"" . addslashes($aColss["BIZPROC"]) . "\")'></div>"; if (!empty($arTasksWorkflow)) { $tmp = array(); foreach ($arTasksWorkflow as $key => $val) { $url = CComponentEngine::MakePathFromTemplate($arParams["WEBDAV_TASK_URL"], array("ELEMENT_ID" => $res["ID"], "ID" => $val["ID"])); $url = WDAddPageParams($url, array("back_url" => urlencode($GLOBALS['APPLICATION']->GetCurPageParam())), false); $tmp[] = '<a href="' . $url . '">' . $val["NAME"] . '</a>'; } $aColss["BIZPROC"] .= '<div class="bizproc-tasks">' . implode(", ", $tmp) . '</div>'; } } else { $arTasks = array(); $bInprogress = false; $tmp = array(); foreach ($arDocumentStates as $key => $arDocumentState) { $arTasksWorkflow = CBPDocument::GetUserTasksForWorkflow($GLOBALS["USER"]->GetID(), $arDocumentState["ID"]); if (!$bInprogress) { $bInprogress = strlen($arDocumentState["ID"]) > 0 && strlen($arDocumentState["WORKFLOW_STATUS"]) > 0; } $tmp[$key] = '<li class="bizproc-item">' . '<div class="bizproc-item-title">' . '<div class="bizproc-statuses ' . (strlen($arDocumentState["ID"]) > 0 && strlen($arDocumentState["WORKFLOW_STATUS"]) > 0 ? 'bizproc-status-' . (empty($arTasksWorkflow) ? "inprogress" : "attention") : '') . '"></div>' . (!empty($arDocumentState["TEMPLATE_NAME"]) ? $arDocumentState["TEMPLATE_NAME"] : GetMessage("IBLIST_BP")) . '</div>' . '<div class="bizproc-item-title bizproc-state-title">' . (strlen($arDocumentState["STATE_TITLE"]) > 0 ? $arDocumentState["STATE_TITLE"] : $arDocumentState["STATE_NAME"]) . '</div>'; if (!empty($arTasksWorkflow)) { $tmp_tasks = array(); foreach ($arTasksWorkflow as $val) { $url = CComponentEngine::MakePathFromTemplate($arParams["WEBDAV_TASK_URL"], array("ELEMENT_ID" => $res["ID"], "ID" => $val["ID"])); $url = WDAddPageParams($url, array("back_url" => urlencode($GLOBALS['APPLICATION']->GetCurPageParam())), false); $tmp_tasks[] = '<a href="' . $url . '">' . $val["NAME"] . '</a>'; $arTasks[] = $val; } $tmp[$key] .= '<div class="bizproc-tasks">' . implode(", ", $tmp_tasks) . '</div>'; } $tmp[$key] .= '</li>'; } $aColss["BIZPROC"] = '<span class="bizproc-item-title">' . GetMessage("WD_BP_R_P") . ': <a href="' . $res["URL"]["BP"] . '" title="' . GetMessage("WD_BP_R_P_TITLE") . '">' . count($arDocumentStates) . '</a>' . '</span>' . (!empty($arTasks) ? '<br /><span class="bizproc-item-title">' . GetMessage("WD_TASKS") . ': <a href="' . $res["URL"]["BP_TASK"] . '" title="' . GetMessage("WD_TASKS_TITLE") . '">' . count($arTasks) . '</a></span>' : ''); $aCols["NAME"]['bizproc'] = "<div class=\"element-bizproc-status bizproc-statuses " . ($bInprogress ? ' bizproc-status-' . (empty($arTasks) ? "inprogress" : "attention") : '') . "\" onmouseover='BX.hint(this, \"" . addslashes($aColss['BIZPROC']) . "\")'></div>"; } $aCols['BIZPROC'] = $aColss['BIZPROC']; } } $aCols["ACTIVE"] = $res["ACTIVE"] == "Y" ? GetMessage("WD_Y") : GetMessage("WD_N"); $aCols["TIMESTAMP_X"] = "<div class='wd_column_date'>" . FormatDate('X', MakeTimeStamp($res["TIMESTAMP_X"])) . "</div>"; $aCols["DATE_CREATE"] = "<div class='wd_column_date'>" . FormatDate('X', MakeTimeStamp($res["DATE_CREATE"])) . "</div>"; $sName = ''; $sRating = ''; if ($res['TYPE'] != 'S') { if ($arParams["SHOW_RATING"] == 'Y' && $arParams["RATING_TAG"] == 'Y') { $sRating = "#RATING#"; } $aCols["NAME"] = $aCols["NAME"]["hint"] . "<div class=\"element-name\">" . $aCols["NAME"]["icon"] . $aCols["NAME"]["shared"] . "<div class=\"element-name-wrapper\">" . $aCols["NAME"]["name"] . $aCols["NAME"]["version"] . CWebDavExtLinks::$icoRepStr . $aCols["NAME"]["comments"] . $sRating . $aCols["NAME"]["status"] . "</div>" . $aCols["NAME"]["bizproc"] . "</div>"; } if ($bTheFirstTimeonPage == true && $res["PERMISSION"] >= "U") { $bTheFirstTimeonPage = false; ?> <script> try { if (/*@cc_on ! @*/ false && new ActiveXObject("SharePoint.OpenDocuments.2")) { BX.ready( function() { setTimeout( function () { try { var res = document.getElementsByTagName("A"); for (var ii = 0; ii < res.length; ii++) { if (res[ii].className.indexOf("element-edit-office") >= 0) { res[ii].style.display = 'block'; } } } catch(e) {} } , 10 ) } ); } } catch(e) {} BX.message({ 'wd_desktop_disk_is_installed': '<?php echo (bool) CWebDavTools::isDesktopDiskInstall(); ?> ' }); </script> <?php } return array("actions" => $arActions, "columns" => $aCols); }
static function _MakeJson($arData, $bWS, $bSkipTilda) { static $aSearch = array("\r", "\n"); if (is_array($arData)) { if ($arData == array_values($arData)) { foreach ($arData as $key => $value) { if (is_array($value)) { $arData[$key] = self::_MakeJson($value, $bWS, $bSkipTilda); } elseif (is_bool($value)) { if ($value === true) { $arData[$key] = "true"; } else { $arData[$key] = "false"; } } elseif (is_integer($value)) { $res .= $value; } else { if (preg_match("#['\"\\n\\r<\\\\]#", $value)) { $arData[$key] = "\"" . CUtil::JSEscape($value) . "\""; } else { $arData[$key] = "\"" . $value . "\""; } } } return '[' . implode(',', $arData) . ']'; } $sWS = ',' . ($bWS ? "\n" : ''); $res = ($bWS ? "\n" : '') . '{'; $first = true; foreach ($arData as $key => $value) { if ($bSkipTilda && substr($key, 0, 1) == '~') { continue; } if ($first) { $first = false; } else { $res .= $sWS; } if (preg_match("#['\"\\n\\r<\\\\]#", $key)) { $res .= "\"" . str_replace($aSearch, '', CUtil::addslashes($key)) . "\":"; } else { $res .= "\"" . $key . "\":"; } if (is_array($value)) { $res .= self::_MakeJson($value, $bWS, $bSkipTilda); } elseif (is_bool($value)) { if ($value === true) { $res .= "true"; } else { $res .= "false"; } } elseif (is_integer($value)) { $res .= $value; } else { if (preg_match("#['\"\\n\\r<\\\\]#", $value)) { $res .= "\"" . CUtil::JSEscape($value) . "\""; } else { $res .= "\"" . $value . "\""; } } } $res .= ($bWS ? "\n" : '') . '}'; return $res; } elseif (is_bool($arData)) { if ($arData === true) { return 'true'; } else { return 'false'; } } elseif (is_integer($value)) { return $value; } else { if (preg_match("#['\"\\n\\r<\\\\]#", $arData)) { return "\"" . CUtil::JSEscape($arData) . "'"; } else { return "\"" . $arData . "\""; } } }
{ if($arRightSet["IS_INHERITED"] <> "Y") { ?> <tr> <td style="width:40%!important; text-align:right; vertical-align:middle"><?echo htmlspecialcharsex($arNames[$arRightSet["GROUP_CODE"]]["provider"]." ".$arNames[$arRightSet["GROUP_CODE"]]["name"])?>:</td> <td align="left"> <input type="hidden" name="<?echo $html_var_name?>[][RIGHT_ID]" value="<?echo htmlspecialcharsbx($RIGHT_ID)?>"> <input type="hidden" name="<?echo $html_var_name?>[][GROUP_CODE]" value="<?echo htmlspecialcharsbx($arRightSet["GROUP_CODE"])?>"> <select name="<?echo $html_var_name?>[][TASK_ID]" style="vertical-align:middle"> <?foreach($arPossibleRights as $value => $title):?> <option value="<?echo htmlspecialcharsbx($value)?>" <?if($value == $arRightSet["TASK_ID"]) echo "selected"?>><?echo htmlspecialcharsex($title)?></option> <?endforeach?> </select> <a href="javascript:void(0);" onclick="JCIBlockAccess.DeleteRow(this, '<?php echo htmlspecialcharsbx(CUtil::addslashes($arRightSet["GROUP_CODE"])); ?> ', '<?php echo CUtil::JSEscape($variable_name); ?> ')" class="access-delete"></a> <?if($bDefault):?> <span title="<?echo GetMessage("IBLOCK_AT_OVERWRITE_TIP")?>"><? if( is_array($arRightSet["OVERWRITED"]) && $arRightSet["OVERWRITED"][0] > 0 && $arRightSet["OVERWRITED"][1] > 0 ) { ?> <br><input name="<?echo $html_var_name?>[][DO_CLEAN]" value="Y" type="checkbox"><?echo GetMessage("IBLOCK_AT_OVERWRITE_1")?> (<?echo intval($arRightSet["OVERWRITED"][0]+$arRightSet["OVERWRITED"][1])?>)
protected static function LearningShowRights($lessonId, $variable_name, $arBaseRights, $arPossibleRights, $arActualRights, $arSelected = array(), $arHighLight = array(), $readOnly) { $js_var_name = preg_replace("/[^a-zA-Z0-9_]/", "_", $variable_name); $html_var_name = htmlspecialcharsbx($variable_name); $sSelect = '<select name="' . $html_var_name . '[][TASK_ID]" style="vertical-align:middle">'; foreach ($arPossibleRights as $taskId => $arRightsData) { $selected = ''; if (strtoupper($arRightsData['name']) === 'LEARNING_LESSON_ACCESS_DENIED') { $selected = ' selected="selected" '; } $sSelect .= '<option value="' . (int) $taskId . '" ' . $selected . '>' . htmlspecialcharsex($arRightsData['name_human']) . '</option>'; } $sSelect .= '</select>'; $table_id = $variable_name . "_table"; $href_id = $variable_name . "_href"; CJSCore::Init(array('access')); ?> <tr> <td colspan="2" align="center"> <input type="hidden" name="<?php echo $variable_name . '_marker'; ?> " value='yeah!'> <script type="text/javascript"> var obLearningJSRightsAccess_<?php echo $js_var_name; ?> = new LearningJSRightsAccess( <?php echo intval($lessonId); ?> , <?php echo CUtil::PhpToJsObject($arSelected); ?> , '<?php echo CUtil::JSEscape($variable_name); ?> ', '<?php echo CUtil::JSEscape($table_id); ?> ', '<?php echo CUtil::JSEscape($href_id); ?> ', '<?php echo CUtil::JSEscape($sSelect); ?> ', <?php echo CUtil::PhpToJsObject($arHighLight); ?> ); </script> <h3><?php echo GetMessage('LEARNING_RIGHTS_FOR_ADMINISTRATION'); ?> </h3> <table width="100%" cellpadding="0" cellspacing="10" border="0" id="<?php echo htmlspecialcharsbx($table_id); ?> " align="center"> <?php $access = new CAccess(); // If rights are for lesson => show base rights if ($lessonId !== false) { $arBaseNames = $access->GetNames(array_keys($arBaseRights)); foreach ($arBaseRights as $symbol => $taskId) { if ($taskId <= 0) { continue; } ?> <tr valign="top"> <td align="right"><?php echo htmlspecialcharsex($arBaseNames[$symbol]['provider'] . ' ' . $arBaseNames[$symbol]['name']); ?> : </td> <td align="left"> <?php echo htmlspecialcharsex(CLearnAccess::GetNameForTask($taskId)); ?> </td> </tr> <?php } } $arNames = $access->GetNames(array_keys($arActualRights)); foreach ($arActualRights as $symbol => $taskId) { if ($taskId <= 0) { continue; } ?> <tr valign="top"> <td align="right"> <div style="padding-top:8px;"> <span href="javascript:void(0);" onclick="LearningJSRightsAccess.DeleteRow( this, '<?php echo htmlspecialcharsbx(CUtil::addslashes($symbol)); ?> ', '<?php echo CUtil::JSEscape($html_var_name); ?> ')" class="access-delete" style="position:relative; top:1px; margin-right:3px;" ></span><?php if (strlen($arNames[$symbol]['provider'])) { echo htmlspecialcharsex($arNames[$symbol]['provider'] . ' ' . $arNames[$symbol]['name']); } else { echo htmlspecialcharsex($arNames[$symbol]['name']); } ?> : </div> </td> <td align="left"> <?php if ($readOnly) { echo htmlspecialcharsex(CLearnAccess::GetNameForTask($taskId)); } else { ?> <input type="hidden" name="<?php echo $html_var_name; ?> [][GROUP_CODE]" value="<?php echo htmlspecialcharsbx($symbol); ?> "> <div style="min-width:720px;"> <select name="<?php echo $html_var_name; ?> [][TASK_ID]" style="vertical-align:middle"> <?php foreach ($arPossibleRights as $id => $arRightsData) { ?> <option value="<?php echo (int) $id; ?> " <?php if ($id == $taskId) { echo "selected"; } ?> ><?php echo htmlspecialcharsex(CLearnAccess::GetNameForTask($id)); ?> </option> <?php } ?> </select> </div> <?php } ?> </td> </tr> <?php } if (!$readOnly) { ?> <tr> <td width="40%" align="right"> </td> <td width="60%" align="left"> <a href="javascript:void(0)" id="<?php echo htmlspecialcharsbx($href_id); ?> " class="bx-action-href"><?php echo GetMessage("LEARNING_RIGHTS_ADD"); ?> </a> </td> </tr> <?php } ?> </table> <br> <strong><?php echo GetMessage('LEARNING_RIGHTS_NOTE'); ?> </strong> </td> </tr> <?php }
} } } if (!$bizProcIndex) { $arTab2Fields[] = array("id" => "BIZPROC_NO", "name" => GetMessage("CT_BLEE_BIZPROC_NA_LABEL"), "type" => "label", "value" => GetMessage("CT_BLEE_BIZPROC_NA")); } $custom_html .= '<input type="hidden" name="bizproc_index" value="' . $bizProcIndex . '">'; if ($arResult["ELEMENT_ID"]) { $bStartWorkflowPermission = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::StartWorkflow, $USER->GetID(), BizProcDocument::getDocumentComplexId($arParams["IBLOCK_TYPE_ID"], $arResult["ELEMENT_ID"]), array("AllUserGroups" => $arCurrentUserGroups, "DocumentStates" => $arDocumentStates, "WorkflowId" => $arDocumentState["TEMPLATE_ID"])); if ($bStartWorkflowPermission) { $arTab2Fields[] = array("id" => "BIZPROC_NEW", "name" => GetMessage("CT_BLEE_BIZPROC_NEW"), "type" => "section"); $backUrl = CHTTP::urlAddParams($APPLICATION->GetCurPageParam("", array($arResult["FORM_ID"] . "_active_tab")), array($arResult["FORM_ID"] . "_active_tab" => "tab_bp")); $url = CHTTP::urlAddParams(str_replace(array("#list_id#", "#section_id#", "#element_id#", "#group_id#"), array($arResult["IBLOCK_ID"], intval($arResult["SECTION_ID"]), $arResult["ELEMENT_ID"], $arParams["SOCNET_GROUP_ID"]), $arParams["~BIZPROC_WORKFLOW_START_URL"]), array("back_url" => $backUrl, "sessid" => bitrix_sessid()), array("skip_empty" => true, "encode" => true)); $arTab2Fields[] = array("id" => "BIZPROC_NEW_START", "name" => GetMessage("CT_BLEE_BIZPROC_START"), "type" => "custom", "colspan" => true, "value" => '<a href="' . htmlspecialcharsbx($url) . '">' . GetMessage("CT_BLEE_BIZPROC_START") . '</a>'); } } $arTabs[] = array("id" => "tab_bp", "name" => GetMessage("CT_BLEE_BIZPROC_TAB"), "icon" => "", "fields" => $arTab2Fields); } if (isset($arResult["RIGHTS"])) { ob_start(); IBlockShowRights('element', $arResult["IBLOCK_ID"], $arResult["ELEMENT_ID"], "", "RIGHTS", $arResult["TASKS"], $arResult["RIGHTS"], true, $arResult["ELEMENT_ID"] <= 0, $arResult["SELECTED"], $arResult["HIGHLIGHT"]); $rights_html = ob_get_contents(); ob_end_clean(); $rights_fields = array(array("id" => "RIGHTS", "name" => GetMessage("CT_BLEE_ACCESS_RIGHTS"), "type" => "custom", "colspan" => true, "value" => $rights_html)); $arTabs[] = array("id" => "tab_rights", "name" => GetMessage("CT_BLEE_TAB_ACCESS"), "icon" => "", "fields" => $rights_fields); } $custom_html .= '<input type="hidden" name="action" id="action" value="">'; if (!$arParams["CAN_EDIT"]) { $custom_html .= '<input type="button" value="' . GetMessage("CT_BLEE_FORM_CANCEL") . '" name="cancel" onclick="window.location=\'' . htmlspecialcharsbx(CUtil::addslashes($arResult["~LIST_SECTION_URL"])) . '\'" title="' . GetMessage("CT_BLEE_FORM_CANCEL_TITLE") . '" />'; } $APPLICATION->IncludeComponent("bitrix:main.interface.form", "", array("FORM_ID" => $arResult["FORM_ID"], "TABS" => $arTabs, "BUTTONS" => array("standard_buttons" => $arParams["CAN_EDIT"], "back_url" => $arResult["~LIST_SECTION_URL"], "custom_html" => $custom_html), "DATA" => $arResult["FORM_DATA"], "SHOW_SETTINGS" => "N", "THEME_GRID_ID" => $arResult["GRID_ID"]), $component, array("HIDE_ICONS" => "Y"));
?> '; oText['quote_text'] = '<?php echo CUtil::addslashes(GetMessage("JQOUTE_AUTHOR_WRITES")); ?> '; oText['show'] = '<?php echo CUtil::addslashes(GetMessage("F_SHOW")); ?> '; oText['hide'] = '<?php echo CUtil::addslashes(GetMessage("F_HIDE")); ?> '; oText['wait'] = '<?php echo CUtil::addslashes(GetMessage("F_WAIT")); ?> '; if (typeof phpVars != "object") var phpVars = {}; phpVars.bitrix_sessid = '<?php echo bitrix_sessid(); ?> '; if (typeof oForum != "object") var oForum = {}; oForum.page_number = <?php echo intval($arResult['PAGE_NUMBER']); ?> ;
function IncludeFile($rel_path, $arParams = array(), $arFunctionParams = array()) { /** @global CMain $APPLICATION */ /** @noinspection PhpUnusedLocalVariableInspection */ global $APPLICATION, $USER, $DB, $MESS, $DOCUMENT_ROOT; if ($_SESSION["SESS_SHOW_INCLUDE_TIME_EXEC"] == "Y" && ($USER->CanDoOperation('edit_php') || $_SESSION["SHOW_SQL_STAT"] == "Y")) { $debug = new CDebugInfo(); $debug->Start(); } elseif ($APPLICATION->ShowIncludeStat) { $debug = new CDebugInfo(); $debug->Start(); } else { $debug = null; } $sType = "TEMPLATE"; $bComponent = false; if (substr($rel_path, 0, 1) != "/") { $bComponent = true; $path = BX_PERSONAL_ROOT . "/templates/" . SITE_TEMPLATE_ID . "/" . $rel_path; if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $path)) { $sType = "DEFAULT"; $path = BX_PERSONAL_ROOT . "/templates/.default/" . $rel_path; if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $path)) { $path = BX_PERSONAL_ROOT . "/templates/" . SITE_TEMPLATE_ID . "/" . $rel_path; $module_id = substr($rel_path, 0, strpos($rel_path, "/")); if (strlen($module_id) > 0) { $path = "/bitrix/modules/" . $module_id . "/install/templates/" . $rel_path; $sType = "MODULE"; if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $path)) { $sType = "TEMPLATE"; $path = BX_PERSONAL_ROOT . "/templates/" . SITE_TEMPLATE_ID . "/" . $rel_path; } } } } } else { $path = $rel_path; } if ($arFunctionParams["WORKFLOW"] && !IsModuleInstalled("workflow")) { $arFunctionParams["WORKFLOW"] = false; } elseif ($sType != "TEMPLATE" && $arFunctionParams["WORKFLOW"]) { $arFunctionParams["WORKFLOW"] = false; } $bDrawIcons = $arFunctionParams["SHOW_BORDER"] !== false && $APPLICATION->GetShowIncludeAreas() && ($USER->CanDoFileOperation('fm_edit_existent_file', array(SITE_ID, $path)) || $arFunctionParams["WORKFLOW"] && $USER->CanDoFileOperation('fm_edit_in_workflow', array(SITE_ID, $path))); if ($bDrawIcons) { $path_url = "path=" . $path; $encSiteTemplateId = urlencode(SITE_TEMPLATE_ID); $editor = ''; $resize = 'false'; $iSrcLine = 0; $sSrcFile = ''; if (!in_array($arFunctionParams['MODE'], array('html', 'text', 'php'))) { $arFunctionParams['MODE'] = $bComponent ? 'php' : 'html'; } if ($sType != 'TEMPLATE') { switch ($arFunctionParams['MODE']) { case 'html': $editor = "/bitrix/admin/fileman_html_edit.php?site=" . SITE_ID . "&"; break; case 'text': $editor = "/bitrix/admin/fileman_file_edit.php?site=" . SITE_ID . "&"; break; case 'php': $editor = "/bitrix/admin/fileman_file_edit.php?full_src=Y&site=" . SITE_ID . "&"; break; } $editor .= "templateID=" . $encSiteTemplateId . "&"; } else { switch ($arFunctionParams['MODE']) { case 'html': $editor = '/bitrix/admin/public_file_edit.php?bxpublic=Y&from=includefile&templateID=' . $encSiteTemplateId . '&'; $resize = 'false'; break; case 'text': $editor = '/bitrix/admin/public_file_edit.php?bxpublic=Y&from=includefile&noeditor=Y&'; $resize = 'true'; break; case 'php': $editor = '/bitrix/admin/public_file_edit_src.php?templateID=' . $encSiteTemplateId . '&'; $resize = 'true'; break; } } if ($arFunctionParams["TEMPLATE"]) { $arFunctionParams["TEMPLATE"] = "&template=" . urlencode($arFunctionParams["TEMPLATE"]); } if ($arFunctionParams["BACK_URL"]) { $arFunctionParams["BACK_URL"] = "&back_url=" . urlencode($arFunctionParams["BACK_URL"]); } else { $arFunctionParams["BACK_URL"] = "&back_url=" . urlencode($_SERVER["REQUEST_URI"]); } if ($arFunctionParams["LANG"]) { $arFunctionParams["LANG"] = "&lang=" . urlencode($arFunctionParams["LANG"]); } else { $arFunctionParams["LANG"] = "&lang=" . LANGUAGE_ID; } $arIcons = array(); $arPanelParams = array(); $bDefaultExists = false; if ($USER->CanDoOperation('edit_php') && $bComponent && function_exists("debug_backtrace")) { $bDefaultExists = true; $arPanelParams["TOOLTIP"] = array('TITLE' => GetMessage("main_incl_component1"), 'TEXT' => $rel_path); $aTrace = debug_backtrace(); $sSrcFile = $aTrace[0]["file"]; $iSrcLine = intval($aTrace[0]["line"]); $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => "/bitrix/admin/component_props.php?" . "path=" . urlencode(CUtil::addslashes($rel_path)) . "&template_id=" . urlencode(CUtil::addslashes(SITE_TEMPLATE_ID)) . "&lang=" . LANGUAGE_ID . "&src_path=" . urlencode(CUtil::addslashes($sSrcFile)) . "&src_line=" . $iSrcLine . "")), 'ICON' => "parameters", 'TITLE' => GetMessage("main_incl_file_comp_param"), 'DEFAULT' => true); } if ($sType == "MODULE") { $arIcons[] = array('URL' => 'javascript:if(confirm(\'' . GetMessage("MAIN_INC_BLOCK_MODULE") . '\'))window.location=\'' . $editor . '&path=' . urlencode(BX_PERSONAL_ROOT . '/templates/' . SITE_TEMPLATE_ID . '/' . $rel_path) . $arFunctionParams["BACK_URL"] . $arFunctionParams["LANG"] . '&template=' . $path . '\';', 'ICON' => 'copy', 'TITLE' => str_replace("#MODE#", $arFunctionParams["MODE"], str_replace("#BLOCK_TYPE#", !is_set($arFunctionParams, "NAME") ? GetMessage("MAIN__INC_BLOCK") : $arFunctionParams["NAME"], GetMessage("main_incl_file_edit_copy")))); } elseif ($sType == "DEFAULT") { $arIcons[] = array('URL' => 'javascript:if(confirm(\'' . GetMessage("MAIN_INC_BLOCK_COMMON") . '\'))window.location=\'' . $editor . $path_url . $arFunctionParams["BACK_URL"] . $arFunctionParams["LANG"] . $arFunctionParams["TEMPLATE"] . '\';', 'ICON' => 'edit-common', 'TITLE' => str_replace("#MODE#", $arFunctionParams["MODE"], str_replace("#BLOCK_TYPE#", !is_set($arFunctionParams, "NAME") ? GetMessage("MAIN__INC_BLOCK") : $arFunctionParams["NAME"], GetMessage("MAIN_INC_BLOCK_EDIT")))); $arIcons[] = array('URL' => $editor . '&path=' . urlencode(BX_PERSONAL_ROOT . '/templates/' . SITE_TEMPLATE_ID . '/' . $rel_path) . $arFunctionParams["BACK_URL"] . $arFunctionParams["LANG"] . '&template=' . $path, 'ICON' => 'copy', 'TITLE' => str_replace("#MODE#", $arFunctionParams["MODE"], str_replace("#BLOCK_TYPE#", !is_set($arFunctionParams, "NAME") ? GetMessage("MAIN__INC_BLOCK") : $arFunctionParams["NAME"], GetMessage("MAIN_INC_BLOCK_COMMON_COPY")))); } else { $arPanelParams["TOOLTIP"] = array('TITLE' => GetMessage('main_incl_file'), 'TEXT' => $path); $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => $editor . $path_url . $arFunctionParams["BACK_URL"] . $arFunctionParams["LANG"] . $arFunctionParams["TEMPLATE"], "PARAMS" => array('width' => 770, 'height' => 470, 'resize' => $resize))), 'ICON' => 'bx-context-toolbar-edit-icon', 'TITLE' => str_replace("#MODE#", $arFunctionParams["MODE"], str_replace("#BLOCK_TYPE#", !is_set($arFunctionParams, "NAME") ? GetMessage("MAIN__INC_BLOCK") : $arFunctionParams["NAME"], GetMessage("MAIN_INC_ED"))), 'DEFAULT' => !$bDefaultExists); if ($arFunctionParams["WORKFLOW"]) { $arIcons[] = array('URL' => '/bitrix/admin/workflow_edit.php?' . $arFunctionParams["LANG"] . '&fname=' . urlencode($path) . $arFunctionParams["TEMPLATE"] . $arFunctionParams["BACK_URL"], 'ICON' => 'bx-context-toolbar-edit-icon', 'TITLE' => str_replace("#BLOCK_TYPE#", !is_set($arFunctionParams, "NAME") ? GetMessage("MAIN__INC_BLOCK") : $arFunctionParams["NAME"], GetMessage("MAIN_INC_ED_WF"))); } } echo $this->IncludeStringBefore(); } $res = null; if (is_file($_SERVER["DOCUMENT_ROOT"] . $path)) { if (is_array($arParams)) { extract($arParams, EXTR_SKIP); } $res = (include $_SERVER["DOCUMENT_ROOT"] . $path); } if ($_SESSION["SESS_SHOW_INCLUDE_TIME_EXEC"] == "Y" && ($USER->CanDoOperation('edit_php') || $_SESSION["SHOW_SQL_STAT"] == "Y")) { echo $debug->Output($rel_path, $path); } elseif (is_object($debug)) { $debug->Stop($rel_path, $path); } if ($bDrawIcons) { $comp_id = $path; if ($sSrcFile) { $comp_id .= '|' . $sSrcFile; } if ($iSrcLine) { $comp_id .= '|' . $iSrcLine; } $arPanelParams['COMPONENT_ID'] = md5($comp_id); echo $this->IncludeStringAfter($arIcons, $arPanelParams); } return $res; }
echo GetMessageJS("JQOUTE_AUTHOR_WRITES"); ?> :\n', f_cdm : '<?php echo GetMessageJS("F_DELETE_CONFIRM"); ?> ', f_show : '<?php echo GetMessageJS("F_SHOW"); ?> ', f_hide : '<?php echo GetMessageJS("F_HIDE"); ?> ', f_wait : '<?php echo GetMessageJS("F_WAIT"); ?> ', MINIMIZED_EXPAND_TEXT : '<?php echo CUtil::addslashes($arParams["MINIMIZED_EXPAND_TEXT"]); ?> ', MINIMIZED_MINIMIZE_TEXT : '<?php echo CUtil::addslashes($arParams["MINIMIZED_MINIMIZE_TEXT"]); ?> ' }); </script> <?php include __DIR__ . "/form.php";
function TxtToHTML($str, $bMakeUrls = true, $iMaxStringLen = 0, $QUOTE_ENABLED = "N", $NOT_CONVERT_AMPERSAND = "Y", $CODE_ENABLED = "N", $BIU_ENABLED = "N", $quote_table_class = "quotetable", $quote_head_class = "tdquotehead", $quote_body_class = "tdquote", $code_table_class = "codetable", $code_head_class = "tdcodehead", $code_body_class = "tdcodebody", $code_textarea_class = "codetextarea", $link_class = "txttohtmllink", $arUrlEvent = array(), $link_target = "_self") { global $QUOTE_ERROR, $QUOTE_OPENED, $QUOTE_CLOSED; $QUOTE_ERROR = $QUOTE_OPENED = $QUOTE_CLOSED = 0; $str = delete_special_symbols($str); //echo "\n<br>=====================\n<br><pre>".htmlspecialcharsbx($str)."</pre>\n<br>=======================\n<br>"; // вставим спецсимвол chr(2) там где в дальнейшем необходимо вставить пробел if ($iMaxStringLen > 0) { $str = InsertSpaces($str, $iMaxStringLen, chr(2), true); } // \ => chr(8) $str = str_replace("\\", chr(8), $str); // спецсимвол заменяющий слэш "\" // <quote>...</quote> => [quote]...[/quote] if ($QUOTE_ENABLED == "Y") { $str = preg_replace("#(?:<|\\[)(/?)quote(.*?)(?:>|\\])#is", " [\\1quote]", $str); } // <code>...</code> => [code]...[/code] // \n => chr(4) // \r => chr(5) if ($CODE_ENABLED == "Y") { $str = preg_replace("#<code(\\s+[^>]*>|>)(.+?)</code(\\s+[^>]*>|>)#is", "[code]\\2[/code]", $str); $str = preg_replace("#\\[code(\\s+[^\\]]*\\]|\\])(.+?)\\[/code(\\s+[^\\]]*\\]|\\])#ies", "convert_code_tag_for_html_before('\\2')", $str); } // <b>...</b> => [b]...[/b] // <i>...</i> => [i]...[/i] // <u>...</u> => [u]...[/u] if ($BIU_ENABLED == "Y") { $str = preg_replace("#<b(\\s+[^>]*>|>)(.+?)</b(\\s+[^>]*>|>)#is", "[b]\\2[/b]", $str); $str = preg_replace("#<i(\\s+[^>]*>|>)(.+?)</i(\\s+[^>]*>|>)#is", "[i]\\2[/i]", $str); $str = preg_replace("#<u(\\s+[^>]*>|>)(.+?)</u(\\s+[^>]*>|>)#is", "[u]\\2[/u]", $str); } // URL => chr(1).URL."/".chr(1) // EMail => chr(3).E-Mail.chr(3) if ($bMakeUrls) { //hide @ from next regexp with chr(11) $str = preg_replace("#((http|https|ftp):\\/\\/[a-z:@,.'/\\#\\%=~\\&?*+\\[\\]_0-9--]+)#ies", "extract_url(str_replace('@', chr(11), '\\1'))", $str); $str = preg_replace("#(([=_\\.'0-9a-z+~--]+)@([_0-9a-z--]+\\.)+[a-z]{2,10})#is", chr(3) . "\\1" . chr(3), $str); //replace back to @ $str = str_replace(chr(11), '@', $str); } // конвертация критичных символов if ($NOT_CONVERT_AMPERSAND != "Y") { $str = str_replace("&", "&", $str); } static $search = array("<", ">", "\"", "'", "%", ")", "(", "+"); static $replace = array("<", ">", """, "'", "%", ")", "(", "+"); $str = str_replace($search, $replace, $str); // chr(1).URL."/".chr(1) => <a href="URL">URL</a> // chr(3).E-Mail.chr(3) => <a href="mailto:E-Mail">E-Mail</a> if ($bMakeUrls) { $event1 = $arUrlEvent["EVENT1"]; $event2 = $arUrlEvent["EVENT2"]; $event3 = $arUrlEvent["EVENT3"]; $script = $arUrlEvent["SCRIPT"]; $str = preg_replace("#([^\n]+?)/#ies", "convert_to_href('\\1', '" . CUtil::addslashes($link_class) . "', '" . CUtil::addslashes($event1) . "', '" . CUtil::addslashes($event2) . "', '" . CUtil::addslashes($event3) . "', '" . CUtil::addslashes($script) . "', '" . CUtil::addslashes($link_target) . "')", $str); $str = preg_replace("#([^\n]+?)#ies", "convert_to_mailto('\\1', '" . CUtil::addslashes($link_class) . "')", $str); } $str = str_replace("\r\n", "\n", $str); $str = str_replace("\n", "<br />\n", $str); $str = preg_replace("# {2}#", " ", $str); $str = preg_replace("#\t#", " ", $str); // chr(2) => " " if ($iMaxStringLen > 0) { $str = str_replace(chr(2), "<wbr>", $str); } // [quote]...[/quote] => <table>...</table> if ($QUOTE_ENABLED == "Y") { $str = preg_replace("#(\\[quote(.*?)\\](.*)\\[/quote(.*?)\\])#ies", "convert_quote_tag('\\1', '" . CUtil::addslashes($quote_table_class) . "', '" . CUtil::addslashes($quote_head_class) . "', '" . CUtil::addslashes($quote_body_class) . "')", $str); } // [code]...[/code] => <textarea>...</textarea> // chr(4) => \n // chr(5) => \r if ($CODE_ENABLED == "Y") { $str = preg_replace("#\\[code\\](.*?)\\[/code\\]#ies", "convert_code_tag_for_html_after('\\1', '" . CUtil::addslashes($code_table_class) . "', '" . CUtil::addslashes($code_head_class) . "', '" . CUtil::addslashes($code_body_class) . "', '" . CUtil::addslashes($code_textarea_class) . "')", $str); $str = str_replace(chr(4), "\n", $str); $str = str_replace(chr(5), "\r", $str); $str = str_replace(chr(6), " ", $str); $str = str_replace(chr(7), "\t", $str); $str = str_replace(chr(16), "[", $str); $str = str_replace(chr(17), "]", $str); } // [b]...[/b] => <b>...</b> // [i]...[/i] => <i>...</i> // [u]...[/u] => <u>...</u> if ($BIU_ENABLED == "Y") { $str = preg_replace("#\\[b\\](.*?)\\[/b\\]#is", "<b>\\1</b>", $str); $str = preg_replace("#\\[i\\](.*?)\\[/i\\]#is", "<i>\\1</i>", $str); $str = preg_replace("#\\[u\\](.*?)\\[/u\\]#is", "<u>\\1</u>", $str); } // chr(8) => \ $str = str_replace(chr(8), "\\", $str); $str = delete_special_symbols($str); return $str; }
:"; oText['width'] = "<?php echo CUtil::addslashes(GetMessage("FORUM_WIDTH")); ?> :"; oText['height'] = "<?php echo CUtil::addslashes(GetMessage("FORUM_HEIGHT")); ?> :"; oText['BUTTON_OK'] = "<?php echo CUtil::addslashes(GetMessage("FORUM_BUTTON_OK")); ?> "; oText['BUTTON_CANCEL'] = "<?php echo CUtil::addslashes(GetMessage("FORUM_BUTTON_CANCEL")); ?> "; if (typeof oHelp != "object") var oHelp = {}; function reply2author(name) { <?php if ($arResult["FORUM"]["ALLOW_QUOTE"] == "Y") { ?> document.REPLIER.POST_MESSAGE.value += "[b]"+name+"[/b]"+" \n"; <?php } else { ?>
{ if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/fileman/lang/' . LANGUAGE_ID . '/admin/fileman_js.php')) { include $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/fileman/lang/' . LANGUAGE_ID . '/admin/fileman_js.php'; } else { include $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/fileman/lang/en/admin/fileman_js.php'; } return $MESS; } $sMess = ""; $aMess = _GtFMess(); $aMess = array_keys($aMess); IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/fileman/admin/fileman_js.php'); $l = count($aMess); for ($i = 0; $i < $l; $i++) { if (substr($aMess[$i], 0, strlen("FILEMAN_JS_")) == "FILEMAN_JS_") { $sMess .= "'" . substr($aMess[$i], strlen("FILEMAN_JS_")) . "': '" . CUtil::addslashes(GetMessage($aMess[$i])) . "',"; } } $sMess = rtrim($sMess, ','); ?> <script> var BX_MESS = {<?php echo $sMess; ?> }; function BXButtonConfig() { this.Init(); }
function Show2Images($strImage1, $strImage2, $iMaxW = 0, $iMaxH = 0, $sParams = false, $sPopupTitle = false, $iSizeWHTTP = 0, $iSizeHHTTP = 0) { if (!($arImgParams = CFile::_GetImgParams($strImage1, $iSizeWHTTP, $iSizeHHTTP))) { return ""; } $strImage1 = htmlspecialcharsbx($arImgParams["SRC"]); $intWidth = $arImgParams["WIDTH"]; $intHeight = $arImgParams["HEIGHT"]; $strAlt = $arImgParams["ALT"]; if ($sParams == false) { $sParams = 'border="0" alt="' . htmlspecialcharsEx($strAlt) . '"'; } elseif (!preg_match("/(^|\\s)alt\\s*=\\s*([\"']?)(.*?)(\\2)/is", $sParams)) { $sParams .= ' alt="' . htmlspecialcharsEx($strAlt) . '"'; } if ($iMaxW > 0 && $iMaxH > 0 && ($intWidth > $iMaxW || $intHeight > $iMaxH)) { $coeff = $intWidth / $iMaxW > $intHeight / $iMaxH ? $intWidth / $iMaxW : $intHeight / $iMaxH; $iHeight = intval(roundEx($intHeight / $coeff)); $iWidth = intval(roundEx($intWidth / $coeff)); } else { $iHeight = $intHeight; $iWidth = $intWidth; } if ($arImgParams = CFile::_GetImgParams($strImage2, $iSizeWHTTP, $iSizeHHTTP)) { if ($sPopupTitle === false) { $sPopupTitle = GetMessage("FILE_ENLARGE"); } $strImage2 = htmlspecialcharsbx($arImgParams["SRC"]); $intWidth2 = $arImgParams["WIDTH"]; $intHeight2 = $arImgParams["HEIGHT"]; $strAlt2 = $arImgParams["ALT"]; CFile::OutputJSImgShw(); $strReturn = "<a title=\"" . $sPopupTitle . "\" onclick=\"ImgShw('" . CUtil::addslashes($strImage2) . "','" . $intWidth2 . "','" . $intHeight2 . "', '" . CUtil::addslashes(htmlspecialcharsEx(htmlspecialcharsEx($strAlt2))) . "'); return false;\" href=\"" . $strImage2 . "\" target=_blank>" . "<img src=\"" . $strImage1 . "\" " . $sParams . " width=" . $iWidth . " height=" . $iHeight . " /></a>"; } else { $strReturn = "<img src=\"" . $strImage1 . "\" " . $sParams . " width=" . $iWidth . " height=" . $iHeight . " />"; } return $strReturn; }
function GetLayout() { $wizard = $this->GetWizard(); $formName = htmlspecialcharsbx($wizard->GetFormName()); CUtil::InitJSCore(array("ajax")); $adminScript = CAdminPage::ShowScript(); $charset = LANG_CHARSET; $wizardName = htmlspecialcharsEx($wizard->GetWizardName()); $nextButtonID = htmlspecialcharsbx($wizard->GetNextButtonID()); $prevButtonID = htmlspecialcharsbx($wizard->GetPrevButtonID()); $cancelButtonID = htmlspecialcharsbx($wizard->GetCancelButtonID()); $finishButtonID = htmlspecialcharsbx($wizard->GetFinishButtonID()); IncludeAJAX(); $ajaxScripts = $GLOBALS["APPLICATION"]->GetHeadStrings(); $ajaxScripts .= $GLOBALS["APPLICATION"]->GetHeadScripts(); $obStep = $wizard->GetCurrentStep(); $arErrors = $obStep->GetErrors(); $strError = $strJsError = ""; if (count($arErrors) > 0) { foreach ($arErrors as $arError) { $strError .= $arError[0] . "<br />"; if ($arError[1] !== false) { $strJsError .= ($strJsError != "" ? ", " : "") . "{'name':'" . CUtil::addslashes($wizard->GetRealName($arError[1])) . "', 'title':'" . CUtil::addslashes(htmlspecialcharsback($arError[0])) . "'}"; } } if (strlen($strError) > 0) { $strError = '<div id="step_error">' . $strError . "</div>"; } $strJsError = ' <script type="text/javascript"> ShowWarnings([' . $strJsError . ']); </script>'; } $stepTitle = $obStep->GetTitle(); $stepSubTitle = $obStep->GetSubTitle(); $autoSubmit = ""; if ($obStep->IsAutoSubmit()) { $autoSubmit = 'setTimeout("AutoSubmit();", 500);'; } $alertText = GetMessageJS("MAIN_WIZARD_WANT_TO_CANCEL"); $loadingText = GetMessageJS("MAIN_WIZARD_WAIT_WINDOW_TEXT"); $package = $wizard->GetPackage(); return <<<HTML <!DOCTYPE html> <html id="bx-admin-prefix"> <head> \t<head> \t\t<title>{$wizardName}</title> \t\t<meta http-equiv="X-UA-Compatible" content="IE=edge"> \t\t<meta http-equiv="Content-Type" content="text/html; charset={$charset}"> \t\t{$ajaxScripts} \t\t<style type="text/css"> \t\t\tbody \t\t\t{ \t\t\t\tmargin:0; \t\t\t\tpadding:0; \t\t\t\tfont-size: 13px; \t\t\t\tfont-family: "Helvetica Neue",Helvetica,Arial,sans-serif; \t\t\t} \t\t\ttable {font-size:100%;} \t\t\tform {margin:0; padding:0; } \t\t\ta { \t\t\t\tcolor: #2675D7; \t\t\t\ttext-decoration: underline; \t\t\t} \t\t\t.step-content { \t\t\t\tborder: solid 1px #DCE7ED; \t\t\t\tbackground-color: #F5F9F9; \t\t\t\theight: 347px; \t\t\t\toverflow: auto; \t\t\t} \t\t\t.step-header { \t\t\t\tborder-bottom: 1px solid #DCE7ED; \t\t\t\tfont-size: 12px; \t\t\t\tpadding: 6px 30px 9px 9px; \t\t\t\tmargin-bottom: 12px; \t\t\t} \t\t\t.step-title { font-size: 16px; } \t\t\t.step-subtitle { font-size: 13px; } \t\t\t.step-body { \t\t\t\tpadding: 0 10px; \t\t\t} \t\t\t.step-buttons \t\t\t{ \t\t\t\tpadding-top: 12px; \t\t\t\tpadding-left: 2px; \t\t\t} \t\t\t.step-buttons input { \t\t\t\t-webkit-border-radius: 4px; \t\t\t\tborder-radius: 4px; \t\t\t\tborder:none; \t\t\t\tborder-top:1px solid #fff; \t\t\t\t-webkit-box-shadow: 0 0 1px rgba(0,0,0,.11), 0 1px 1px rgba(0,0,0,.3), inset 0 1px #fff, inset 0 0 1px rgba(255,255,255,.5); \t\t\t\tbox-shadow: 0 0 1px rgba(0,0,0,.3), 0 1px 1px rgba(0,0,0,.3), inset 0 1px #fff, inset 0 0 1px rgba(255,255,255,.5); \t\t\t\tbackground-image: -webkit-linear-gradient(bottom, #d7e3e7, #fff)!important; \t\t\t\tbackground-image: -moz-linear-gradient(bottom, #d7e3e7, #fff)!important; \t\t\t\tbackground-image: -ms-linear-gradient(bottom, #d7e3e7, #fff)!important; \t\t\t\tbackground-image: -o-linear-gradient(bottom, #d7e3e7, #fff)!important; \t\t\t\tbackground-image: linear-gradient(bottom, #d7e3e7, #fff)!important; \t\t\t\tcolor:#3f4b54; \t\t\t\tcursor:pointer; \t\t\t\tdisplay:inline-block; \t\t\t\tfont-family:"Helvetica Neue",Helvetica,Arial,sans-serif; \t\t\t\tfont-weight:bold; \t\t\t\tfont-size:13px; \t\t\t\theight: 29px; \t\t\t\ttext-shadow:0 1px rgba(255,255,255,0.7); \t\t\t\ttext-decoration:none; \t\t\t\tposition:relative; \t\t\t\tvertical-align:middle; \t\t\t\t-webkit-font-smoothing: antialiased; \t\t\t\tpadding: 0 13px 2px; \t\t\t\tmargin-right: 3px; \t\t\t} \t\t\t.step-buttons input:hover { \t\t\t\ttext-decoration: none; \t\t\t\tbackground:#f3f6f7!important; \t\t\t\tbackground-image: -webkit-linear-gradient(top, #f8f8f9, #f2f6f8)!important; \t\t\t\tbackground-image: -moz-linear-gradient(top, #f8f8f9, #f2f6f8)!important; \t\t\t\tbackground-image: -ms-linear-gradient(top, #f8f8f9, #f2f6f8)!important; \t\t\t\tbackground-image: -o-linear-gradient(top, #f8f8f9, #f2f6f8)!important; \t\t\t\tbackground-image: linear-gradient(top, #f8f8f9, #f2f6f8)!important; \t\t\t} \t\t\t.step-buttons input:active { \t\t\t\t-webkit-border-radius: 4px; \t\t\t\tborder-radius: 4px; \t\t\t\tbackground-color: #b7c4c9!important; \t\t\t\t-webkit-box-shadow: inset 0 1px 1px 1px rgba(103,109,123,.78); \t\t\t\tbox-shadow: inset 0 1px 1px 1px rgba(103,109,123,.78); \t\t\t\tbackground-image: -webkit-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important; \t\t\t\tbackground-image: -moz-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important; \t\t\t\tbackground-image: -ms-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important; \t\t\t\tbackground-image: -o-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important; \t\t\t\tbackground-image: linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important; \t\t\t\tborder-top:transparent; \t\t\t\theight: 29px; \t\t\t\toutline:none; \t\t\t\tpadding:2px 13px 1px; \t\t\t} \t\t\t.bx-ie8 .step-buttons input, \t\t\t.bx-ie9 .step-buttons input { \t\t\t\tborder-radius:4px; \t\t\t\tbackground:url("/bitrix/panel/main/images/bx-admin-sprite-small-1.png") repeat-x 0 -3554px; \t\t\t\tbox-shadow:0 0 0 1px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 0 #FFFFFF inset, 0 0 1px rgba(255, 255, 255, 0.5) inset !important; \t\t\t\tline-height:16px; \t\t\t\theight:31px!important; \t\t\t\tpadding-top:6px!important; \t\t\t\tpadding-bottom:6px!important; \t\t\t\tmargin-right: 3px !important; \t\t\t} \t\t\t.bx-ie8 .step-buttons input {border:1px solid #959c9d !important;} \t\t\t#step_error \t\t\t{ \t\t\t\tcolor:red; \t\t\t\tpadding:0 0 12px 0; \t\t\t} \t\t\t#hidden-layer \t\t\t{ \t\t\t\tbackground:#F8F9FC none repeat scroll 0%; \t\t\t\theight:100%; \t\t\t\tleft:0pt; \t\t\t\topacity:0.01; \t\t\t\tfilter:alpha(opacity=1); \t\t\t\t-moz-opacity:0.01; \t\t\t\tposition:absolute; \t\t\t\ttop:0pt; \t\t\t\twidth:100%; \t\t\t\tz-index:10001; \t\t\t} \t\t\t/*Data table*/ \t\t\ttable.wizard-data-table { border:1px solid #B2C4DD; border-collapse:collapse;} \t\t\ttable.wizard-data-table td { border:1px solid #B2C4DD; background-color:#FFFFFF; padding:3px 5px; } \t\t\ttable.wizard-data-table thead td, table.wizard-data-table th { \t\t\t\tbackground-color:#E4EDF5; \t\t\t\tfont-weight:normal; \t\t\t\tbackground-image:none; \t\t\t\tborder:1px solid #B2C4DD; \t\t\t\tpadding:4px; \t\t\t} \t\t\ttable.wizard-data-table tbody td { background-color:#FFF; background-image:none; } \t\t\ttable.wizard-data-table tfoot td { background-color:#F2F5F9; padding:4px; } \t\t\t.wizard-note-box { background:#FEFDEA; padding:7px; border:1px solid #D7D6BA; } \t\t\t.wizard-required { color:red; } \t\t\t.bx-session-message { display: none !important;} \t\t</style> \t\t{$adminScript} \t\t<script type="text/javascript"> \t\t\ttop.BX.message({"ADMIN_WIZARD_EXIT_ALERT" : "{$alertText}"}); \t\t\tfunction OnLoad() \t\t\t{ \t\t\t\tvar dialog = top.BX.WindowManager.Get(); \t\t\t\tif (dialog) \t\t\t\t\tdialog.SetTitle('{$wizardName}'); \t\t\t\tvar form = document.forms["{$formName}"]; \t\t\t\tif (form) \t\t\t\t\tform.onsubmit = OnFormSubmit; \t\t\t\tvar cancelButton = document.forms["{$formName}"].elements["{$cancelButtonID}"]; \t\t\t\tvar nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"]; \t\t\t\tvar prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"]; \t\t\t\tvar finishButton = document.forms["{$formName}"].elements["{$finishButtonID}"]; \t\t\t\tif (cancelButton && !nextButton && !prevButton && !finishButton) \t\t\t\t{ \t\t\t\t\ttop.WizardWindow.isClosed = true; \t\t\t\t\tcancelButton.onclick = CloseWindow; \t\t\t\t} \t\t\t\telse if(cancelButton) \t\t\t\t{ \t\t\t\t\tcancelButton.onclick = ConfirmCancel; \t\t\t\t} \t\t\t\t{$autoSubmit} \t\t\t} \t\t\tfunction OnFormSubmit() \t\t\t{ \t\t\t\tvar div = document.body.appendChild(document.createElement("DIV")); \t\t\t\tdiv.id = "hidden-layer"; \t\t\t} \t\t\tfunction AutoSubmit() \t\t\t{ \t\t\t\tvar nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"]; \t\t\t\tif (nextButton) \t\t\t\t{ \t\t\t\t\tvar wizard = top.WizardWindow; \t\t\t\t\tif (wizard) \t\t\t\t\t{ \t\t\t\t\t\twizard.messLoading = "{$loadingText}"; \t\t\t\t\t\twizard.ShowWaitWindow(); \t\t\t\t\t} \t\t\t\t\tnextButton.click(); \t\t\t\t\tnextButton.disabled=true; \t\t\t\t} \t\t\t} \t\t\tfunction ConfirmCancel() \t\t\t{ \t\t\t\treturn (confirm("{$alertText}")); \t\t\t} \t\t\tfunction ShowWarnings(warnings) \t\t\t{ \t\t\t\tvar form = document.forms["{$formName}"]; \t\t\t\tif(!form) \t\t\t\t\treturn; \t\t\t\tfor(var i in warnings) \t\t\t\t{ \t\t\t\t\tvar e = form.elements[warnings[i]["name"]]; \t\t\t\t\tif(!e) \t\t\t\t\t\tcontinue; \t\t\t\t\tvar type = (e.type? e.type.toLowerCase():""); \t\t\t\t\tvar bBefore = false; \t\t\t\t\tif(e.length > 1 && type != "select-one" && type != "select-multiple") \t\t\t\t\t{ \t\t\t\t\t\te = e[0]; \t\t\t\t\t\tbBefore = true; \t\t\t\t\t} \t\t\t\t\tif(type == "textarea" || type == "select-multiple") \t\t\t\t\t\tbBefore = true; \t\t\t\t\tvar td = e.parentNode; \t\t\t\t\tvar img; \t\t\t\t\tif(bBefore) \t\t\t\t\t{ \t\t\t\t\t\timg = td.insertBefore(new Image(), e); \t\t\t\t\t\ttd.insertBefore(document.createElement("BR"), e); \t\t\t\t\t} \t\t\t\t\telse \t\t\t\t\t{ \t\t\t\t\t\timg = td.insertBefore(new Image(), e.nextSibling); \t\t\t\t\t\timg.hspace = 2; \t\t\t\t\t\timg.vspace = 2; \t\t\t\t\t\timg.style.verticalAlign = "bottom"; \t\t\t\t\t} \t\t\t\t\timg.src = "/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/images/icon_warn.gif"; \t\t\t\t\timg.title = warnings[i]["title"]; \t\t\t\t} \t\t\t} \t\t\tdocument.onkeydown = EnterKeyPress; \t\t\tfunction EnterKeyPress(event) \t\t\t{ \t\t\t\tevent = event || window.event; \t\t\t\tif (!event.ctrlKey) \t\t\t\t\treturn; \t\t\t\tvar key = (event.keyCode ? event.keyCode : (event.which ? event.which : null) ); \t\t\t\tif (!key) \t\t\t\t\treturn; \t\t\t\tif (key == 13 || key == 39) \t\t\t\t{ \t\t\t\t\tvar nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"]; \t\t\t\t\tif (nextButton) \t\t\t\t\t\tnextButton.click(); \t\t\t\t} \t\t\t\telse if (key == 37) \t\t\t\t{ \t\t\t\t\tvar prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"]; \t\t\t\t\tif (prevButton) \t\t\t\t\t\tprevButton.click(); \t\t\t\t} \t\t\t} \t\t\tfunction CloseWindow() \t\t\t{ \t\t\t\tif (self.parent.window.WizardWindow) \t\t\t\t\tself.parent.window.WizardWindow.Close(); \t\t\t} \t\t</script> \t</head> \t<body onload="OnLoad();"> \t\t{#FORM_START#} \t\t<div class="step-content"> \t\t\t<div class="step-header"> \t\t\t\t<div class="step-title">{$stepTitle}</div> \t\t\t\t<div class="step-subtitle">{$stepSubTitle}</div> \t\t\t</div> \t\t\t<div class="step-body"> \t\t\t\t{$strError} \t\t\t\t{#CONTENT#} \t\t\t</div> \t\t</div> \t\t<div class="step-buttons">{#BUTTONS#}</div> \t\t{#FORM_END#} \t\t{$strJsError} \t</body> </html> HTML; }
public function GetIcons() { /** @global CMain $APPLICATION */ global $USER, $APPLICATION; $arIcons = array(); $arPanelParams = array(); $arComponentDescription = CComponentUtil::GetComponentDescr($this->componentName); $bComponentAccess = $USER->CanDoOperation('edit_php') || $this->bSrcFound && $USER->CanDoFileOperation('fm_lpa', array(SITE_ID, $this->sSrcFile)); if ($bComponentAccess && !$this->parentComponent && $this->bSrcFound) { $url = $APPLICATION->GetPopupLink(array('URL' => "/freetrix/admin/component_props.php?" . "component_name=" . urlencode(CUtil::addslashes($this->componentName)) . "&component_template=" . urlencode(CUtil::addslashes($this->componentTemplate)) . "&template_id=" . urlencode(CUtil::addslashes(SITE_TEMPLATE_ID)) . "&lang=" . urlencode(CUtil::addslashes(LANGUAGE_ID)) . "&src_path=" . urlencode(CUtil::addslashes($this->sSrcFile)) . "&src_line=" . $this->iSrcLine . "&src_page=" . urlencode(CUtil::addslashes($APPLICATION->GetCurPage())) . "&src_site=" . urlencode(CUtil::addslashes(SITE_ID)), "PARAMS" => array("min_width" => 450))); $arIcons[] = array('URL' => 'javascript:' . $url, 'TYPE' => 'components2_props', 'ICON' => "bx-context-toolbar-settings-icon", 'TITLE' => GetMessage("main_incl_file_comp_param"), 'DEFAULT' => true); $aMenuItem = array("TEXT" => $arComponentDescription["NAME"], "TITLE" => GetMessage("main_comp_button_menu_title") . ' ' . $this->componentName, "ICON" => "parameters-2", "ACTION" => $url); $APPLICATION->AddPanelButtonMenu("components", $aMenuItem); } if ($bComponentAccess) { $template = $this->component->GetTemplate(); if (is_null($template)) { if ($this->component->InitComponentTemplate()) { $template = $this->component->GetTemplate(); } } if (!is_null($template)) { $urlCopy = ''; if ($this->bSrcFound && $template->IsInTheme() == false) { //copy template dialog $urlCopy = "/freetrix/admin/template_copy.php?" . "lang=" . urlencode(CUtil::addslashes(LANGUAGE_ID)) . "&component_name=" . urlencode(CUtil::addslashes($this->componentName)) . "&component_template=" . urlencode(CUtil::addslashes($this->componentTemplate)) . "&template_id=" . urlencode(CUtil::addslashes(SITE_TEMPLATE_ID)) . "&template_site_template=" . urlencode(CUtil::addslashes($template->GetSiteTemplate())) . "&src_path=" . urlencode(CUtil::addslashes($this->sSrcFile)) . "&src_line=" . $this->iSrcLine . "&src_site=" . urlencode(CUtil::addslashes(SITE_ID)) . "&edit_file=" . urlencode($template->GetPageName()) . "&back_path=" . urlencode($_SERVER["REQUEST_URI"]); $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => $urlCopy, "PARAMS" => array("min_width" => 450))), 'ICON' => "copy-2", 'TITLE' => GetMessage("main_comp_copy_templ"), 'IN_MENU' => true); } if ($USER->CanDoOperation('edit_php') && strlen($template->GetSiteTemplate()) > 0) { //edit template copied to site template $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => "/freetrix/admin/public_file_edit_src.php?site=" . SITE_ID . "&" . 'path=' . urlencode($template->GetFile()) . "&back_url=" . urlencode($_SERVER["REQUEST_URI"]) . "&lang=" . LANGUAGE_ID, 'PARAMS' => array('width' => 770, 'height' => 470, 'resize' => true, "dialog_type" => 'EDITOR'))), 'ICON' => 'edit-2', 'TITLE' => GetMessage("main_comp_edit_templ"), 'IN_MENU' => true); if (strlen($template->GetFolder()) > 0) { if (file_exists($_SERVER["DOCUMENT_ROOT"] . $template->GetFolder() . "/style.css")) { //edit template CSS copied to site template $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => "/freetrix/admin/public_file_edit_src.php?site=" . SITE_ID . "&" . 'path=' . urlencode($template->GetFolder() . "/style.css") . "&back_url=" . urlencode($_SERVER["REQUEST_URI"]) . "&lang=" . LANGUAGE_ID, 'PARAMS' => array('width' => 770, 'height' => 470, 'resize' => true, "dialog_type" => 'EDITOR'))), 'ICON' => 'edit-css', 'TITLE' => GetMessage("main_comp_edit_css"), 'IN_MENU' => true); } $bWasSep = false; if (file_exists($_SERVER["DOCUMENT_ROOT"] . $template->GetFolder() . "/result_modifier.php")) { $bWasSep = true; $arIcons[] = array('SEPARATOR' => true); $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => "/freetrix/admin/public_file_edit_src.php?site=" . SITE_ID . "&" . 'path=' . urlencode($template->GetFolder() . "/result_modifier.php") . "&back_url=" . urlencode($_SERVER["REQUEST_URI"]) . "&lang=" . LANGUAGE_ID, 'PARAMS' => array('width' => 770, 'height' => 470, 'resize' => true, "dialog_type" => 'EDITOR'))), 'TITLE' => GetMessage("main_comp_edit_res_mod"), 'IN_MENU' => true); } if (file_exists($_SERVER["DOCUMENT_ROOT"] . $template->GetFolder() . "/component_epilog.php")) { if (!$bWasSep) { $arIcons[] = array('SEPARATOR' => true); } $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => "/freetrix/admin/public_file_edit_src.php?site=" . SITE_ID . "&" . 'path=' . urlencode($template->GetFolder() . "/component_epilog.php") . "&back_url=" . urlencode($_SERVER["REQUEST_URI"]) . "&lang=" . LANGUAGE_ID, 'PARAMS' => array('width' => 770, 'height' => 470, 'resize' => true, "dialog_type" => 'EDITOR'))), 'TITLE' => GetMessage("main_comp_edit_epilog"), 'IN_MENU' => true); } } } elseif ($urlCopy != '') { //copy template for future editing $urlCopy .= '&system_template=Y'; $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => $urlCopy, "PARAMS" => array("min_width" => 450))), 'ICON' => "edit-2", 'TITLE' => GetMessage("main_comp_edit_templ"), 'ALT' => GetMessage("main_comp_copy_title"), 'IN_MENU' => true); } } } $aAddIcons = array(); $arPanelParams['COMPONENT'] = $this->componentName; if ($arComponentDescription && is_array($arComponentDescription)) { $arPanelParams['COMPONENT_DESCRIPTION'] = $arComponentDescription; //component bar tooltip $arPanelParams['TOOLTIP'] = array('TITLE' => $arComponentDescription["NAME"], 'TEXT' => '(' . GetMessage('main_incl_comp_component') . ' ' . $this->componentName . ')' . (isset($arComponentDescription["DESCRIPTION"]) && $arComponentDescription["DESCRIPTION"] != "" ? '<br />' . $arComponentDescription["DESCRIPTION"] : '')); //clear cache if (array_key_exists("CACHE_PATH", $arComponentDescription) && $USER->CanDoOperation('cache_control')) { if (strlen($arComponentDescription["CACHE_PATH"]) > 0) { $arIcons[] = array("URL" => "javascript:jsComponentUtils.ClearCache('component_name=" . urlencode(CUtil::addslashes($this->componentName)) . "&site_id=" . SITE_ID . "&" . freetrix_sessid_get() . "');", "ICON" => "del-cache", "TITLE" => GetMessage("MAIN_FX_COMPONENT_CACHE_CLEAR"), 'IN_MENU' => true); $APPLICATION->aCachedComponents[] = $this->componentName; } } //additional buttons from component description if (array_key_exists("AREA_BUTTONS", $arComponentDescription)) { $componentRelativePath = CComponentEngine::MakeComponentPath($this->componentName); $localPath = getLocalPath("components" . $componentRelativePath); foreach ($arComponentDescription["AREA_BUTTONS"] as $value) { if (array_key_exists("SRC", $value)) { $value["SRC"] = $localPath . $value["SRC"]; } $aAddIcons[] = $value; } } } if (!empty($arIcons) && !empty($aAddIcons)) { $arIcons[] = array("SEPARATOR" => true); } $arIcons = array_merge($arIcons, $aAddIcons); $aAddIcons = $this->component->GetIncludeAreaIcons(); if (!empty($arIcons) && !empty($aAddIcons)) { $arIcons[] = array("SEPARATOR" => true); } $arIcons = array_merge($arIcons, $aAddIcons); // enable/disable menu item if ($bComponentAccess && !$this->parentComponent && $this->bSrcFound) { if (!empty($arIcons)) { $arIcons[] = array("SEPARATOR" => true); } $arIcons[] = array("URL" => "javascript:jsComponentUtils.EnableComponent('component_name=" . urlencode(CUtil::addslashes($this->componentName)) . "&lang=" . urlencode(CUtil::addslashes(LANGUAGE_ID)) . "&src_path=" . urlencode(CUtil::addslashes($this->sSrcFile)) . "&src_line=" . $this->iSrcLine . "&src_site=" . urlencode(CUtil::addslashes(SITE_ID)) . '&active=' . ($this->bComponentEnabled ? 'N' : 'Y') . '&' . freetrix_sessid_get() . "');", "TITLE" => $this->bComponentEnabled ? GetMessage("main_comp_disable") : GetMessage("main_comp_enable"), "ALT" => $this->bComponentEnabled ? GetMessage("main_comp_disable_title") : GetMessage("main_comp_enable_title"), 'IN_MENU' => true); } if ($this->bSrcFound) { $arPanelParams['COMPONENT_ID'] = md5($arPanelParams['COMPONENT'] . '|' . $this->sSrcFile . ':' . $this->iSrcLine); } return array("icons" => $arIcons, "parameters" => $arPanelParams); }
$arParams["PATH_TO_ICON"] = empty($arParams["PATH_TO_ICON"]) ? $this->__folder . "/images/icon/" : $arParams["PATH_TO_ICON"]; $arParams["PAGE_NAVIGATION_TEMPLATE"] = trim($arParams["PAGE_NAVIGATION_TEMPLATE"]); $GLOBALS['APPLICATION']->AddHeadString('<script src="/bitrix/js/main/utils.js"></script>', true); $GLOBALS['APPLICATION']->AddHeadString('<script src="/bitrix/components/bitrix/forum.interface/templates/.default/script.js"></script>', true); $file = trim(preg_replace("'[\\\\/]+'", "/", dirname(__FILE__) . "/lang/" . LANGUAGE_ID . "/result_modifier.php")); if (file_exists($file)) { global $MESS; include_once $file; } ?> <script type="text/javascript"> //<![CDATA[ if (phpVars == null || typeof(phpVars) != "object") { var phpVars = { 'ADMIN_THEME_ID': '.default', 'titlePrefix': '<?php echo CUtil::addslashes(COption::GetOptionString("main", "site_name", $_SERVER["SERVER_NAME"])); ?> - '}; } if (typeof oText != "object") { var oText = {}; } oText['wait_window'] = '<?php echo GetMessage("F_LOAD"); ?> '; //]]> </script>
<?php if (strlen($_REQUEST["back_url_settings"]) > 0) { ?> <input <?php if ($STAT_RIGHT < "W") { echo "disabled"; } ?> type="button" name="Cancel" value="<?php echo GetMessage("MAIN_OPT_CANCEL"); ?> " title="<?php echo GetMessage("MAIN_OPT_CANCEL_TITLE"); ?> " onclick="window.location='<?php echo htmlspecialcharsbx(CUtil::addslashes($_REQUEST["back_url_settings"])); ?> '"> <input type="hidden" name="back_url_settings" value="<?php echo htmlspecialcharsbx($_REQUEST["back_url_settings"]); ?> "> <?php } ?> <input <?php if ($STAT_RIGHT < "W") { echo "disabled"; } ?> type="submit" name="RestoreDefaults" title="<?php
function ec_addslashes($str) { if (strlen($str) <= 0) { return $str; } $str = str_replace("script>", "script_>", $str); $pos2 = strpos(strtolower($str), "\n"); if ($pos2 !== FALSE) { $str = str_replace("\r", "", $str); $str = str_replace("\n", "\\n", $str); } $str = CUtil::addslashes($str); return $str; }
function Buttons($aParams=false) { $hkInst = CHotKeys::getInstance(); while($this->tabIndex < count($this->tabs)) $this->BeginNextTab(); $this->bButtons = true; //end previous tab $this->EndTab(); if (!$this->bPublicMode) { echo '<div class="adm-detail-content-btns-wrap" id="'.$this->name.'_buttons_div"><div class="adm-detail-content-btns">'; } if ($_REQUEST['subdialog']) { echo '<input type="hidden" name="suffix" value="'.substr($GLOBALS['obJSPopup']->suffix, 1).'" />'; echo '<input type="hidden" name="subdialog" value="Y" />'; } if($aParams !== false) { if ($this->bPublicMode) { if (strlen($_REQUEST['from_module'])) { echo '<input type="hidden" name="from_module" value="'.htmlspecialcharsbx($_REQUEST['from_module']).'" />'; } if(is_array($aParams['buttons'])) { echo ' <input type="hidden" name="bxpublic" value="Y" /> <script type="text/javascript">'.$this->publicObject.'.SetButtons('.CUtil::PhpToJsObject($aParams['buttons']).');</script> '; } else { echo ' <input type="hidden" name="bxpublic" value="Y" /><input type="hidden" name="save" value="Y" /> <script type="text/javascript">'.$this->publicObject.'.SetButtons(['.$this->publicObject.'.btnSave, '.$this->publicObject.'.btnCancel]);</script> '; } } else { if($aParams["btnSave"] !== false) { echo '<input'.($aParams["disabled"] === true? " disabled":"").' type="submit" name="save" value="'.GetMessage("admin_lib_edit_save").'" title="'.GetMessage("admin_lib_edit_save_title").$hkInst->GetTitle("Edit_Save_Button").'" class="adm-btn-save" />'; echo $hkInst->PrintJSExecs($hkInst->GetCodeByClassName("Edit_Save_Button")); } if($aParams["btnApply"] !== false) { echo '<input'.($aParams["disabled"] === true? " disabled":"").' type="submit" name="apply" value="'.GetMessage("admin_lib_edit_apply").'" title="'.GetMessage("admin_lib_edit_apply_title").$hkInst->GetTitle("Edit_Apply_Button").'" />'; echo $hkInst->PrintJSExecs($hkInst->GetCodeByClassName("Edit_Apply_Button")); } if($aParams["btnCancel"] !== false && $aParams["back_url"] <> '' && !preg_match('/(javascript|data)[\s\0-\13]*:/i', $aParams["back_url"])) { echo '<input type="button" value="'.GetMessage("admin_lib_edit_cancel").'" name="cancel" onClick="window.location=\''.htmlspecialcharsbx(CUtil::addslashes($aParams["back_url"])).'\'" title="'.GetMessage("admin_lib_edit_cancel_title").$hkInst->GetTitle("Edit_Cancel_Button").'" />'; echo $hkInst->PrintJSExecs($hkInst->GetCodeByClassName("Edit_Cancel_Button")); } if($aParams["btnSaveAndAdd"] === true) { echo '<input'.($aParams["disabled"] === true? " disabled":"").' type="submit" name="save_and_add" value="'.GetMessage("admin_lib_edit_save_and_add").'" title="'.GetMessage("admin_lib_edit_save_and_add_title").$hkInst->GetTitle("Edit_Save_And_Add_Button").'" class="adm-btn-add" />'; echo $hkInst->PrintJSExecs($hkInst->GetCodeByClassName("Edit_Save_And_Add_Button")); } } } }
{ if(confirm('<?php echo GetMessage("CTRLR_UPLOAD_CONFIRM"); ?> ')) { document.getElementById('controller_member_id').value = document.getElementById('fcontroller_member_id').value; document.getElementById('controller_group_id').value = document.getElementById('fcontroller_group_id').value; var filename = document.getElementById('ffilename').value; var path_to = document.getElementById('fpath_to').value; if(filename.length > 0 && path_to.length <= 0) { alert('<?php echo CUtil::addslashes(GetMessage('CTRLR_UPLOAD_ERROR_NO_PATH_TO')); ?> '); document.getElementById('fpath_to').focus(); return; } document.getElementById('filename').value = filename; document.getElementById('path_to').value = path_to; document.getElementById('force').value = (document.getElementById('fforce').checked?'Y':'N'); <?php echo $lAdmin->ActionPost($APPLICATION->GetCurPageParam("mode=frame", array("mode", "PAGEN_1"))); ?> } }