76 lines
2.0 KiB
PHP
76 lines
2.0 KiB
PHP
<?
|
|
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
|
|
/** @var CBitrixComponent $this */
|
|
/** @var array $arParams */
|
|
/** @var array $arResult */
|
|
/** @var string $componentPath */
|
|
/** @var string $componentName */
|
|
/** @var string $componentTemplate */
|
|
/** @global CDatabase $DB */
|
|
/** @global CUser $USER */
|
|
/** @global CMain $APPLICATION */
|
|
|
|
use Bitrix\Main\Context,
|
|
Bitrix\Main\Type\DateTime,
|
|
Bitrix\Main\Loader,
|
|
Bitrix\Iblock;
|
|
|
|
if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
|
{
|
|
if(CModule::IncludeModule('iblock'))
|
|
{
|
|
$arResult = array();
|
|
$sort = Array("NAME" => "ASC");
|
|
// if($arParams['CODE'] ===)
|
|
$filter = Array("ACTIVE" => "Y", "IBLOCK_ID" => 3, "CODE" => $arParams['CODE']);
|
|
$options = Array("nPageSize" => 1000);
|
|
|
|
if(isset($arParams["sort"]))
|
|
{
|
|
$sort = $arParams["sort"];
|
|
}
|
|
|
|
if(isset($arParams["options"]))
|
|
{
|
|
$options = $arParams["options"];
|
|
}
|
|
|
|
if(isset($arParams["filter"]))
|
|
{
|
|
$filter = array_merge($filter, $arParams["filter"]);
|
|
}
|
|
|
|
$res = CIBlockElement::GetList($sort, $filter, false, $options);
|
|
$arResult = Array();
|
|
|
|
while ($obElement = $res->GetNextElement())
|
|
{
|
|
$ar_res = $obElement->GetFields();
|
|
$ar_res['PROPERTIES'] = $obElement->GetProperties();
|
|
|
|
if(isset($ar_res['DETAIL_PICTURE']))
|
|
{
|
|
$ar_res['DETAIL_PICTURE'] = CFile::GetPath($ar_res['DETAIL_PICTURE']);
|
|
}
|
|
|
|
$arResult = $ar_res;
|
|
}
|
|
|
|
if(empty($ar_res['NAME'])) { define('ERROR_404', 'Y'); }
|
|
else
|
|
{
|
|
$ipropValues = new \Bitrix\Iblock\InheritedProperty\ElementValues($ar_res['IBLOCK_ID'], $ar_res["ID"]);
|
|
$meta = $ipropValues->getValues();
|
|
|
|
$APPLICATION->AddChainItem($meta['ELEMENT_PAGE_TITLE'], "/programs/lizing-taksi/");
|
|
|
|
$APPLICATION->SetPageProperty("title", $arParams['TITLE']);
|
|
$APPLICATION->SetPageProperty("description", $arParams['DESCRIPTION']);
|
|
$APPLICATION->SetPageProperty("keywords", $arParams['KEYWORDS']);
|
|
|
|
$arResult['NAME'] = $meta['ELEMENT_META_TITLE'];
|
|
}
|
|
|
|
$this->IncludeComponentTemplate();
|
|
}
|
|
} |