Example #1
0
function IBlockInheritedPropertyInput($iblock_id, $id, $data, $type, $checkboxLabel = "")
{
    $inherited = $data[$id]["INHERITED"] !== "N" && $checkboxLabel !== "";
    $inputId = "IPROPERTY_TEMPLATES_" . $id;
    $inputName = "IPROPERTY_TEMPLATES[" . $id . "][TEMPLATE]";
    $menuId = "mnu_IPROPERTY_TEMPLATES_" . $id;
    $resultId = "result_IPROPERTY_TEMPLATES_" . $id;
    $checkboxId = "ck_IPROPERTY_TEMPLATES_" . $id;
    if ($type === "S") {
        $menuItems = CIBlockParameters::GetInheritedPropertyTemplateSectionMenuItems($iblock_id, "InheritedPropertiesTemplates.insertIntoInheritedPropertiesTemplate", $menuId, $inputId);
    } else {
        $menuItems = CIBlockParameters::GetInheritedPropertyTemplateElementMenuItems($iblock_id, "InheritedPropertiesTemplates.insertIntoInheritedPropertiesTemplate", $menuId, $inputId);
    }
    $u = new CAdminPopupEx($menuId, $menuItems, array("zIndex" => 2000));
    $result = $u->Show(true) . '<script>
			window.ipropTemplates[window.ipropTemplates.length] = {
			"ID": "' . $id . '",
			"INPUT_ID": "' . $inputId . '",
			"RESULT_ID": "' . $resultId . '",
			"TEMPLATE": ""
			};
		</script>' . '<input type="hidden" name="' . $inputName . '" value="' . htmlspecialcharsbx($data[$id]["TEMPLATE"]) . '" />' . '<textarea onclick="InheritedPropertiesTemplates.enableTextArea(\'' . $inputId . '\')" name="' . $inputName . '" id="' . $inputId . '" ' . ($inherited ? 'readonly="readonly"' : '') . ' cols="55" rows="1" style="width:90%">' . htmlspecialcharsbx($data[$id]["TEMPLATE"]) . '</textarea>' . '<input style="float:right" type="button" id="' . $menuId . '" ' . ($inherited ? 'disabled="disabled"' : '') . ' value="...">' . '<br>';
    if ($checkboxLabel != "") {
        $result .= '<input type="hidden" name="IPROPERTY_TEMPLATES[' . $id . '][INHERITED]" value="Y">' . '<input type="checkbox" name="IPROPERTY_TEMPLATES[' . $id . '][INHERITED]" id="' . $checkboxId . '" value="N" ' . 'onclick="InheritedPropertiesTemplates.updateInheritedPropertiesTemplates()" ' . (!$inherited ? 'checked="checked"' : '') . '>' . '<label for="' . $checkboxId . '">' . $checkboxLabel . '</label><br>';
    }
    if (preg_match("/_FILE_NAME\$/", $id)) {
        $result .= '<input type="hidden" name="IPROPERTY_TEMPLATES[' . $id . '][LOWER]" value="N">' . '<input type="checkbox" name="IPROPERTY_TEMPLATES[' . $id . '][LOWER]" id="lower_' . $id . '" value="Y" ' . 'onclick="InheritedPropertiesTemplates.enableTextArea(\'' . $inputId . '\');InheritedPropertiesTemplates.updateInheritedPropertiesValues(false, true)" ' . ($data[$id]["LOWER"] !== "Y" ? '' : 'checked="checked"') . '>' . '<label for="lower_' . $id . '">' . GetMessage("IBLOCK_AT_FILE_NAME_LOWER") . '</label><br>';
        $result .= '<input type="hidden" name="IPROPERTY_TEMPLATES[' . $id . '][TRANSLIT]" value="N">' . '<input type="checkbox" name="IPROPERTY_TEMPLATES[' . $id . '][TRANSLIT]" id="translit_' . $id . '" value="Y" ' . 'onclick="InheritedPropertiesTemplates.enableTextArea(\'' . $inputId . '\');InheritedPropertiesTemplates.updateInheritedPropertiesValues(false, true)" ' . ($data[$id]["TRANSLIT"] !== "Y" ? '' : 'checked="checked"') . '>' . '<label for="translit_' . $id . '">' . GetMessage("IBLOCK_AT_FILE_NAME_TRANSLIT") . '</label><br>';
        $result .= '<input size="2" maxlength="1" type="text" name="IPROPERTY_TEMPLATES[' . $id . '][SPACE]" id="space_' . $id . '" value="' . htmlspecialcharsbx($data[$id]["SPACE"]) . '" ' . 'onchange="InheritedPropertiesTemplates.updateInheritedPropertiesValues(false, true)">' . GetMessage("IBLOCK_AT_FILE_NAME_SPACE") . '<br>';
    }
    $result .= '<b><div id="' . $resultId . '"></div></b>';
    return $result;
}
Example #2
0
        $u = new CAdminPopupEx("mnu_LIST_PAGE_URL", CIBlockParameters::GetPathTemplateMenuItems("LIST", "__SetUrlVar", "mnu_LIST_PAGE_URL", "LIST_PAGE_URL"), array("zIndex" => 2000));
        $u->Show();
        $u = new CAdminPopupEx("mnu_SECTION_PAGE_URL", CIBlockParameters::GetPathTemplateMenuItems("SECTION", "__SetUrlVar", "mnu_SECTION_PAGE_URL", "SECTION_PAGE_URL"), array("zIndex" => 2000));
        $u->Show();
        $arItems = CIBlockParameters::GetPathTemplateMenuItems("DETAIL", "__SetUrlVar", "mnu_DETAIL_PAGE_URL", "DETAIL_PAGE_URL");
        if ($str_CATALOG_TYPE == 'O') {
            $arItems[] = array("SEPARATOR" => true);
            $arItems[] = array("TEXT" => GetMessage("IB_E_URL_PRODUCT_ID"), "TITLE" => "#PRODUCT_URL# - " . GetMessage("IB_E_URL_PRODUCT_ID"), "ONCLICK" => "__SetUrlVar('#PRODUCT_URL#', 'mnu_DETAIL_PAGE_URL', 'DETAIL_PAGE_URL')");
        }
        $u = new CAdminPopupEx("mnu_DETAIL_PAGE_URL", $arItems, array("zIndex" => 2000));
        $u->Show();
        $arItems = CIBlockParameters::GetPathTemplateMenuItems("DETAIL", "__SetUrlVar", "mnu_CANONICAL_PAGE_URL", "CANONICAL_PAGE_URL");
        array_unshift($arItems, array("SEPARATOR" => true));
        array_unshift($arItems, array("TEXT" => "https://", "TITLE" => "", "ONCLICK" => "__SetUrlVar('https://', 'mnu_CANONICAL_PAGE_URL', 'CANONICAL_PAGE_URL')"));
        array_unshift($arItems, array("TEXT" => "http://", "TITLE" => "", "ONCLICK" => "__SetUrlVar('http://', 'mnu_CANONICAL_PAGE_URL', 'CANONICAL_PAGE_URL')"));
        $u = new CAdminPopupEx("mnu_CANONICAL_PAGE_URL", $arItems, array("zIndex" => 2000));
        $u->Show();
        ?>
<script>
	var InheritedPropertiesTemplates = new JCInheritedPropertiesTemplates(
		'frm',
		'/bitrix/admin/iblock_templates.ajax.php?ENTITY_TYPE=B&ENTITY_ID=<?php 
        echo intval($ID);
        ?>
'
	);
	BX.ready(function(){
		setTimeout(function(){
			InheritedPropertiesTemplates.updateInheritedPropertiesTemplates(true);
		}, 1000);
	});
Example #3
0
 function ShowTabButtons()
 {
     $s = '';
     if ($this->bShowSettings) {
         $aAdditionalMenu = array();
         $this->__AddListUrlParams('mode', 'settings');
         $strLink = $this->GetListUrl(true);
         $this->__DeleteListUrlParams('mode');
         $aAdditionalMenu[] = array("TEXT" => GetMessage("admin_lib_menu_settings"), "TITLE" => GetMessage("admin_lib_context_sett_title"), "ONCLICK" => $this->name . ".ShowSettings('" . htmlspecialcharsex(CUtil::JSEscape($strLink)) . "')", "ICON" => "btn_settings");
         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');
             }
         }
         $s .= '<span class="adm-detail-subsettings-cont">';
         if (count($aAdditionalMenu) > 1) {
             $sMenuUrl = "BX.adminShowMenu(this, " . htmlspecialcharsbx(CAdminPopupEx::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-subsettings adm-detail-subsettings-arrow' . ($bCustomFieldsOff ? '' : ' adm-detail-subsettings-active') . '" onclick="' . $sMenuUrl . '"></span>';
         } else {
             $s .= '<a class="adm-detail-subsettings" href="javascript:void(0)" onclick="' . $aAdditionalMenu[0]['ONCLICK'] . ';"></a>';
         }
         $s .= '</span>';
     }
     return $s . CAdminTabControl::ShowTabButtons();
 }