public static function get_sections_menu($IBLOCK_TYPE_ID, $IBLOCK_ID, $DEPTH_LEVEL, $SECTION_ID, $arSectionsChain = false) { global $adminMenu; if (false === $arSectionsChain) { $arSectionsChain = array(); if (isset($_REQUEST['admin_mnu_menu_id'])) { $menu_id = "menu_catalog_category_" . $IBLOCK_ID . "/"; if (0 == strncmp($_REQUEST['admin_mnu_menu_id'], $menu_id, strlen($menu_id))) { $rsSections = CIBlockSection::GetNavChain($IBLOCK_ID, substr($_REQUEST['admin_mnu_menu_id'], strlen($menu_id)), array('ID', 'IBLOCK_ID')); while ($arSection = $rsSections->Fetch()) { $arSectionsChain[$arSection["ID"]] = $arSection["ID"]; } } } if (isset($_REQUEST["find_section_section"]) && (int) $_REQUEST["find_section_section"] > 0 && isset($_REQUEST["IBLOCK_ID"]) && $_REQUEST["IBLOCK_ID"] == $IBLOCK_ID) { $rsSections = CIBlockSection::GetNavChain($IBLOCK_ID, $_REQUEST["find_section_section"], array('ID', 'IBLOCK_ID')); while ($arSection = $rsSections->Fetch()) { $arSectionsChain[$arSection["ID"]] = $arSection["ID"]; } } } $urlSectionAdminPage = CIBlock::GetAdminSectionListLink($IBLOCK_ID, array('catalog' => null)); $arSections = array(); $rsSections = CIBlockSection::GetList(array("left_margin" => "ASC"), array("IBLOCK_ID" => $IBLOCK_ID, "SECTION_ID" => $SECTION_ID), false, array("ID", "IBLOCK_SECTION_ID", "NAME", "LEFT_MARGIN", "RIGHT_MARGIN")); $intCount = 0; $arOtherSectionTmp = array(); $limit = (int) COption::GetOptionInt("iblock", "iblock_menu_max_sections"); while ($arSection = $rsSections->Fetch()) { if ($limit > 0 && $intCount >= $limit) { if (empty($arOtherSectionTmp)) { $arOtherSectionTmp = array("text" => Loc::getMessage("CAT_MENU_ALL_OTH"), "url" => $urlSectionAdminPage . "&find_section_section=" . (int) $arSection["IBLOCK_SECTION_ID"], "more_url" => array(CIBlock::GetAdminSectionEditLink($IBLOCK_ID, $arSection["ID"], array('catalog' => null))), "title" => Loc::getMessage("CAT_MENU_ALL_OTH_TITLE"), "icon" => "iblock_menu_icon_sections", "page_icon" => "iblock_page_icon_sections", "skip_chain" => true, "items_id" => "menu_catalog_category_" . $IBLOCK_ID . "/" . $arSection["ID"], "module_id" => "catalog", "items" => array()); CCatalogAdmin::get_other_elements_menu($IBLOCK_TYPE_ID, $IBLOCK_ID, $arSection, $arOtherSectionTmp["more_url"]); } else { $arOtherSectionTmp['more_url'][] = $urlSectionAdminPage . "&find_section_section=" . (int) $arSection["ID"]; $arOtherSectionTmp['more_url'][] = CIBlock::GetAdminSectionEditLink($IBLOCK_ID, $arSection["ID"], array('catalog' => null)); } } else { $arSectionTmp = array("text" => htmlspecialcharsex($arSection["NAME"]), "url" => $urlSectionAdminPage . "&find_section_section=" . $arSection["ID"], "more_url" => array(CIBlock::GetAdminSectionEditLink($IBLOCK_ID, $arSection["ID"], array('catalog' => null))), "title" => htmlspecialcharsex($arSection["NAME"]), "icon" => "iblock_menu_icon_sections", "page_icon" => "iblock_page_icon_sections", "skip_chain" => true, "items_id" => "menu_catalog_category_" . $IBLOCK_ID . "/" . $arSection["ID"], "module_id" => "catalog", "dynamic" => $arSection["RIGHT_MARGIN"] - $arSection["LEFT_MARGIN"] > 1, "items" => array()); if (isset($arSectionsChain[$arSection["ID"]])) { $arSectionTmp["items"] = CCatalogAdmin::get_sections_menu($IBLOCK_TYPE_ID, $IBLOCK_ID, $DEPTH_LEVEL + 1, $arSection["ID"], $arSectionsChain); } elseif (method_exists($adminMenu, "IsSectionActive")) { if ($adminMenu->IsSectionActive("menu_catalog_category_" . $IBLOCK_ID . "/" . $arSection["ID"])) { $arSectionTmp["items"] = CCatalogAdmin::get_sections_menu($IBLOCK_TYPE_ID, $IBLOCK_ID, $DEPTH_LEVEL + 1, $arSection["ID"], $arSectionsChain); } } $arSections[] = $arSectionTmp; } $intCount++; } if (!empty($arOtherSectionTmp)) { $arSections[] = $arOtherSectionTmp; } return $arSections; }
'IBLOCK_SECTION_ID'=>$find_section_section, 'find_section_section'=>$find_section_section, 'from' => 'iblock_list_admin' )), ); } } if(CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $find_section_section, "section_section_bind") && $arIBTYPE["SECTIONS"]!="N") { $aContext[] = array( "TEXT" => htmlspecialcharsbx($arIBlock["SECTION_ADD"]), "ICON" => ($boolBtnNew ? "" : "btn_new"), "LINK" => CIBlock::GetAdminSectionEditLink($IBLOCK_ID, 0, array( 'IBLOCK_SECTION_ID'=>$find_section_section, 'find_section_section'=>$find_section_section, 'from' => 'iblock_list_admin', )), ); } if(strlen($sLastFolder)>0) { $aContext[] = Array( "TEXT" => GetMessage("IBLIST_A_UP"), "LINK" => $sLastFolder, "TITLE" => GetMessage("IBLIST_A_UP_TITLE"), ); } if($bBizproc && IsModuleInstalled("bizprocdesigner"))
$arProperties[$ar["ID"]][$ar["PROPERTY_VALUE_ID"]] = $ar["VALUE_ENUM"]; } else { $arProperties[$ar["ID"]][$ar["PROPERTY_VALUE_ID"]] = $ar["VALUE"]; } } } foreach ($arSelectedProps as $aProp) { $v = ''; foreach ($arProperties[$aProp['ID']] as $property_value_id => $property_value) { $res = ''; if ($aProp['PROPERTY_TYPE'] == 'F') { $res = CFileInput::Show('NO_FIELDS[' . $property_value_id . ']', $property_value, array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => $maxImageSize, "MIN_SIZE" => $minImageSize), array('upload' => false, 'medialib' => false, 'file_dialog' => false, 'cloud' => false, 'del' => false, 'description' => false)); } elseif ($aProp['PROPERTY_TYPE'] == 'G') { $t = GetSectionName($property_value); if ($t) { $res = $t['NAME'] . ' [<a href="' . htmlspecialcharsbx(CIBlock::GetAdminSectionEditLink($t['IBLOCK_ID'], $t['ID'])) . '" title="' . GetMessage("SPS_ELSEARCH_SECTION_EDIT") . '">' . $t['ID'] . '</a>]'; } } elseif ($aProp['PROPERTY_TYPE'] == 'E') { $t = GetElementName($property_value); if ($t) { $res = $t['NAME'] . ' [<a href="' . htmlspecialcharsbx(CIBlock::GetAdminElementEditLink($t['IBLOCK_ID'], $t['ID'])) . '" title="' . GetMessage("SPS_ELSEARCH_ELEMENT_EDIT") . '">' . $t['ID'] . '</a>]'; } } else { $res = htmlspecialcharsex($property_value); } if ($res != "") { $v .= ($v != '' ? ' / ' : '') . $res; } } if ($v != "") { $row->AddViewField("PROPERTY_" . $aProp['ID'], $v);
/** * * * * * * @return mixed <p></p> * * * <h4>Example</h4> * <pre> * <br><br> * </pre> * * * * <h4>See Also</h4> * <p></p><a name="examples"></a> * * * @static * @link http://dev.1c-bitrix.ru/api_help/iblock/classes/ciblock/getpanelbuttons.php * @author Bitrix */ public static function GetPanelButtons($IBLOCK_ID = 0, $ELEMENT_ID = 0, $SECTION_ID = 0, $arOptions = array()) { /** @global CMain $APPLICATION */ global $APPLICATION; $arButtons = array("view" => array(), "edit" => array(), "configure" => array(), "submenu" => array()); if (array_key_exists("SECTION_BUTTONS", $arOptions) && $arOptions["SECTION_BUTTONS"] === false) { $bSectionButtons = false; } else { $bSectionButtons = true; } if (array_key_exists("SESSID", $arOptions) && $arOptions["SESSID"] === false) { $bSessID = false; } else { $bSessID = true; } $IBLOCK_ID = intval($IBLOCK_ID); $ELEMENT_ID = intval($ELEMENT_ID); $SECTION_ID = intval($SECTION_ID); if ($ELEMENT_ID > 0 && ($IBLOCK_ID <= 0 || $bSectionButtons && $SECTION_ID == 0)) { $rsIBlockElement = CIBlockElement::GetList(array(), array("ID" => $ELEMENT_ID, "ACTIVE_DATE" => "Y", "ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y"), false, false, array("ID", "IBLOCK_ID", "IBLOCK_SECTION_ID")); if ($arIBlockElement = $rsIBlockElement->Fetch()) { $IBLOCK_ID = $arIBlockElement["IBLOCK_ID"]; $SECTION_ID = $arIBlockElement["IBLOCK_SECTION_ID"]; } } if ($IBLOCK_ID <= 0) { return $arButtons; } $bCatalog = false; if (isset($arOptions["CATALOG"]) && $arOptions["CATALOG"] == true) { if (CModule::IncludeModule('catalog')) { $bCatalog = true; } } $return_url = array("add_element" => "", "edit_element" => "", "edit_iblock" => "", "history_element" => "", "edit_section" => "", "add_section" => "", "delete_section" => "", "delete_element" => "", "element_list" => "", "section_list" => ""); if (array_key_exists("RETURN_URL", $arOptions)) { if (is_array($arOptions["RETURN_URL"])) { foreach ($arOptions["RETURN_URL"] as $key => $url) { if (!empty($url) && array_key_exists($key, $return_url)) { $return_url[$key] = $url; } } } elseif (!empty($arOptions["RETURN_URL"])) { foreach ($return_url as $key => $url) { $return_url[$key] = $arOptions["RETURN_URL"]; } } } $str = ""; foreach ($return_url as $key => $url) { if (empty($url)) { if (empty($str)) { if (defined("BX_AJAX_PARAM_ID")) { $str = $APPLICATION->GetCurPageParam("", array(BX_AJAX_PARAM_ID)); } else { $str = $APPLICATION->GetCurPageParam(); } } $return_url[$key] = $str; } } $arIBlock = CIBlock::GetArrayByID($IBLOCK_ID); $bWorkflow = CModule::IncludeModule("workflow") && $arIBlock["WORKFLOW"] !== "N"; $s = $bWorkflow ? "&WF=Y" : ""; $arLabels = $arOptions["LABELS"]; if ($ELEMENT_ID > 0 && CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ELEMENT_ID, "element_edit")) { $url = "/bitrix/admin/" . CIBlock::GetAdminElementEditLink($IBLOCK_ID, $ELEMENT_ID, array("force_catalog" => $bCatalog, "filter_section" => $SECTION_ID, "bxpublic" => "Y", "from_module" => "iblock", "return_url" => $return_url["edit_element"])) . $s; $action = $APPLICATION->GetPopupLink(array("URL" => $url, "PARAMS" => array("width" => 700, 'height' => 400, 'resize' => false))); $arButton = array("TEXT" => strlen($arLabels["ELEMENT_EDIT_TEXT"]) ? $arLabels["ELEMENT_EDIT_TEXT"] : $arIBlock["ELEMENT_EDIT"], "TITLE" => strlen($arLabels["ELEMENT_EDIT_TITLE"]) ? $arLabels["ELEMENT_EDIT_TITLE"] : $arIBlock["ELEMENT_EDIT"], "ACTION" => 'javascript:' . $action, "ACTION_URL" => $url, "ONCLICK" => $action, "DEFAULT" => $APPLICATION->GetPublicShowMode() != 'configure' ? true : false, "ICON" => "bx-context-toolbar-edit-icon", "ID" => "bx-context-toolbar-edit-element"); $arButtons["edit"]["edit_element"] = $arButton; $arButtons["configure"]["edit_element"] = $arButton; $url = str_replace("&bxpublic=Y&from_module=iblock", "", $url); $arButton["ACTION"] = "javascript:jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')"; unset($arButton["ONCLICK"]); $arButtons["submenu"]["edit_element"] = $arButton; if ($bWorkflow) { $url = "/bitrix/admin/iblock_history_list.php?type=" . $arIBlock["IBLOCK_TYPE_ID"] . "&lang=" . LANGUAGE_ID . "&IBLOCK_ID=" . $IBLOCK_ID . "&ELEMENT_ID=" . $ELEMENT_ID . "&filter_section=" . $SECTION_ID . "&return_url=" . UrlEncode($return_url["history_element"]); $arButton = array("TEXT" => GetMessage("IBLOCK_PANEL_HISTORY_BUTTON"), "TITLE" => GetMessage("IBLOCK_PANEL_HISTORY_BUTTON"), "ACTION" => "javascript:jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ID" => "bx-context-toolbar-history-element"); $arButtons["submenu"]["history_element"] = $arButton; } } if (CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "section_element_bind")) { $url = "/bitrix/admin/" . CIBlock::GetAdminElementEditLink($IBLOCK_ID, null, array("force_catalog" => $bCatalog, "filter_section" => $SECTION_ID, "IBLOCK_SECTION_ID" => $SECTION_ID, "bxpublic" => "Y", "from_module" => "iblock", "return_url" => $return_url["add_element"])); $action = $APPLICATION->GetPopupLink(array("URL" => $url, "PARAMS" => array("width" => 700, 'height' => 400, 'resize' => false))); $arButton = array("TEXT" => strlen($arLabels["ELEMENT_ADD_TEXT"]) ? $arLabels["ELEMENT_ADD_TEXT"] : $arIBlock["ELEMENT_ADD"], "TITLE" => strlen($arLabels["ELEMENT_ADD_TITLE"]) ? $arLabels["ELEMENT_ADD_TITLE"] : $arIBlock["ELEMENT_ADD"], "ACTION" => 'javascript:' . $action, "ACTION_URL" => $url, "ONCLICK" => $action, "ICON" => "bx-context-toolbar-create-icon", "ID" => "bx-context-toolbar-add-element"); $arButtons["edit"]["add_element"] = $arButton; $arButtons["configure"]["add_element"] = $arButton; $arButtons["intranet"][] = array('TEXT' => $arButton["TEXT"], 'TITLE' => $arButton["TITLE"], 'ICON' => 'add', 'ONCLICK' => $arButton["ACTION"], 'SORT' => 1000); $url = str_replace("&bxpublic=Y&from_module=iblock", "", $url); $arButton["ACTION"] = "javascript:jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')"; unset($arButton["ONCLICK"]); $arButtons["submenu"]["add_element"] = $arButton; } if ($ELEMENT_ID > 0 && CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ELEMENT_ID, "element_delete")) { //Delete Element if (!empty($arButtons["edit"])) { $arButtons["edit"][] = array("SEPARATOR" => "Y", "HREF" => ""); } if (!empty($arButtons["configure"])) { $arButtons["configure"][] = array("SEPARATOR" => "Y", "HREF" => ""); } if (!empty($arButtons["submenu"])) { $arButtons["submenu"][] = array("SEPARATOR" => "Y", "HREF" => ""); } $url = CIBlock::GetAdminElementListLink($IBLOCK_ID, array('action' => 'delete')); if ($bSessID) { $url .= '&' . bitrix_sessid_get(); } $url .= '&ID=' . (preg_match('/^iblock_list_admin\\.php/', $url) ? "E" : "") . $ELEMENT_ID . "&return_url=" . UrlEncode($return_url["delete_element"]); $url = "/bitrix/admin/" . $url; $arButton = array("TEXT" => strlen($arLabels["ELEMENT_DELETE_TEXT"]) ? $arLabels["ELEMENT_DELETE_TEXT"] : $arIBlock["ELEMENT_DELETE"], "TITLE" => strlen($arLabels["ELEMENT_DELETE_TITLE"]) ? $arLabels["ELEMENT_DELETE_TITLE"] : $arIBlock["ELEMENT_DELETE"], "ACTION" => "javascript:if(confirm('" . GetMessageJS("IBLOCK_PANEL_ELEMENT_DEL_CONF") . "'))jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ACTION_URL" => $url, "ONCLICK" => "if(confirm('" . GetMessageJS("IBLOCK_PANEL_ELEMENT_DEL_CONF") . "'))jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ICON" => "bx-context-toolbar-delete-icon", "ID" => "bx-context-toolbar-delete-element"); $arButtons["edit"]["delete_element"] = $arButton; $arButtons["configure"]["delete_element"] = $arButton; $arButtons["submenu"]["delete_element"] = $arButton; } if ($ELEMENT_ID <= 0 && $bSectionButtons) { $rsIBTYPE = CIBlockType::GetByID($arIBlock["IBLOCK_TYPE_ID"]); if (($arIBTYPE = $rsIBTYPE->Fetch()) && $arIBTYPE["SECTIONS"] == "Y") { if ($SECTION_ID > 0 && CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "section_edit")) { if (!empty($arButtons["edit"])) { $arButtons["edit"][] = array("SEPARATOR" => "Y", "HREF" => ""); } if (!empty($arButtons["configure"])) { $arButtons["configure"][] = array("SEPARATOR" => "Y", "HREF" => ""); } if (!empty($arButtons["submenu"])) { $arButtons["submenu"][] = array("SEPARATOR" => "Y", "HREF" => ""); } $url = "/bitrix/admin/" . CIBlock::GetAdminSectionEditLink($IBLOCK_ID, $SECTION_ID, array("force_catalog" => $bCatalog, "filter_section" => $SECTION_ID, "bxpublic" => "Y", "from_module" => "iblock", "return_url" => $return_url["edit_section"])); $action = $APPLICATION->GetPopupLink(array("URL" => $url, "PARAMS" => array("width" => 700, 'height' => 400, 'resize' => false))); $arButton = array("TEXT" => strlen($arLabels["SECTION_EDIT_TEXT"]) ? $arLabels["SECTION_EDIT_TEXT"] : $arIBlock["SECTION_EDIT"], "TITLE" => strlen($arLabels["SECTION_EDIT_TITLE"]) ? $arLabels["SECTION_EDIT_TITLE"] : $arIBlock["SECTION_EDIT"], "ACTION" => 'javascript:' . $action, "ACTION_URL" => $url, "ICON" => "bx-context-toolbar-edit-icon", "ONCLICK" => $action, "DEFAULT" => $APPLICATION->GetPublicShowMode() != 'configure' ? true : false, "ID" => "bx-context-toolbar-edit-section"); $arButtons["edit"]["edit_section"] = $arButton; $arButtons["configure"]["edit_section"] = $arButton; $url = str_replace("&bxpublic=Y&from_module=iblock", "", $url); $arButton["ACTION"] = "javascript:jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')"; unset($arButton["ONCLICK"]); $arButtons["submenu"]["edit_section"] = $arButton; } if (CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "section_section_bind")) { $url = "/bitrix/admin/" . CIBlock::GetAdminSectionEditLink($IBLOCK_ID, null, array("force_catalog" => $bCatalog, "IBLOCK_SECTION_ID" => $SECTION_ID, "filter_section" => $SECTION_ID, "bxpublic" => "Y", "from_module" => "iblock", "return_url" => $return_url["add_section"])); $action = $APPLICATION->GetPopupLink(array("URL" => $url, "PARAMS" => array("width" => 700, 'height' => 400, 'resize' => false))); $arButton = array("TEXT" => strlen($arLabels["SECTION_ADD_TEXT"]) ? $arLabels["SECTION_ADD_TEXT"] : $arIBlock["SECTION_ADD"], "TITLE" => strlen($arLabels["SECTION_ADD_TITLE"]) ? $arLabels["SECTION_ADD_TITLE"] : $arIBlock["SECTION_ADD"], "ACTION" => 'javascript:' . $action, "ACTION_URL" => $url, "ICON" => "bx-context-toolbar-create-icon", "ID" => "bx-context-toolbar-add-section", "ONCLICK" => $action); $arButtons["edit"]["add_section"] = $arButton; $arButtons["configure"]["add_section"] = $arButton; $url = str_replace("&bxpublic=Y&from_module=iblock", "", $url); $arButton["ACTION"] = "javascript:jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')"; unset($arButton["ONCLICK"]); $arButtons["submenu"]["add_section"] = $arButton; } //Delete section if ($SECTION_ID > 0 && CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "section_delete")) { $url = CIBlock::GetAdminSectionListLink($IBLOCK_ID, array('action' => 'delete')); if ($bSessID) { $url .= '&' . bitrix_sessid_get(); } $url .= '&ID[]=' . (preg_match('/^iblock_list_admin\\.php/', $url) ? "S" : "") . $SECTION_ID . "&return_url=" . UrlEncode($return_url["delete_section"]); $url = "/bitrix/admin/" . $url; $arButton = array("TEXT" => strlen($arLabels["SECTION_DELETE_TEXT"]) ? $arLabels["SECTION_DELETE_TEXT"] : $arIBlock["SECTION_DELETE"], "TITLE" => strlen($arLabels["SECTION_DELETE_TITLE"]) ? $arLabels["SECTION_DELETE_TITLE"] : $arIBlock["SECTION_DELETE"], "ACTION" => "javascript:if(confirm('" . GetMessageJS("IBLOCK_PANEL_SECTION_DEL_CONF") . "'))jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ACTION_URL" => $url, "ONCLICK" => "if(confirm('" . GetMessageJS("IBLOCK_PANEL_SECTION_DEL_CONF") . "'))jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ICON" => "bx-context-toolbar-delete-icon", "ID" => "bx-context-toolbar-delete-section"); $arButtons["edit"]["delete_section"] = $arButton; $arButtons["configure"]["delete_section"] = $arButton; $arButtons["submenu"]["delete_section"] = $arButton; } } } if ($IBLOCK_ID > 0 && CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "iblock_admin_display")) { if (!empty($arButtons["submenu"])) { $arButtons["submenu"][] = array("SEPARATOR" => "Y", "HREF" => ""); } if ($SECTION_ID > 0) { $url = "/bitrix/admin/" . CIBlock::GetAdminElementListLink($IBLOCK_ID, array('find_section_section' => $SECTION_ID)); } else { $url = "/bitrix/admin/" . CIBlock::GetAdminElementListLink($IBLOCK_ID, array('find_el_y' => 'Y')); } $arButton = array("TEXT" => strlen($arLabels["ELEMENTS_NAME_TEXT"]) ? $arLabels["ELEMENTS_NAME_TEXT"] : $arIBlock["ELEMENTS_NAME"], "TITLE" => strlen($arLabels["ELEMENTS_NAME_TITLE"]) ? $arLabels["ELEMENTS_NAME_TITLE"] : $arIBlock["ELEMENTS_NAME"], "ACTION" => "javascript:jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ACTION_URL" => $url, "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ID" => "bx-context-toolbar-elements-list"); $arButtons["submenu"]["element_list"] = $arButton; $arButtons["intranet"]["element_list"] = array('TEXT' => $arButton["TEXT"], 'TITLE' => $arButton["TITLE"], 'ICON' => 'settings', 'ONCLICK' => $arButton["ACTION"], 'SORT' => 1010); $url = "/bitrix/admin/" . CIBlock::GetAdminSectionListLink($IBLOCK_ID, array('find_section_section' => $SECTION_ID)); $arButton = array("TEXT" => strlen($arLabels["SECTIONS_NAME_TEXT"]) ? $arLabels["SECTIONS_NAME_TEXT"] : $arIBlock["SECTIONS_NAME"], "TITLE" => strlen($arLabels["SECTIONS_NAME_TITLE"]) ? $arLabels["SECTIONS_NAME_TITLE"] : $arIBlock["SECTIONS_NAME"], "ACTION" => "javascript:jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ACTION_URL" => $url, "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ID" => "bx-context-toolbar-sections-list"); $arButtons["submenu"]["section_list"] = $arButton; if (CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "iblock_edit")) { $url = "/bitrix/admin/iblock_edit.php?type=" . $arIBlock["IBLOCK_TYPE_ID"] . "&lang=" . LANGUAGE_ID . "&ID=" . $IBLOCK_ID . "&return_url=" . UrlEncode($return_url["edit_iblock"]); $arButton = array("TEXT" => GetMessage("IBLOCK_PANEL_EDIT_IBLOCK_BUTTON", array("#IBLOCK_NAME#" => $arIBlock["NAME"])), "TITLE" => GetMessage("IBLOCK_PANEL_EDIT_IBLOCK_BUTTON", array("#IBLOCK_NAME#" => $arIBlock["NAME"])), "ACTION" => "javascript:jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ACTION_URL" => $url, "ONCLICK" => "jsUtils.Redirect([], '" . CUtil::JSEscape($url) . "')", "ID" => "bx-context-toolbar-edit-iblock"); $arButtons["submenu"]["edit_iblock"] = $arButton; } } return $arButtons; }
'medialib' => false, 'file_dialog' => false, 'cloud' => false, 'del' => false, 'description' => false, ) ); } elseif ($prop['PROPERTY_TYPE'] == 'G') { if (intval($prop["VALUE"]) > 0) { $rsSection = CIBlockSection::GetList( array(), array("ID" => $prop["VALUE"]), false, array('ID', 'NAME', 'IBLOCK_ID') ); if ($arSection = $rsSection->GetNext()) { $arViewHTML[] = $arSection['NAME'] . ' [<a href="' . htmlspecialcharsbx(CIBlock::GetAdminSectionEditLink($arSection['IBLOCK_ID'], $arSection['ID'])) . '" title="' . GetMessage("IBEL_A_SEC_EDIT") . '">' . $arSection['ID'] . '</a>]'; } } } elseif ($prop['PROPERTY_TYPE'] == 'E') { if ($t = GetElementName($prop["VALUE"])) { $arViewHTML[] = $t['NAME'] . ' [<a href="' . htmlspecialcharsbx(CIBlock::GetAdminElementEditLink($t['IBLOCK_ID'], $t['ID'], array( "find_section_section" => $find_section_section, 'WF' => 'Y', ))) . '" title="' . GetMessage("IBEL_A_EL_EDIT") . '">' . $t['ID'] . '</a>]'; } } $bUserMultiple = $prop["MULTIPLE"] == "Y" && array_key_exists("GetPropertyFieldHtmlMulty", $arUserType); if ($bUserMultiple) {
echo GetMessage("IBSEC_E_PROP_TABLE_ACTION_ADD"); ?> " onclick="javascript:addSectionProperty(<?php echo $arCatalog["IBLOCK_ID"]; ?> , 'select_SKU_SECTION_PROPERTY', 'shadow_SKU_SECTION_PROPERTY', 'table_SKU_SECTION_PROPERTY')"> </td></tr> <?php } ?> <?php $tabControl->EndCustomField("SECTION_PROPERTY", ''); } if (strlen($return_url) > 0) { $bu = $return_url; } else { $bu = "/bitrix/admin/" . CIBlock::GetAdminSectionListLink($IBLOCK_ID, array('find_section_section' => intval($find_section_section))); } if (!defined('BX_PUBLIC_MODE') || BX_PUBLIC_MODE != 1) { $tabControl->Buttons(array("disabled" => false, "btnSaveAndAdd" => true, "return_url" => $bu)); } elseif ($nobuttons !== "Y") { $save_and_add = "{\n\t\ttitle: '" . CUtil::JSEscape(GetMessage("IBSEC_E_SAVE_AND_ADD")) . "',\n\t\tname: 'save_and_add',\n\t\tid: 'save_and_add',\n\t\tclassName: 'adm-btn-add',\n\t\taction: function () {\n\t\t\tvar FORM = this.parentWindow.GetForm();\n\t\t\tFORM.appendChild(BX.create('INPUT', {\n\t\t\t\tprops: {\n\t\t\t\t\ttype: 'hidden',\n\t\t\t\t\tname: 'save_and_add',\n\t\t\t\t\tvalue: 'Y'\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis.parentWindow.hideNotify();\n\t\t\tthis.disableUntilError();\n\t\t\tthis.parentWindow.Submit();\n\t\t}\n\t}"; $cancel = "{\n\t\ttitle: '" . CUtil::JSEscape(GetMessage("admin_lib_edit_cancel")) . "',\n\t\tname: 'cancel',\n\t\tid: 'cancel',\n\t\taction: function () {\n\t\t\tBX.WindowManager.Get().Close();\n\t\t\tif(window.reloadAfterClose)\n\t\t\t\ttop.BX.reload(true);\n\t\t}\n\t}"; $tabControl->ButtonsPublic(array('.btnSave', $cancel, $save_and_add)); } $tabControl->Show(); $tabControl->ShowWarnings($tabControl->GetName(), $message); if (CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "iblock_edit") && (!defined('BX_PUBLIC_MODE') || BX_PUBLIC_MODE != 1)) { echo BeginNote(), GetMessage("IBSEC_E_IBLOCK_MANAGE_HINT"), ' <a href="iblock_edit.php?type=' . htmlspecialcharsbx($type) . '&lang=' . LANGUAGE_ID . '&ID=' . $IBLOCK_ID . '&admin=Y&return_url=' . urlencode(CIBlock::GetAdminSectionEditLink($IBLOCK_ID, $ID, array("find_section_section" => intval($find_section_section), "return_url" => strlen($return_url) > 0 ? $return_url : null))) . '">', GetMessage("IBSEC_E_IBLOCK_MANAGE_HINT_HREF"), '</a>', EndNote(); } require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
//View part if (array_key_exists("GetAdminListViewHTML", $arUserType)) { $arViewHTML[] = call_user_func_array($arUserType["GetAdminListViewHTML"], array($prop, array("VALUE" => $prop["~VALUE"], "DESCRIPTION" => $prop["~DESCRIPTION"]), array("VALUE" => $VALUE_NAME, "DESCRIPTION" => $DESCR_NAME, "MODE" => "iblock_element_admin", "FORM_NAME" => "form_" . $sTableID))); } elseif ($prop['PROPERTY_TYPE'] == 'N') { $arViewHTML[] = $prop["VALUE"]; } elseif ($prop['PROPERTY_TYPE'] == 'S') { $arViewHTML[] = $prop["VALUE"]; } elseif ($prop['PROPERTY_TYPE'] == 'L') { $arViewHTML[] = $prop["VALUE_ENUM"]; } elseif ($prop['PROPERTY_TYPE'] == 'F') { $arViewHTML[] = CFileInput::Show('NO_FIELDS[' . $prop['PROPERTY_VALUE_ID'] . ']', $prop["VALUE"], array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => $maxImageSize, "MIN_SIZE" => $minImageSize), array('upload' => false, 'medialib' => false, 'file_dialog' => false, 'cloud' => false, 'del' => false, 'description' => false)); } elseif ($prop['PROPERTY_TYPE'] == 'G') { if (intval($prop["VALUE"]) > 0) { $rsSection = CIBlockSection::GetList(array(), array("ID" => $prop["VALUE"]), false, array('ID', 'NAME', 'IBLOCK_ID')); if ($arSection = $rsSection->GetNext()) { $arViewHTML[] = $arSection['NAME'] . ' [<a href="' . htmlspecialcharsbx(CIBlock::GetAdminSectionEditLink($arSection['IBLOCK_ID'], $arSection['ID'])) . '" title="' . GetMessage("IBEL_A_SEC_EDIT") . '">' . $arSection['ID'] . '</a>]'; } } } elseif ($prop['PROPERTY_TYPE'] == 'E') { if ($t = GetElementName($prop["VALUE"])) { $arViewHTML[] = $t['NAME'] . ' [<a href="' . htmlspecialcharsbx(CIBlock::GetAdminElementEditLink($t['IBLOCK_ID'], $t['ID'], array("find_section_section" => $find_section_section, 'WF' => 'Y'))) . '" title="' . GetMessage("IBEL_A_EL_EDIT") . '">' . $t['ID'] . '</a>]'; } } //Edit Part $bUserMultiple = $prop["MULTIPLE"] == "Y" && array_key_exists("GetPropertyFieldHtmlMulty", $arUserType); if ($bUserMultiple) { if ($last_property_id != $prop["ID"]) { $VALUE_NAME = 'FIELDS[' . $f_ID . '][PROPERTY_' . $prop['ID'] . ']'; $arEditHTML[] = call_user_func_array($arUserType["GetPropertyFieldHtmlMulty"], array($prop, $arProperties[$prop["ID"]], array("VALUE" => $VALUE_NAME, "DESCRIPTION" => $VALUE_NAME, "MODE" => "iblock_element_admin", "FORM_NAME" => "form_" . $sTableID))); } } elseif (array_key_exists("GetPropertyFieldHtml", $arUserType)) {
public function GetAdminListViewHTML($arProperty, $arValue, $strHTMLControlName) { $strResult = ''; $mxResult = self::GetPropertyValue($arProperty, $arValue); if (is_array($mxResult)) { $strResult = $mxResult['NAME'] . ' [<a href="/bitrix/admin/' . CIBlock::GetAdminSectionEditLink($mxResult['IBLOCK_ID'], $mxResult['ID'], array('WF' => 'Y')) . '" title="' . Loc::getMessage("BT_UT_SAUTOCOMPLETE_MESS_ELEMENT_EDIT") . '">' . $mxResult['ID'] . '</a>]'; } return $strResult; }
$aContext = array(); if ($boolIBlockElementAdd) { $boolBtnNew = true; if (!empty($arCatalog)) { CCatalogAdminTools::setProductFormParams(); $arCatalogBtns = CCatalogAdminTools::getIBlockElementMenu($IBLOCK_ID, $arCatalog, array('IBLOCK_SECTION_ID' => $find_section_section, 'find_section_section' => $find_section_section, 'from' => 'iblock_list_admin')); if (!empty($arCatalogBtns)) { $aContext = $arCatalogBtns; } } if (empty($aContext)) { $aContext[] = array("TEXT" => htmlspecialcharsbx($arIBlock["ELEMENT_ADD"]), "ICON" => "btn_new", "LINK" => CIBlock::GetAdminElementEditLink($IBLOCK_ID, 0, array('IBLOCK_SECTION_ID' => $find_section_section, 'find_section_section' => $find_section_section, 'from' => 'iblock_list_admin'))); } } if (CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $find_section_section, "section_section_bind") && $arIBTYPE["SECTIONS"] != "N") { $aContext[] = array("TEXT" => htmlspecialcharsbx($arIBlock["SECTION_ADD"]), "ICON" => $boolBtnNew ? "" : "btn_new", "LINK" => CIBlock::GetAdminSectionEditLink($IBLOCK_ID, 0, array('IBLOCK_SECTION_ID' => $find_section_section, 'find_section_section' => $find_section_section, 'from' => 'iblock_list_admin'))); } if (strlen($sLastFolder) > 0) { $aContext[] = array("TEXT" => GetMessage("IBLIST_A_UP"), "LINK" => $sLastFolder, "TITLE" => GetMessage("IBLIST_A_UP_TITLE")); } if ($bBizproc && IsModuleInstalled("bizprocdesigner")) { $bCanDoIt = CBPDocument::CanUserOperateDocumentType(CBPCanUserOperateOperation::CreateWorkflow, $USER->GetID(), array(MODULE_ID, ENTITY, DOCUMENT_TYPE)); if ($bCanDoIt) { $aContext[] = array("TEXT" => GetMessage("IBLIST_BTN_BP"), "ICON" => "btn_bp", "LINK" => 'iblock_bizproc_workflow_admin.php?document_type=iblock_' . $IBLOCK_ID . '&lang=' . LANGUAGE_ID . '&back_url_list=' . urlencode($REQUEST_URI)); } } $lAdmin->AddAdminContextMenu($aContext); $lAdmin->CheckListMode(); $APPLICATION->SetTitle($arIBlock["NAME"] . ": " . ($arIBTYPE["SECTIONS"] == "Y" ? $arIBlock["SECTIONS_NAME"] : $arIBlock["ELEMENTS_NAME"])); $APPLICATION->AddHeadScript('/bitrix/js/iblock/iblock_edit.js'); require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
BX.WindowManager.Get().Close(); if(window.reloadAfterClose) top.BX.reload(true); } }"; $tabControl->ButtonsPublic(array( '.btnSave', $cancel, $save_and_add, )); endif; $tabControl->Show(); $tabControl->ShowWarnings($tabControl->GetName(), $message); if(CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "iblock_edit") && (!defined('BX_PUBLIC_MODE') || BX_PUBLIC_MODE != 1)) { echo BeginNote(), GetMessage("IBSEC_E_IBLOCK_MANAGE_HINT"), ' <a href="iblock_edit.php?type='.htmlspecialcharsbx($type).'&lang='.LANGUAGE_ID.'&ID='.$IBLOCK_ID.'&admin=Y&return_url='.urlencode(CIBlock::GetAdminSectionEditLink($IBLOCK_ID, $ID, array("find_section_section" => intval($find_section_section), "return_url" => strlen($return_url) > 0? $return_url: null))).'">', GetMessage("IBSEC_E_IBLOCK_MANAGE_HINT_HREF"), '</a>', EndNote() ; } require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin.php"); ?>
} } foreach ($arSectionOps as $id => $arOps) { if (isset($arOps["section_edit"])) { $arGroupActions["activate"] = GetMessage("MAIN_ADMIN_LIST_ACTIVATE"); $arGroupActions["deactivate"] = GetMessage("MAIN_ADMIN_LIST_DEACTIVATE"); break; } } $lAdmin->AddGroupActionTable($arGroupActions); $aContext = array(); if (CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $find_section_id, "section_element_bind")) { $aContext[] = array("TEXT" => htmlspecialcharsbx($arIBlock["ELEMENT_ADD"]), "ICON" => "btn_new", "LINK" => CIBlock::GetAdminElementEditLink($IBLOCK_ID, 0, array('IBLOCK_SECTION_ID' => $find_section_section, 'from' => 'iblock_section_admin', 'find_section_section' => $find_section_section)), "TITLE" => GetMessage("IBSEC_A_ADDEL_TITLE")); } if (CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $find_section_id, "section_section_bind")) { $aContext[] = array("TEXT" => htmlspecialcharsbx($arIBlock["SECTION_ADD"]), "ICON" => "btn_new", "LINK" => CIBlock::GetAdminSectionEditLink($IBLOCK_ID, 0, array('IBLOCK_SECTION_ID' => $find_section_section, 'from' => 'iblock_section_admin', 'find_section_section' => $find_section_section)), "TITLE" => GetMessage("IBSEC_A_SECTADD_PRESS")); } if (count($aContext) == 2) { unset($aContext[1]["ICON"]); } if (defined("CATALOG_PRODUCT")) { if ($find_section_section > 0) { $rsParent = CIBlockSection::GetList(array(), array("=ID" => $find_section_section), false, array("ID", "IBLOCK_SECTION_ID")); if ($arParent = $rsParent->Fetch()) { $aContext[] = array("TEXT" => GetMessage("IBSEC_A_UP"), "LINK" => CIBlock::GetAdminSectionListLink($IBLOCK_ID, array('find_section_section' => intval($arParent["IBLOCK_SECTION_ID"]))), "TITLE" => GetMessage("IBSEC_A_UP_TITLE")); } } } else { $aContext[] = array("TEXT" => htmlspecialcharsbx($arIBlock["ELEMENTS_NAME"]), "LINK" => htmlspecialcharsbx(CIBlock::GetAdminElementListLink($IBLOCK_ID, array('find_section_section' => $find_section_section))), "TITLE" => GetMessage("IBSEC_A_LISTEL_TITLE")); if ($_GET["tree"] == "Y") { $aContext[] = array("TEXT" => GetMessage("IBSEC_A_NOT_TREE"), "LINK" => CIBlock::GetAdminSectionListLink($IBLOCK_ID, array('find_section_section' => $find_section_section, 'tree' => 'N')), "TITLE" => GetMessage("IBSEC_A_NOT_TREE_TITLE"));
public static function GetAdminListViewHTML($arProperty, $arValue, $strHTMLControlName) { $strResult = ''; $strName = self::GetValue($arProperty['IBLOCK_ID'], $arValue['VALUE']); if ($strName != '') { $strResult = htmlspecialcharsbx($strName) . ' [<a href="' . htmlspecialcharsbx(CIBlock::GetAdminSectionEditLink($arProperty['IBLOCK_ID'], $arValue['VALUE'])) . '" title="' . GetMessage("IBEL_A_SEC_EDIT") . '">' . $arValue['VALUE'] . '</a>]'; } return $strResult; }