<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/** @var array $arParams */
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var CBitrixComponent $component */
$this->setFrameMode(true);
$arViewModeList = $arResult['VIEW_MODE_LIST'];
$arViewStyles = array(
'LIST' => array(
'CONT' => 'bx_sitemap',
'TITLE' => 'bx_sitemap_title',
'LIST' => 'car-list-block',
),
'LINE' => array(
'CONT' => 'bx_catalog_line',
'TITLE' => 'bx_catalog_line_category_title',
'LIST' => 'bx_catalog_line_ul',
'EMPTY_IMG' => $this->GetFolder().'/images/line-empty.png'
),
'TEXT' => array(
'CONT' => 'bx_catalog_text',
'TITLE' => 'bx_catalog_text_category_title',
'LIST' => 'bx_catalog_text_ul'
),
'TILE' => array(
'CONT' => 'bx_catalog_tile',
'TITLE' => 'bx_catalog_tile_category_title',
'LIST' => 'bx_catalog_tile_ul',
'EMPTY_IMG' => $this->GetFolder().'/images/tile-empty.png'
)
,
'WITHPIC' => array(
'CONT' => 'bx_catalog_tile',
'TITLE' => 'bx_catalog_tile_category_title',
'LIST' => 'ul_pokolenie',
'EMPTY_IMG' => $this->GetFolder().'/images/tile-empty.png'
)
);
$arParams['VIEW_MODE'] = viewType($arResult["SECTION"]["PATH"]);
$arCurView = $arViewStyles[$arParams['VIEW_MODE']];
$strSectionEdit = CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "SECTION_EDIT");
$strSectionDelete = CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "SECTION_DELETE");
$arSectionDeleteParams = array("CONFIRM" => GetMessage('CT_BCSL_ELEMENT_DELETE_CONFIRM'));
?>
<div class="<? echo $arCurView['CONT']; ?>">
<?
if(!isset($arParams["SHOW_BAR"]) || $arParams["SHOW_BAR"]=="Y")
showPodborBar($arResult["SECTION"]["PATH"], $arResult["SECTION"]["ID"]);
// _pre($arParams['VIEW_MODE']);
?>
<?
if ('Y' == $arParams['SHOW_PARENT_NAME'] && 0 < $arResult['SECTION']['ID'])
{
/*?><h1
class="<? echo $arCurView['TITLE']; ?>"
id="<? echo $this->GetEditAreaId($arResult['SECTION']['ID']); ?>"
><a href="<? echo $arResult['SECTION']['SECTION_PAGE_URL']; ?>"><?
echo (
isset($arResult['SECTION']["IPROPERTY_VALUES"]["SECTION_PAGE_TITLE"]) && $arResult['SECTION']["IPROPERTY_VALUES"]["SECTION_PAGE_TITLE"] != ""
? $arResult['SECTION']["IPROPERTY_VALUES"]["SECTION_PAGE_TITLE"]
: $arResult['SECTION']['NAME']
);
?></a></h1><?*/
}
if (0 < $arResult["SECTIONS_COUNT"])
{
?>
<ul class="<? echo $arCurView['LIST']; ?> <?=($arResult["COUNT_KOTORIE_ISKLUCHILI"]>0)?"showsudavstavlyaem":"";?>">
<?
switch ($arParams['VIEW_MODE'])
{
case 'LINE':
foreach ($arResult['SECTIONS'] as &$arSection)
{
if (false === $arSection['PICTURE']){
$pic = array(
'src' => $arCurView['EMPTY_IMG'],
'alt' => (
'' != $arSection["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_ALT"]
? $arSection["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_ALT"]
: $arSection["NAME"]
),
'title' => (
'' != $arSection["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_TITLE"]
? $arSection["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_TITLE"]
: $arSection["NAME"]
)
);
} else {
$pic = CFile::ResizeImageGet($arSection['PICTURE'], array('width'=>78, 'height'=>78), BX_RESIZE_IMAGE_PROPORTIONAL, false);
}
?><li>
<a
href="<? echo $arSection['SECTION_PAGE_URL']; ?>"
class="bx_catalog_line_img"
style="background-image: url('<? echo $pic['src']; ?>');"
title="<? echo $pic['title']; ?>"
></a>
<h2 class="bx_catalog_line_title"><a href="<? echo $arSection['SECTION_PAGE_URL']; ?>"><? echo $arSection['NAME']; ?></a><?
if ($arParams["COUNT_ELEMENTS"])
{
?> <span>(<? echo $arSection['ELEMENT_CNT']; ?>)</span><?
}
?></h2><?
if ('' != $arSection['DESCRIPTION'])
{
?><p class="bx_catalog_line_description"><? echo $arSection['DESCRIPTION']; ?></p><?
}
?><div style="clear: both;"></div>
</li><?
}
unset($arSection);
break;
case 'TEXT':
foreach ($arResult['SECTIONS'] as &$arSection)
{
?><li><h2 class="bx_catalog_text_title"><a href="<? echo $arSection['SECTION_PAGE_URL']; ?>"><? echo $arSection['NAME']; ?></a><?
if ($arParams["COUNT_ELEMENTS"])
{
?> <span>(<? echo $arSection['ELEMENT_CNT']; ?>)</span><?
}
?></h2></li><?
}
unset($arSection);
break;
case 'WITHPIC':
foreach ($arResult['SECTIONS'] as &$arSection)
{
$arWaterMark = Array(
array(
"name" => "watermark",
"position" => "center", // Положение
"type" => "image",
"alpha_level"=>60,
"file" => $_SERVER["DOCUMENT_ROOT"].'/upload/water.png', // Путь к картинке
"fill" => "resize",
"coefficient" => "0,4"
)
);
$pic = [];
if($arSection["PICTURE"]){
$pic = CFile::ResizeImageGet($arSection['PICTURE'], array('width'=>320, 'height'=>230), BX_RESIZE_IMAGE_EXACT, true, $arWaterMark);
} else {
$pic["src"] = "/images/no_image.jpg";
}?>
<li><a href="<?=$arSection["SECTION_PAGE_URL"]?>" class="pokolenie_pic">
<div class="picblock"><img src="<?=$pic["src"]?>"></div>
<span><?=$arSection["NAME"]?></span>
</a></li>
<?
}
unset($arSection);
break;
case 'TILE':
foreach ($arResult['SECTIONS'] as &$arSection)
{
if (false === $arSection['PICTURE']){
$pic = array(
'src' => $arCurView['EMPTY_IMG'],
'alt' => (
'' != $arSection["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_ALT"]
? $arSection["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_ALT"]
: $arSection["NAME"]
),
'title' => (
'' != $arSection["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_TITLE"]
? $arSection["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_TITLE"]
: $arSection["NAME"]
)
);
} else {
$pic = CFile::ResizeImageGet($arSection['PICTURE'], array('width'=>78, 'height'=>78), BX_RESIZE_IMAGE_PROPORTIONAL, true);
}
?><li>
<a href="<? echo $arSection['SECTION_PAGE_URL']; ?>" class="bx_catalog_tile_img" style="background-image:url('<? echo $pic['src']; ?>');" title="<? echo $pic['title']; ?>"></a>
<span><?=$arSection["NAME"]?></span>
<?
?></li><?
}
unset($arSection);
break;
case 'LIST':
$intCurrentDepth = 1;
$boolFirst = true;
foreach ($arResult['SECTIONS'] as &$arSection)
{
?>
<li><a href="<? echo $arSection["SECTION_PAGE_URL"]; ?>"><? echo $arSection["NAME"];?></a></li>
<?
}
unset($arSection);
while ($intCurrentDepth > 1)
{
echo '</li>',"\n",str_repeat("\t", $intCurrentDepth),'</ul>',"\n",str_repeat("\t", $intCurrentDepth-1);
$intCurrentDepth--;
}
if ($intCurrentDepth > 0)
{
echo '</li>',"\n";
}
break;
}
?>
</ul>
<? if($arResult["COUNT_KOTORIE_ISKLUCHILI"]>0){
?>
<script>
$(document).ready(function(){
$("a.show_no_popular").click(function(e){
e.preventDefault();
$(this).parent().prev().append('<div class="lds-spinner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>');
$.post( "<?=$APPLICATION->GetCurPageParam("AJAX_CALL=Y", array("clear_cache"));?>", function( data ) {
var tmp = $(document.createElement('div'));
tmp.append(data);
var markaz = tmp.find(".showsudavstavlyaem li");
$( ".showsudavstavlyaem" ).append(markaz);
$("a.show_no_popular").hide();
$("a.show_no_popular").parent().prev().hide();
});
});
});
</script>
<div style="clear:both;text-align:center;"></div>
<p style="text-align:center;"><a href="" class="show_no_popular btn" rel="nofollow"><?=_i("Показать еще")?> (<?=$arResult["COUNT_KOTORIE_ISKLUCHILI"]?>)</a></p>
<?
}?>
<?
echo ('LINE' != $arParams['VIEW_MODE'] ? '<div style="clear: both;"></div>' : '');
}
?></div>