Код |
---|
<? if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); /************************************************************************* Processing of received parameters *************************************************************************/ if(!isset($arParams["CACHE_TIME"])) $arParams["CACHE_TIME"] = 3600; $arParams["IBLOCK_TYPE"] = trim($arParams["IBLOCK_TYPE"]); $arParams["IBLOCK_ID"] = intval($arParams["IBLOCK_ID"]); $arParams["SECTION_ID"] = intval($arParams["SECTION_ID"]); $arParams["SECTION_CODE"] = trim($arParams["SECTION_CODE"]); $arParams["SECTION_URL"]=trim($arParams["SECTION_URL"]); $arParams["TOP_DEPTH"] = intval($arParams["TOP_DEPTH"]); if($arParams["TOP_DEPTH"] <= 0) $arParams["TOP_DEPTH"] = 2; $arParams["COUNT_ELEMENTS"] = $arParams["COUNT_ELEMENTS"]!="N"; $arParams["DISPLAY_PANEL"] = $arParams["DISPLAY_PANEL"]=="Y"; $arParams["ADD_SECTIONS_CHAIN"] = $arParams["ADD_SECTIONS_CHAIN"]!="N"; //Turn on by default $arResult["SECTIONS"]=array(); /************************************************************************* Work with cache *************************************************************************/ if($this->StartResultCache(false, ($arParams["CACHE_GROUPS"]==="N"? false: $USER->GetGroups()))) { if(!CModule::IncludeModule("iblock")) { $this->AbortResultCache(); ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED")); return; } $arFilter = array( "ACTIVE" => "Y", "GLOBAL_ACTIVE" => "Y", "IBLOCK_ID" => $arParams["IBLOCK_ID"], ); $arResult["SECTION"] = false; if(strlen($arParams["SECTION_CODE"])>0) { $arFilter["CODE"] = $arParams["SECTION_CODE"]; $rsSections = CIBlockSection::GetList(array(), $arFilter, true); $rsSections->SetUrlTemplates("", $arParams["SECTION_URL"]); $arResult["SECTION"] = $rsSections->GetNext(); } elseif($arParams["SECTION_ID"]>0) { $arFilter["ID"] = $arParams["SECTION_ID"]; $rsSections = CIBlockSection::GetList(array(), $arFilter, true); $rsSections->SetUrlTemplates("", $arParams["SECTION_URL"]); $arResult["SECTION"] = $rsSections->GetNext(); } if(is_array($arResult["SECTION"])) { unset($arFilter["ID"]); unset($arFilter["CODE"]); $arFilter["LEFT_MARGIN"]=$arResult["SECTION"]["LEFT_MARGIN"]+1; $arFilter["RIGHT_MARGIN"]=$arResult["SECTION"]["RIGHT_MARGIN"]; $arFilter["<="."DEPTH_LEVEL"]=$arResult["SECTION"]["DEPTH_LEVEL"] + $arParams["TOP_DEPTH"]; $arResult["SECTION"]["PATH"] = array(); $rsPath = GetIBlockSectionPath($arResult["SECTION"]["IBLOCK_ID"], $arResult["SECTION"]["ID"]); $rsPath->SetUrlTemplates("", $arParams["SECTION_URL"]); while($arPath = $rsPath->GetNext()) { $arResult["SECTION"]["PATH"][]=$arPath; } } else { $arResult["SECTION"] = array("ID"=>0, "DEPTH_LEVEL"=>0); $arFilter["<="."DEPTH_LEVEL"] = $arParams["TOP_DEPTH"]; } $arFilter["CNT_ACTIVE"]="Y"; //ORDER BY $arSort = array( "left_margin"=>"asc", ); //EXECUTE $rsSections = CIBlockSection::GetList($arSort, $arFilter, $arParams["COUNT_ELEMENTS"]); $rsSections->SetUrlTemplates("", $arParams["SECTION_URL"]); while($arSection = $rsSections->GetNext()) { $arSection["PICTURE"] = CFile::GetFileArray($arSection["PICTURE"]); $arResult["SECTIONS"][]=$arSection; } $this->IncludeComponentTemplate(); } if(count($arResult["SECTIONS"])>0 || isset($arResult["SECTION"])) { if($USER->IsAuthorized()) { if($GLOBALS["APPLICATION"]->GetShowIncludeAreas() && CModule::IncludeModule("iblock")) $this->AddIncludeAreaIcons(CIBlock::ShowPanel($arParams["IBLOCK_ID"], 0, $arResult["SECTION"]["ID"], $arParams["IBLOCK_TYPE"], true)); if($arParams["DISPLAY_PANEL"] && CModule::IncludeModule("iblock")) CIBlock::ShowPanel($arParams["IBLOCK_ID"], 0, $arResult["SECTION"]["ID"], $arParams["IBLOCK_TYPE"], false, $this->GetName()); } if($arParams["ADD_SECTIONS_CHAIN"] && isset($arResult["SECTION"]) && is_array($arResult["SECTION"]["PATH"])) { |
Код |
---|
<? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); $APPLICATION->SetTitle("Каталог продукции"); ?><?$APPLICATION->IncludeComponent("bitrix:catalog", "productions", array( "IBLOCK_TYPE" => "productions", "IBLOCK_ID" => "8", "BASKET_URL" => "/personal/cart/", "ACTION_VARIABLE" => "action", "PRODUCT_ID_VARIABLE" => "id", "SECTION_ID_VARIABLE" => "SECTION_ID", "SEF_MODE" => "Y", "SEF_FOLDER" => "/catalog/", "AJAX_MODE" => "N", "AJAX_OPTION_SHADOW" => "Y", "AJAX_OPTION_JUMP" => "N", "AJAX_OPTION_STYLE" => "Y", "AJAX_OPTION_HISTORY" => "N", "CACHE_TYPE" => "A", "CACHE_TIME" => "3600", "CACHE_FILTER" => "N", "CACHE_GROUPS" => "Y", "DISPLAY_PANEL" => "N", "SET_TITLE" => "Y", "SET_STATUS_404" => "Y", "USE_FILTER" => "N", "USE_REVIEW" => "N", "USE_COMPARE" => "N", "PRICE_CODE" => array( 0 => "OLD", 1 => "BASE", ), "USE_PRICE_COUNT" => "N", "SHOW_PRICE_COUNT" => "1", "PRICE_VAT_INCLUDE" => "Y", "PRICE_VAT_SHOW_VALUE" => "N", "SHOW_TOP_ELEMENTS" => "N", "PAGE_ELEMENT_COUNT" => "30", "LINE_ELEMENT_COUNT" => "3", "ELEMENT_SORT_FIELD" => "property_art", "ELEMENT_SORT_ORDER" => "asc", "LIST_PROPERTY_CODE" => array( 0 => "SUBNAME", 1 => "ART", 2 => "", 3 => "INCLUDE", 4 => "MOREIMAGES", 5 => "ISORDER", 6 => "", ), "INCLUDE_SUBSECTIONS" => "N", "LIST_META_KEYWORDS" => "-", "LIST_META_DESCRIPTION" => "-", "LIST_BROWSER_TITLE" => "-", "DETAIL_PROPERTY_CODE" => array( 0 => "GOST", 1 => "SUBNAME", 2 => "INFO", 3 => "SECURETY", 4 => "PREVIEW_IMAGE", 5 => "DETAIL_IMAGE", 6 => "ART", 7 => "MATERIAL", 8 => "ISBESTPRICE", 9 => "ISNEW", 10 => "", 11 => "ISSALE", 12 => "SIZE", 13 => "INCLUDE_3", 14 => "INCLUDE_2", 15 => "INCLUDE_1", 16 => "COLOR", 17 => "INCLUDE", 18 => "MOREIMAGES", 19 => "ISORDER", 20 => "", ), "DETAIL_META_KEYWORDS" => "-", "DETAIL_META_DESCRIPTION" => "-", "DETAIL_BROWSER_TITLE" => "-", "LINK_IBLOCK_TYPE" => "", "LINK_IBLOCK_ID" => "", "LINK_PROPERTY_SID" => "", "LINK_ELEMENTS_URL" => "link.php?PARENT_ELEMENT_ID=#ELEMENT_ID#", "USE_ALSO_BUY" => "N", "DISPLAY_TOP_PAGER" => "N", "DISPLAY_BOTTOM_PAGER" => "Y", "PAGER_TITLE" => "", "PAGER_SHOW_ALWAYS" => "N", "PAGER_TEMPLATE" => "", "PAGER_DESC_NUMBERING" => "N", "PAGER_DESC_NUMBERING_CACHE_TIME" => "36000", "PAGER_SHOW_ALL" => "Y", "AJAX_OPTION_ADDITIONAL" => "", "SEF_URL_TEMPLATES" => array( "sections" => "", "section" => "#SECTION_ID#/", "element" => "#SECTION_ID#/#ELEMENT_ID#/", "compare" => "compare.php?action=#ACTION_CODE#", ), "VARIABLE_ALIASES" => array( "compare" => array( "ACTION_CODE" => "action", ), ) ), false );?> <?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?> |