$i = 0; foreach($aRecent as $recent) { $i++; if($i > $nLinks) break; $aItem = array( "TEXT"=>htmlspecialcharsbx($recent["text"]), "TITLE"=>($aUserOpt['start_menu_title'] <> 'N'? htmlspecialcharsbx($recent["title"]):''), "GLOBAL_ICON"=>htmlspecialcharsbx($recent["icon"]), "LINK"=>$recent["url"], ); $aItem["ONCLICK"] = 'BX.admin.startMenuRecent('.CUtil::PhpToJsObject($aItem).')'; $aPopup[] = $aItem; } } } if(empty($aPopup)) $aPopup[] = array("TEXT"=>GetMessage("get_start_menu_no_data")); //generate JavaScript array for popup menu echo CAdminPopup::PhpToJavaScript($aPopup); } //$_REQUEST["mode"] require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin_js.php"); ?>
function ShowTabButtons() { /** @global CMain $APPLICATION */ global $APPLICATION; $s = ''; if (!$this->bPublicMode) { if ($this->bShowSettings) { $link = DeleteParam(array("mode")); $link = $APPLICATION->GetCurPage()."?mode=settings".($link <> ""? "&".$link:""); $aAdditionalMenu = array(); $aAdditionalMenu[] = array( "TEXT"=>GetMessage("admin_lib_menu_settings"), "TITLE"=>GetMessage("admin_lib_context_sett_title"), "ONCLICK"=>$this->name.".ShowSettings('".htmlspecialcharsex(CUtil::JSEscape($link))."')", "GLOBAL_ICON"=>"adm-menu-setting" ); if($this->bCustomFields) { if(is_array($_SESSION["ADMIN_CUSTOM_FIELDS"]) && array_key_exists($this->name, $_SESSION["ADMIN_CUSTOM_FIELDS"])) { $aAdditionalMenu[] = array( "TEXT" => GetMessage("admin_lib_sett_sett_enable_text"), "TITLE" => GetMessage("admin_lib_sett_sett_enable"), "ONCLICK" => $this->name.'.EnableSettings();', "ICON" => 'custom-fields-on', ); } else { $aAdditionalMenu[] = array( "TEXT" => GetMessage("admin_lib_sett_sett_disable_text"), "TITLE" => GetMessage("admin_lib_sett_sett_disable"), "ONCLICK" => $this->name.'.DisableSettings();', "ICON" => 'custom-fields-off' ); } } if (count($aAdditionalMenu) > 1) { $sMenuUrl = "BX.adminShowMenu(this, ".htmlspecialcharsbx(CAdminPopup::PhpToJavaScript($aAdditionalMenu)).", {active_class: 'bx-settings-btn-active'});"; $bCustomFieldsOff = is_array($_SESSION["ADMIN_CUSTOM_FIELDS"]) && array_key_exists($this->name, $_SESSION["ADMIN_CUSTOM_FIELDS"]); $s .= '<span id="'.$this->name.'_settings_btn" class="adm-detail-settings adm-detail-settings-arrow'.($bCustomFieldsOff ? '' : ' adm-detail-settings-active').'" onclick="'.$sMenuUrl.'"></span>'; } else { $s .= '<a class="adm-detail-settings" href="javascript:void(0)" onclick="'.$aAdditionalMenu[0]['ONCLICK'].'"></a>'; } } } return $s.parent::ShowTabButtons(); }
$folder_path = substr($path, 0, strrpos($path, "/")); $id = GetFileName($path); $aMenu[] = array("TEXT" => GetMessage("FILEMAN_FILE_DELETE"), "LINK" => "javascript:if(confirm('" . GetMessage("FILEMAN_FILE_DELETE_CONFIRM") . "')) window.location='/bitrix/admin/fileman_admin.php?ID=" . urlencode($id) . "&action=delete&" . $addUrl . "&site=" . urlencode($site) . "&path=" . urlencode($folder_path) . "&" . bitrix_sessid_get() . "';", "TITLE" => GetMessage("FILEMAN_FILE_DELETE")); } } $context = new CAdminContextMenu($aMenu); $context->Show(); global $__fd_path; $__fd_path = $bEdit ? $arParsedPath["PREV"] : $path; $arContextTemplates = array(); $arTemplates = CFileman::GetFileTemplates(LANGUAGE_ID, array($site_template)); $cntTempl = count($arTemplates); for ($i = 0; $i < $cntTempl; $i++) { $arContextTemplates[] = array("TEXT" => htmlspecialcharsbx($arTemplates[$i]["name"]), "ONCLICK" => "__NewDocTempl('" . AddSlashes(htmlspecialcharsbx($arTemplates[$i]["file"])) . "')"); } $u = new CAdminPopup("new_doc_list", "new_doc_list", $arContextTemplates); CAdminFileDialog::ShowScript(array("event" => "__bx_fd_save_as", "arResultDest" => array("FUNCTION_NAME" => "OnSaveAs"), "arPath" => array('SITE' => $site, 'PATH' => $_REQUEST['path']), "select" => 'F', "operation" => 'S', "showUploadTab" => false, "showAddToMenuTab" => true, "fileFilter" => 'php,html,htm,phtml', "allowAllFiles" => true, "saveConfig" => false)); ?> <script type="text/javascript"> BX.addCustomEvent(window, 'onAfterFileDialogShow', function(){ var _filenameDialogInput = BX("__bx_file_path_bar"); var _filenamePageInput = BX('filename'); if(_filenamePageInput && _filenameDialogInput) _filenameDialogInput.value = _filenamePageInput.value; }); </script> <?php $u->Show(); ?> <form action="fileman_html_edit.php?lang=<?php echo LANG;
function BuildDialog($Params) { $arSites = $Params['arSites']; if (count($arSites) > 1) { $u = new CAdminPopup("fd_site_list", "fd_site_list", $Params['arSitesPP'], array('zIndex' => 3500, 'dxShadow' => 0)); $u->Show(); } ?> <form id="file_dialog" name="file_dialog" onsubmit="return false;"> <table class="bx-file-dialog"> <tr> <td class= "bxfd-cntrl-cell"> <div id="__bx_fd_top_controls_container"> <table class="bx-fd-top-contr-tbl"> <tr> <?php if (count($arSites) > 1) { ?> <td style="width:22px!important; padding: 0px 4px 0px 5px !important;"> <div id="__bx_site_selector" bxvalue='<?php echo CUtil::JSEscape($Params['site']); ?> ' onclick="oBXDialogControls.SiteSelectorOnClick(this);" class="site_selector_div"><span><?php echo CUtil::JSEscape($Params['site']); ?> </span><span class="fd_iconkit site_selector_div_arrow"> </span></div> </td> <?php } ?> <td style="padding: 0px 2px 0px 2px !important;"> <input class="fd_input" type="text" id="__bx_dir_path_bar"></input> </td> <td nowrap style="width:170px !important; padding: 0px 2px 0px 2px !important;"> <img src="/bitrix/images/1.gif" class="fd_iconkit go_button" id="__bx_dir_path_go" title="<?php echo GetMessage("FD_GO_TO"); ?> "/> <img src="/bitrix/images/1.gif" __bx_disable="Y" class="fd_iconkit path_back_dis" title="<?php echo GetMessage("FD_GO_BACK"); ?> " id="__bx_dir_path_back"/> <img src="/bitrix/images/1.gif" __bx_disable="Y" class="fd_iconkit path_forward_dis" title="<?php echo GetMessage("FD_GO_FORWARD"); ?> " id="__bx_dir_path_forward"/> <img src="/bitrix/images/1.gif" class="fd_iconkit dir_path_up" title="<?php echo GetMessage("FD_GO_UP"); ?> " id="__bx_dir_path_up" /> <img src="/bitrix/images/1.gif" class="fd_iconkit dir_path_root" title="<?php echo GetMessage("FD_GO_TO_ROOT"); ?> " id="__bx_dir_path_root" /> <img src="/bitrix/images/1.gif" class="fd_iconkit new_dir" title="<?php echo GetMessage("FD_NEW_FOLDER"); ?> " id="__bx_new_dir" /> <img src="/bitrix/images/1.gif" class="fd_iconkit refresh" title="<?php echo GetMessage("FD_REFRESH"); ?> " onclick="oBXDialogControls.RefreshOnclick(this);"/> <?php $arSitesPP = array(); $arViews = array(array("ID" => 'list', "TEXT" => GetMessage("FD_VIEW_LIST"), "ONCLICK" => "oBXDialogControls.ViewSelector.OnChange('list')"), array("ID" => 'detail', "TEXT" => GetMessage("FD_VIEW_DETAIL"), "ONCLICK" => "oBXDialogControls.ViewSelector.OnChange('detail')"), array("ID" => 'preview', "TEXT" => GetMessage("FD_VIEW_PREVIEW"), "ONCLICK" => "oBXDialogControls.ViewSelector.OnChange('preview')")); $u = new CAdminPopup("fd_view_list", "fd_view_list", $arViews, array('zIndex' => 2500, 'dxShadow' => 0)); $u->Show(); ?> <img onclick="oBXDialogControls.ViewSelector.OnClick();" src="/bitrix/images/1.gif" id="__bx_view_selector" class="fd_iconkit view_selector" title="<?php echo GetMessage("FD_SELECT_VIEW"); ?> "/> </td> <td nowrap style="width:180px !important; padding: 0px 6px 0px 3px !important; text-align:right !important;" align="right"> <?php echo GetMessage("FD_SORT_BY"); ?> : <select class="fd_select" id="__bx_sort_selector" title="<?php echo GetMessage("FD_SORT_BY"); ?> " style="font-size:11px !important;"> <option value="name"><?php echo GetMessage("FD_SORT_BY_NAME"); ?> </option> <option value="type"><?php echo GetMessage("FD_SORT_BY_TYPE"); ?> </option> <option value="size"><?php echo GetMessage("FD_SORT_BY_SIZE"); ?> </option> <option value="date"><?php echo GetMessage("FD_SORT_BY_DATE"); ?> </option> </select> </td> <td style="width:20px !important; padding: 0px 6px 0px 3px !important;"> <img src="/bitrix/images/1.gif" class="fd_iconkit sort_up" title="<?php echo GetMessage("FD_CHANGE_SORT_ORDER"); ?> " __bx_value="asc" id="__bx_sort_order" /> </td> </tr> </table> </div> </td> </tr> <tr> <td style="vertical-align:top !important; height:398px !important;"> <div id="__bx_fd_tree_and_window" style="display:block"> <table style="width:743px !important; height:250px !important;"> <tr> <td class="bxfd-tree-cont"> <div id="__bx_treeContainer" class="fd_window bxfd-tree-cont-div"></div> </td> <td class="bxfd-window-cont"> <div class="fd_window" ><div id="__bx_windowContainer" class="bxfd-win-cont"></div></div> </td> </tr> </table> </div> <div id="__bx_fd_preview_and_panel" style="display:block;"> <table style="width:100% !important;height:132px !important; padding:0px !important;" border="0"> <tr> <td style="width:25% !important; height: 100% !important;"> <div style="margin: 3px 8px 3px 5px;border:1px solid #C6C6C6"><div style="height:127px;"> <div id="bxfd_previewContainer"></div> <div id="bxfd_addInfoContainer"></div> </div></div> </td> <td style="width:70% !important; vertical-align:top !important;"> <div class="bxfd-save-cont"> <table> <tr> <td class="bxfd-sc-cell" colspan="2"> <input type="text" style="width:98% !important;margin-bottom:5px !important;" id="__bx_file_path_bar"> <select style="width:98% !important; display:none; margin-bottom:5px !important;" id="__bx_file_filter"></select> <div id="__bx_page_title_cont" style="display:none;"> <?php echo GetMessage('FD_PAGE_TITLE'); ?> :<br/> <input type="text" style="width:98% !important;" id="__bx_page_title1"> </div> </td> </tr> <tr> <td class="bxfd-sc-cell2"> <table id="add2menu_cont" style="display:none"><tr> <td><input type="checkbox" id="__bx_fd_add_to_menu"></td> <td><label for="__bx_fd_add_to_menu"><?php echo GetMessage("FD_ADD_PAGE_2_MENU"); ?> </label></td> </tr></table> </td> <td class="bxfd-sc-cell3"> <input style="width:100px !important;" type="button" id="__bx_fd_submit_but" value=""> <input style="width:100px !important;" type="button" onclick="oBXFileDialog.Close()" value="<?php echo GetMessage("FD_BUT_CANCEL"); ?> "> </td> </tr> </table> </div> </td> </tr> </table> </div> <div id="__bx_fd_load" style="display:none;"> <div id="bxfd_upload_container"><iframe id="bxfd_iframe_upload" src="javascript:''" frameborder="0"></iframe></div> </div> <div id="__bx_fd_container_add2menu" class="bxfd-add-2-menu-tab"><?php if ($Params['bAddToMenu']) { ?> <table class="bx-fd-add-2-menu-tbl"> <tr> <td style="height:30px"> <table class="fd_tab_title"> <tr> <td class="icon"><img class="bxfd-add-to-menu-icon" src="/bitrix/images/1.gif" width="32" height="32"/></td> <td class="title"><?php echo GetMessage("FD_ADD_PAGE_2_MENU_TITLE"); ?> </td> </tr> <tr> <td colspan="2" class="delimiter"></td> </tr> </table> </td> </tr> <tr> <td style="height:310px !important; vertical-align:top !important;"> <table id="add2menuTable" class="bxfd-add-2-menu-tbl"> <tr> <td style="width:200px !important; text-align:right !important;"><?php echo GetMessage("FD_FILE_NAME"); ?> </td> <td style="width:250px !important;" id="__bx_fd_file_name"></td> </tr> <tr> <td align="right"><?php echo GetMessage("FD_PAGE_TITLE"); ?> :</td> <td><input type="text" id="__bx_page_title2" value=""></input></td> </tr> <tr> <td align="right"><?php echo GetMessage("FD_MENU_TYPE"); ?> </td> <td> <select id="__bx_fd_menutype" name="menutype"> <?php for ($i = 0; $i < count($Params['arMenuTypes']); $i++) { ?> <option value='<?php echo CUtil::JSEscape($Params['arMenuTypes'][$i]['key']); ?> '><?php echo CUtil::JSEscape($Params['arMenuTypes'][$i]['title']); ?> </option> <?php } ?> </select> </td> </tr> <tr id="e0"> <td style="vertical-align:top !important; text-align:right !important;"><?php echo GetMessage("FD_MENU_POINT"); ?> </td> <td> <input type="radio" name="itemtype" id="__bx_fd_itemtype_n" value="n" checked> <label for="__bx_fd_itemtype_n"><?php echo GetMessage("FD_ADD_NEW"); ?> </label><br> <input type="radio" name="itemtype" id="__bx_fd_itemtype_e" value="e"> <label for="__bx_fd_itemtype_e"><?php echo GetMessage("FD_ATTACH_2_EXISTENT"); ?> </label> </td> </tr> <tr id="__bx_fd_e1"> <td align="right"><?php echo GetMessage("FD_NEW_ITEM_NAME"); ?> </td> <td><input type="text" name="newp" id="__bx_fd_newp" value=""></td> </tr> <tr id="__bx_fd_e2"> <td align="right"><?php echo GetMessage("FD_ATTACH_BEFORE"); ?> </td> <td> <select name="newppos" id="__bx_fd_newppos"> <?php for ($i = 0; $i < count($Params['menuItems']); $i++) { ?> <option value="<?php echo $i + 1; ?> "><?php echo CUtil::JSEscape($Params['menuItems'][$i]); ?> </option> <?php } ?> <option value="0" selected="selected"><?php echo GetMessage("FD_LAST_POINT"); ?> </option> </select> </td> </tr> <tr id="__bx_fd_e3" style="display:none;"> <td align="right"><?php echo GetMessage("FD_ATTACH_2_ITEM"); ?> </td> <td> <select name="menuitem" id="__bx_fd_menuitem"> <?php for ($i = 0; $i < count($Params['menuItems']); $i++) { ?> <option value="<?php echo $i + 1; ?> "><?php echo CUtil::JSEscape($Params['menuItems'][$i]); ?> </option> <?php } ?> </select> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </td> </tr> <tr> <td class="bx-fd-buttons-cont"> <input type="button" id="__bx_fd_submit_but2" value=""></input> <input type="button" onclick="oBXFileDialog.Close()" value="<?php echo GetMessage("FD_BUT_CANCEL"); ?> "></input> </td> </tr> </table><?php } ?> </div> </td> </tr> <tr> <td id="__bx_tab_cont" style="background-color: #D7D7D7;"></td> </tr> </table> </form> <div id="__bx_get_real_size_cont"></div> <?php }
function __showPopup($element_id, $items) { echo "<script type=\"text/javascript\">\n\t\t\ttop.BX.ready(function(){\n\t\t\t\ttop.BX.bind(top.BX('" . $element_id . "'), 'click', function() {\n\t\t\t\t\ttop.BX.adminShowMenu(this, " . CAdminPopup::PhpToJavaScript($items) . ");\n\t\t\t\t});\n\t\t\t});\n\t\t</script>"; }
public function Display() { $sDefAction = $sDefTitle = ""; if (!$this->bEditMode) { if (!empty($this->link)) { if (true == $this->boolBX) { $sDefAction = $this->pList->getRowAction($this->link); } else { $sDefAction = "BX.adminPanel.Redirect([], '" . CUtil::JSEscape($this->link) . "', event);"; } $sDefTitle = $this->title; } else { foreach ($this->aActions as $action) { if ($action["DEFAULT"] == true) { if (true == $this->boolBX) { $sDefAction = $this->pList->getRowAction(CUtil::addslashes($action["ACTION"])); } else { $sDefAction = $action["ACTION"] ? htmlspecialcharsbx($action["ACTION"]) : "BX.adminPanel.Redirect([], '" . CUtil::JSEscape($action["LINK"]) . "', event)"; } $sDefTitle = !empty($action["TITLE"]) ? $action["TITLE"] : $action["TEXT"]; break; } } } } $sMenuItems = ''; if (!empty($this->aActions)) { $sMenuItems = htmlspecialcharsbx(CAdminPopup::PhpToJavaScript($this->aActions)); } ?> <tr class="adm-list-table-row<?php echo isset($this->aFeatures["footer"]) && $this->aFeatures["footer"] == true ? ' footer' : ''; echo $this->bEditMode ? ' adm-table-row-active' : ''; ?> "<?php echo $sMenuItems != "" ? ' oncontextmenu="return ' . $sMenuItems . ';"' : ''; echo $sDefAction != "" ? ' ondblclick="' . $sDefAction . '"' . (!empty($sDefTitle) ? ' title="' . GetMessage("admin_lib_list_double_click") . ' ' . $sDefTitle . '"' : '') : ''; ?> > <?php if (count($this->pList->arActions) > 0 || $this->pList->bCanBeEdited) { $check_id = RandString(5); ?> <td class="adm-list-table-cell adm-list-table-checkbox adm-list-table-checkbox-hover<?php echo $this->bReadOnly ? ' adm-list-table-checkbox-disabled' : ''; ?> "><input type="checkbox" class="adm-checkbox adm-designed-checkbox" name="SUB_ID[]" id="<?php echo $this->table_id . "_" . $this->id . "_" . $check_id; ?> " value="<?php echo $this->id; ?> " autocomplete="off" title="<?php echo GetMessage("admin_lib_list_check"); ?> "<?php echo $this->bReadOnly ? ' disabled="disabled"' : ''; echo $this->bEditMode ? ' checked="checked" disabled="disabled"' : ''; ?> /><label class="adm-designed-checkbox-label adm-checkbox" for="<?php echo $this->table_id . "_" . $this->id . "_" . $check_id; ?> "></label></td> <?php } if ($this->pList->bShowActions) { if (!empty($this->aActions)) { ?> <td class="adm-list-table-cell adm-list-table-popup-block" onclick="BX.adminSubList.ShowMenu(this.firstChild, this.parentNode.oncontextmenu(), this.parentNode);"><div class="adm-list-table-popup" title="<?php echo GetMessage("admin_lib_list_actions_title"); ?> "></div></td> <?php } else { ?> <td class="adm-list-table-cell"></td> <?php } } end($this->pList->aVisibleHeaders); $last_id = key($this->pList->aVisibleHeaders); reset($this->pList->aVisibleHeaders); $bVarsFromForm = $this->bEditMode && is_array($this->pList->arUpdateErrorIDs) && in_array($this->id, $this->pList->arUpdateErrorIDs); foreach ($this->aHeaders as $id => $header_props) { if (!in_array($id, $this->pList->arVisibleColumns)) { continue; } $field = $this->aFields[$id]; if ($this->bEditMode && isset($field["edit"])) { if ($bVarsFromForm && $_REQUEST["FIELDS"]) { $val = $_REQUEST["FIELDS"][$this->id][$id]; } else { $val = $this->arRes[$id]; } $val_old = $this->arRes[$id]; echo '<td class="adm-list-table-cell', isset($header_props['align']) && $header_props['align'] ? ' align-' . $header_props['align'] : '', isset($header_props['valign']) && $header_props['valign'] ? ' valign-' . $header_props['valign'] : '', $id === $last_id ? ' adm-list-table-cell-last' : '', '">'; if (is_array($val_old)) { foreach ($val_old as $k => $v) { echo '<input type="hidden" name="FIELDS_OLD[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . '][' . htmlspecialcharsbx($k) . ']" value="' . htmlspecialcharsbx($v) . '">'; } } else { echo '<input type="hidden" name="FIELDS_OLD[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="' . htmlspecialcharsbx($val_old) . '">'; } switch ($field["edit"]["type"]) { case "checkbox": echo '<input type="hidden" name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="N">'; echo '<input type="checkbox" name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="Y"' . ($val == 'Y' ? ' checked' : '') . '>'; break; case "select": echo '<select name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']"' . $this->__AttrGen($field["edit"]["attributes"]) . '>'; foreach ($field["edit"]["values"] as $k => $v) { echo '<option value="' . htmlspecialcharsbx($k) . '" ' . ($k == $val ? ' selected' : '') . '>' . htmlspecialcharsex($v) . '</option>'; } echo '</select>'; break; case "input": if (!$field["edit"]["attributes"]["size"]) { $field["edit"]["attributes"]["size"] = "10"; } echo '<input type="text" ' . $this->__AttrGen($field["edit"]["attributes"]) . ' name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="' . htmlspecialcharsbx($val) . '">'; break; case "calendar": if (!$field["edit"]["attributes"]["size"]) { $field["edit"]["attributes"]["size"] = "10"; } echo '<span style="white-space:nowrap;"><input type="text" ' . $this->__AttrGen($field["edit"]["attributes"]) . ' name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="' . htmlspecialcharsbx($val) . '">'; echo CAdminCalendar::Calendar('FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']') . '</span>'; break; case "file": echo CFileInput::Show('FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']', $val, $field["edit"]["showInfo"], $field["edit"]["inputs"]); break; default: echo $field["edit"]['value']; } echo '</td>'; } else { if (!is_array($this->arRes[$id])) { $val = trim($this->arRes[$id]); } else { $val = $this->arRes[$id]; } if (isset($field["view"])) { switch ($field["view"]["type"]) { case "checkbox": if ($val == 'Y') { $val = htmlspecialcharsex(GetMessage("admin_lib_list_yes")); } else { $val = htmlspecialcharsex(GetMessage("admin_lib_list_no")); } break; case "select": if ($field["edit"]["values"][$val]) { $val = htmlspecialcharsex($field["edit"]["values"][$val]); } break; case "file": if ($val > 0) { $val = CFileInput::Show('NO_FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']', $val, $field["view"]["showInfo"], $field["view"]["inputs"]); } else { $val = ''; } break; case "html": $val = $field["view"]['value']; break; default: $val = htmlspecialcharsex($val); break; } } else { $val = htmlspecialcharsex($val); } echo '<td class="adm-list-table-cell', isset($header_props['align']) && $header_props['align'] ? ' align-' . $header_props['align'] : '', isset($header_props['valign']) && $header_props['valign'] ? ' valign-' . $header_props['valign'] : '', $id === $last_id ? ' adm-list-table-cell-last' : '', '">'; echo (string) $val != "" ? $val : ' '; if (isset($field["edit"]) && $field["edit"]["type"] == "calendar") { CAdminCalendar::ShowScript(); } echo '</td>'; } } echo '</tr>'; }
function Display() { $sDefAction = $sDefTitle = ""; if (!$this->bEditMode) { if (!empty($this->link)) { if (true == $this->boolBX) { $sDefAction = "(new BX.CAdminDialog({\n\t\t\t\t\t\t'content_url': '" . $this->link . (!(defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1) ? '&bxsku=Y' : '') . "&bxpublic=Y&" . bitrix_sessid_get() . "',\n\t\t\t\t\t\t'content_post': 'from_module=iblock',\n\t\t\t\t\t\t'draggable': true,\n\t\t\t\t\t\t'resizable': true,\n\t\t\t\t\t\t'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]\n\t\t\t\t\t})).Show();"; } else { $sDefAction = "BX.adminPanel.Redirect([], '" . CUtil::JSEscape($this->link) . "', event);"; } $sDefTitle = $this->title; } else { foreach ($this->aActions as $action) { if ($action["DEFAULT"] == true) { if (true == $this->boolBX) { $sDefAction = "(new BX.CAdminDialog({\n\t\t\t\t\t\t'content_url': '" . CUtil::addslashes($action["ACTION"]) . "',\n\t\t\t\t\t\t'content_post': '" . (!(defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1) ? '&bxsku=Y' : '') . "&bxpublic=Y&from_module=iblock&" . bitrix_sessid_get() . "',\n\t\t\t\t\t\t'draggable': true,\n\t\t\t\t\t\t'resizable': true,\n\t\t\t\t\t\t'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]\n\t\t\t\t\t})).Show();"; } else { $sDefAction = $action["ACTION"] ? htmlspecialcharsbx($action["ACTION"]) : "BX.adminPanel.Redirect([], '" . CUtil::JSEscape($action["LINK"]) . "', event)"; } $sDefTitle = !empty($action["TITLE"]) ? $action["TITLE"] : $action["TEXT"]; break; } } } } $sMenuItems = ""; if (!empty($this->aActions)) { $sMenuItems = htmlspecialcharsbx(CAdminPopup::PhpToJavaScript($this->aActions)); } $aUserOpt = CUserOptions::GetOption("global", "settings"); ?> <tr class="adm-list-table-row<?php echo isset($this->aFeatures["footer"]) && $this->aFeatures["footer"] == true ? ' footer' : ''; echo $this->bEditMode ? ' adm-table-row-active' : ''; ?> "<?php echo $sMenuItems != "" && $aUserOpt["context_menu"] != "N" ? ' oncontextmenu="return ' . $sMenuItems . ';"' : ''; echo $sDefAction != "" ? ' ondblclick="' . $sDefAction . '"' . (!empty($sDefTitle) ? ' title="' . GetMessage("admin_lib_list_double_click") . ' ' . $sDefTitle . '"' : '') : ''; ?> > <?php if (count($this->pList->arActions) > 0 || $this->pList->bCanBeEdited) { $check_id = RandString(5); ?> <td class="adm-list-table-cell adm-list-table-checkbox adm-list-table-checkbox-hover<?php echo $this->bReadOnly ? ' adm-list-table-checkbox-disabled' : ''; ?> "><input type="checkbox" class="adm-checkbox adm-designed-checkbox" name="SUB_ID[]" id="<?php echo $this->table_id . "_" . $this->id . "_" . $check_id; ?> " value="<?php echo $this->id; ?> " autocomplete="off" title="<?php echo GetMessage("admin_lib_list_check"); ?> "<?php echo $this->bReadOnly ? ' disabled="disabled"' : ''; echo $this->bEditMode ? ' checked="checked" disabled="disabled"' : ''; ?> /><label class="adm-designed-checkbox-label adm-checkbox" for="<?php echo $this->table_id . "_" . $this->id . "_" . $check_id; ?> "></label></td> <?php } if ($this->pList->bShowActions) { if (!empty($this->aActions)) { ?> <td class="adm-list-table-cell adm-list-table-popup-block" onclick="BX.adminSubList.ShowMenu(this.firstChild, this.parentNode.oncontextmenu(), this.parentNode);"><div class="adm-list-table-popup" title="<?php echo GetMessage("admin_lib_list_actions_title"); ?> "></div></td> <?php } else { ?> <td class="adm-list-table-cell"></td> <?php } } $bVarsFromForm = $this->bEditMode && is_array($this->pList->arUpdateErrorIDs) && in_array($this->id, $this->pList->arUpdateErrorIDs); foreach ($this->aHeaders as $id => $header_props) { if (!in_array($id, $this->pList->arVisibleColumns)) { continue; } $field = $this->aFields[$id]; if ($this->bEditMode && isset($field["edit"])) { if ($bVarsFromForm && $_REQUEST["FIELDS"]) { $val = $_REQUEST["FIELDS"][$this->id][$id]; } else { $val = $this->arRes[$id]; } $val_old = $this->arRes[$id]; echo '<td class="adm-list-table-cell' . ($header_props['align'] ? ' align-' . $header_props['align'] : '') . ' ' . ($header_props['valign'] ? ' valign-' . $header_props['valign'] : '') . '">'; if (is_array($val_old)) { foreach ($val_old as $k => $v) { echo '<input type="hidden" name="FIELDS_OLD[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . '][' . htmlspecialcharsbx($k) . ']" value="' . htmlspecialcharsbx($v) . '">'; } } else { echo '<input type="hidden" name="FIELDS_OLD[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="' . htmlspecialcharsbx($val_old) . '">'; } switch ($field["edit"]["type"]) { case "checkbox": echo '<input type="hidden" name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="N">'; echo '<input type="checkbox" name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="Y"' . ($val == 'Y' ? ' checked' : '') . '>'; break; case "select": echo '<select name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']"' . $this->__AttrGen($field["edit"]["attributes"]) . '>'; foreach ($field["edit"]["values"] as $k => $v) { echo '<option value="' . htmlspecialcharsbx($k) . '" ' . ($k == $val ? ' selected' : '') . '>' . htmlspecialcharsex($v) . '</option>'; } echo '</select>'; break; case "input": if (!$field["edit"]["attributes"]["size"]) { $field["edit"]["attributes"]["size"] = "10"; } echo '<input type="text" ' . $this->__AttrGen($field["edit"]["attributes"]) . ' name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="' . htmlspecialcharsbx($val) . '">'; break; case "calendar": if (!$field["edit"]["attributes"]["size"]) { $field["edit"]["attributes"]["size"] = "10"; } echo '<span style="white-space:nowrap;"><input type="text" ' . $this->__AttrGen($field["edit"]["attributes"]) . ' name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="' . htmlspecialcharsbx($val) . '">'; echo CAdminCalendar::Calendar('FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']') . '</span>'; break; default: echo $field["edit"]['value']; } echo '</td>'; } else { if (!is_array($this->arRes[$id])) { $val = trim($this->arRes[$id]); } else { $val = $this->arRes[$id]; } switch ($field["view"]["type"]) { case "checkbox": if ($val == 'Y') { $val = GetMessage("admin_lib_list_yes"); } else { $val = GetMessage("admin_lib_list_no"); } break; case "select": if ($field["edit"]["values"][$val]) { $val = $field["edit"]["values"][$val]; } break; } if ($field["view"]['type'] == 'html') { $val = $field["view"]['value']; } else { $val = htmlspecialcharsex($val); } echo '<td class="adm-list-table-cell' . ($header_props['align'] ? ' align-' . $header_props['align'] : '') . ' ' . ($header_props['valign'] ? ' valign-' . $header_props['valign'] : '') . '">'; echo (string) $val != "" ? $val : ' '; if ($field["edit"]["type"] == "calendar") { echo CAdminCalendar::ShowScript(); } echo '</td>'; } } echo '</tr>'; }