Esempio n. 1
0
$lAdmin->ShowChain($chain);

// toolbar
$boolBtnNew = false;
$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,
Esempio n. 2
0
 /**
  * <p>Метод возвращает массив, описывающий набор кнопок для управления элементами инфоблока. Метод статический.</p>
  *
  *
  * @param int $IBLOCK_ID = 0 Идентификатор инфоблока, которому принадлежит элемент.
  *
  * @param int $ELEMENT_ID = 0 Идентификатор текущего элемента информационного блока.
  *
  * @param int $SECTION_ID = 0 Идентификатор раздела инфоблока (при наличии).
  *
  * @param array $arOptions = array() Массив, содержащий локализацию названий и <a
  * href="http://dev.1c-bitrix.ru/api_help/iblock/fields.php#fiblocklang">всплывающих подсказок к
  * ним</a>. Должен содержать секцию <i>LABELS</i>, в которой ключами будут
  * названия действий с элементами и разделами информационных
  * блоков с префиксами <i>TEXT</i> и <i>TITLE</i> (<i>ELEMENT_ADD_TEXT</i> и <i>ELEMENT_ADD_TITLE</i>).
  * <br><br> Если массив отсутствует, то настройки локализации берутся
  * из настроек информационных блоков, которые возвращаются методом
  * <a href="http://dev.1c-bitrix.ru/api_help/iblock/classes/ciblock/GetArrayByID.php">CIBlock::GetArrayByID</a>.
  *
  * @return array <p>Массив, описывающий набор кнопок (добавление, редактирование,
  * настройка и пр.) с учётом уровней права доступа к информационным
  * блокам. </p> <h4>Смотрите также</h4> <ul> <li><a
  * href="http://dev.1c-bitrix.ru/api_help/iblock/fields.php#fiblocklang">Дополнительные параметры
  * информационных блоков</a></li> <li><a
  * href="http://dev.1c-bitrix.ru/api_help/iblock/classes/ciblock/GetArrayByID.php">CIBlock::GetArrayByID</a></li> </ul>
  * <br><br>
  *
  * @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;
     $windowParams = array('width' => 700, 'height' => 400, 'resize' => false);
     $arButtons = array("view" => array(), "edit" => array(), "configure" => array(), "submenu" => array());
     $bSectionButtons = !(isset($arOptions['SECTION_BUTTONS']) && $arOptions['SECTION_BUTTONS'] === false);
     $bSessID = !(isset($arOptions['SESSID']) && $arOptions['SESSID'] === false);
     $IBLOCK_ID = (int) $IBLOCK_ID;
     $ELEMENT_ID = (int) $ELEMENT_ID;
     $SECTION_ID = (int) $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;
     $useCatalogButtons = ($ELEMENT_ID <= 0 || isset($arOptions['SHOW_CATALOG_BUTTONS'])) && !empty($arOptions['USE_CATALOG_BUTTONS']) && is_array($arOptions['USE_CATALOG_BUTTONS']);
     $catalogButtons = array();
     if ($useCatalogButtons || isset($arOptions["CATALOG"]) && $arOptions["CATALOG"] == true) {
         if (self::$catalogIncluded === null) {
             self::$catalogIncluded = \Bitrix\Main\Loader::includeModule('catalog');
         }
         $bCatalog = self::$catalogIncluded;
         if (!self::$catalogIncluded) {
             $useCatalogButtons = false;
         }
     }
     if ($useCatalogButtons) {
         if (isset($arOptions['USE_CATALOG_BUTTONS']['add_product']) && $arOptions['USE_CATALOG_BUTTONS']['add_product'] == true) {
             $catalogButtons['add_product'] = true;
         }
         if (isset($arOptions['USE_CATALOG_BUTTONS']['add_sku']) && $arOptions['USE_CATALOG_BUTTONS']['add_sku'] == true) {
             $catalogButtons['add_sku'] = true;
         }
         if (empty($catalogButtons)) {
             $useCatalogButtons = false;
         }
     }
     $return_url = array("add_element" => "", "edit_element" => "", "edit_iblock" => "", "history_element" => "", "edit_section" => "", "add_section" => "", "delete_section" => "", "delete_element" => "", "element_list" => "", "section_list" => "");
     if (isset($arOptions['RETURN_URL'])) {
         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)) {
                 $str = \Bitrix\Main\Context::getCurrent()->getServer()->getRequestUri();
                 if (defined("BX_AJAX_PARAM_ID")) {
                     $str = CHTTP::urlDeleteParams($str, array(BX_AJAX_PARAM_ID));
                 }
             }
             $return_url[$key] = $str;
         }
     }
     $arIBlock = CIBlock::GetArrayByID($IBLOCK_ID);
     if (self::$workflowIncluded === null) {
         self::$workflowIncluded = \Bitrix\Main\Loader::includeModule('workflow');
     }
     $bWorkflow = self::$workflowIncluded && $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" => $windowParams));
         $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")) {
         $params = array("force_catalog" => $bCatalog, "filter_section" => $SECTION_ID, "IBLOCK_SECTION_ID" => $SECTION_ID, "bxpublic" => "Y", "from_module" => "iblock", "return_url" => $return_url["add_element"]);
         if ($useCatalogButtons) {
             CCatalogAdminTools::setProductFormParams();
             CCatalogAdminTools::setCatalogPanelButtons($arButtons, $IBLOCK_ID, $catalogButtons, $params, $windowParams);
         } else {
             $url = "/bitrix/admin/" . CIBlock::GetAdminElementEditLink($IBLOCK_ID, null, $params);
             $action = $APPLICATION->GetPopupLink(array("URL" => $url, "PARAMS" => $windowParams));
             $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" => $windowParams));
                 $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" => $windowParams));
                 $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;
 }
Esempio n. 3
0
echo GetFilterHiddens("find_");?>
<input type="hidden" name="linked_state" id="linked_state" value="<?if($bLinked) echo 'Y'; else echo 'N';?>">
<input type="hidden" name="Update" value="Y">
<input type="hidden" name="from" value="<?echo htmlspecialcharsbx($from)?>">
<input type="hidden" name="WF" value="<?echo htmlspecialcharsbx($WF)?>">
<input type="hidden" name="return_url" value="<?echo htmlspecialcharsbx($return_url)?>">
<?if($ID>0 && !$bCopy)
{
	?><input type="hidden" name="ID" value="<?echo $ID?>"><?
}
if ($bCopy)
{
	?><input type="hidden" name="copyID" value="<? echo $ID; ?>"><?
}
if ($bCatalog)
	CCatalogAdminTools::showFormParams();
?>
<input type="hidden" name="IBLOCK_SECTION_ID" value="<?echo intval($IBLOCK_SECTION_ID)?>">
<input type="hidden" name="TMP_ID" value="<?echo intval($TMP_ID)?>">
<?
$tabControl->EndEpilogContent();

$customTabber->SetErrorState($bVarsFromForm);

$arEditLinkParams = array(
	"find_section_section" => intval($find_section_section)
);
if ($bAutocomplete)
{
	$arEditLinkParams['lookup'] = $strLookup;
}
                ?>
 type="submit" class="adm-btn-add" name="save_and_add" id="save_and_add" value="<?php 
                echo GetMessage("IBLOCK_EL_SAVE_AND_ADD");
                ?>
"><?php 
            }
            $buttons_add_html = ob_get_contents();
            ob_end_clean();
            $tabControl->Buttons(false, $buttons_add_html);
        } elseif (!$bPropertyAjax && $nobuttons !== "Y") {
            $wfClose = "{\n\t\ttitle: '" . CUtil::JSEscape(GetMessage("IBLOCK_EL_CANC")) . "',\n\t\tname: 'dontsave',\n\t\tid: 'dontsave',\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: this.name,\n\t\t\t\t\tvalue: 'Y'\n\t\t\t\t}\n\t\t\t}));\n\t\t\tthis.disableUntilError();\n\t\t\tthis.parentWindow.Submit();\n\t\t}\n\t}";
            $save_and_add = "{\n\t\ttitle: '" . CUtil::JSEscape(GetMessage("IBLOCK_EL_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("IBLOCK_EL_CANC")) . "',\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}";
            $editInPanelParams = array('WF' => $WF == 'Y' ? 'Y' : null, 'find_section_section' => (int) $find_section_section, 'menu' => null);
            if (!empty($arMainCatalog)) {
                $editInPanelParams = CCatalogAdminTools::getFormParams($editInPanelParams);
            }
            $edit_in_panel = "{\n\t\ttitle: '" . CUtil::JSEscape(GetMessage('IBLOCK_EL_EDIT_IN_PANEL')) . "',\n\t\tname: 'edit_in_panel',\n\t\tid: 'edit_in_panel',\n\t\tclassName: 'adm-btn-add',\n\t\taction: function () {\n\t\t\tlocation.href = '/bitrix/admin/" . CIBlock::GetAdminElementEditLink($IBLOCK_ID, $ID, $editInPanelParams) . "';\n\t\t}\n\t}";
            unset($editInPanelParams);
            $tabControl->ButtonsPublic(array('.btnSave', $ID > 0 && $bWorkflow ? $wfClose : $cancel, $edit_in_panel, $save_and_add));
        }
        $tabControl->Show();
        if ((!defined('BX_PUBLIC_MODE') || BX_PUBLIC_MODE != 1) && CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "iblock_edit") && !$bAutocomplete) {
            echo BeginNote(), GetMessage("IBEL_E_IBLOCK_MANAGE_HINT"), ' <a href="/bitrix/admin/iblock_edit.php?type=' . htmlspecialcharsbx($type) . '&amp;lang=' . LANGUAGE_ID . '&amp;ID=' . $IBLOCK_ID . '&amp;admin=Y&amp;return_url=' . urlencode("/bitrix/admin/" . CIBlock::GetAdminElementEditLink($IBLOCK_ID, $ID, array("WF" => $WF == "Y" ? "Y" : null, "find_section_section" => intval($find_section_section), "return_url" => strlen($return_url) > 0 ? $return_url : null))) . '">', GetMessage("IBEL_E_IBLOCK_MANAGE_HINT_HREF"), '</a>', EndNote();
        }
        //////////////////////////
        //END of the custom form
        //////////////////////////
    }
}
if ($bAutocomplete) {