From 97b7e660cf02311c62c04c05a76667b7119e3bd2 Mon Sep 17 00:00:00 2001 From: merelendor Date: Fri, 31 May 2024 05:27:11 +0300 Subject: [PATCH] aggregations program separate special offers banners component --- .../templates/.default/template.php | 47 ++++++++++++++ .../special.offers.banners/.description.php | 8 +++ .../special.offers.banners/component.php | 62 +++++++++++++++++++ .../lang/ru/.description.php | 4 ++ .../templates/.default/style.css | 0 .../templates/.default/template.php | 59 ++++++++++++++++++ 6 files changed, 180 insertions(+) create mode 100644 local/components/evolution/special.offers.banners/.description.php create mode 100644 local/components/evolution/special.offers.banners/component.php create mode 100644 local/components/evolution/special.offers.banners/lang/ru/.description.php create mode 100644 local/components/evolution/special.offers.banners/templates/.default/style.css create mode 100644 local/components/evolution/special.offers.banners/templates/.default/template.php diff --git a/local/components/evolution/programs.aggregations/templates/.default/template.php b/local/components/evolution/programs.aggregations/templates/.default/template.php index 3066244..2200f45 100644 --- a/local/components/evolution/programs.aggregations/templates/.default/template.php +++ b/local/components/evolution/programs.aggregations/templates/.default/template.php @@ -87,6 +87,50 @@ $this->setFrameMode(true); + + + 0): ?> +
+
+

+ IncludeComponent( + "evolution:special.offers.banners", + "", + Array( + "BANNERS" => $arResult['PROPERTIES']['OFFERS']['VALUE'], + "PAGINATION" => "N", + ) + ); + ?> +
+
+ + + setFrameMode(true); ] ); ?> + +*/ +?> diff --git a/local/components/evolution/special.offers.banners/.description.php b/local/components/evolution/special.offers.banners/.description.php new file mode 100644 index 0000000..a20bdf3 --- /dev/null +++ b/local/components/evolution/special.offers.banners/.description.php @@ -0,0 +1,8 @@ + GetMessage("DEFAULT_NAME"), + "DESCRIPTION" => GetMessage("DEFAULT_DESC"), +); +?> \ No newline at end of file diff --git a/local/components/evolution/special.offers.banners/component.php b/local/components/evolution/special.offers.banners/component.php new file mode 100644 index 0000000..14234c2 --- /dev/null +++ b/local/components/evolution/special.offers.banners/component.php @@ -0,0 +1,62 @@ +StartResultCache(60*60*24, md5(var_export($_POST, true)))) +{ + if(CModule::IncludeModule('iblock')) + { + $arResult = array(); + $sort = Array("ID" => $arParams['BANNERS']); + $filter = Array("IBLOCK_ID" => IBLOCK_ID_SPECIALS, "ID" => $arParams['BANNERS']); + if(!isset($_GET['advertise'])) { $filter["ACTIVE"] = "Y"; } + $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(); + $arResult['BANNERS'] = Array(); + + while ($obElement = $res->GetNextElement()) + { + $ar_res = $obElement->GetFields(); + $ar_res['PROPERTIES'] = $obElement->GetProperties(); + + if(isset($ar_res['PREVIEW_PICTURE'])) + { + $ar_res['PREVIEW_PICTURE'] = CFile::GetPath($ar_res['PREVIEW_PICTURE']); + } + + $arResult['BANNERS'][] = $ar_res; + } + + $this->IncludeComponentTemplate(); + } +} \ No newline at end of file diff --git a/local/components/evolution/special.offers.banners/lang/ru/.description.php b/local/components/evolution/special.offers.banners/lang/ru/.description.php new file mode 100644 index 0000000..1f56ae4 --- /dev/null +++ b/local/components/evolution/special.offers.banners/lang/ru/.description.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/local/components/evolution/special.offers.banners/templates/.default/style.css b/local/components/evolution/special.offers.banners/templates/.default/style.css new file mode 100644 index 0000000..e69de29 diff --git a/local/components/evolution/special.offers.banners/templates/.default/template.php b/local/components/evolution/special.offers.banners/templates/.default/template.php new file mode 100644 index 0000000..e4ed044 --- /dev/null +++ b/local/components/evolution/special.offers.banners/templates/.default/template.php @@ -0,0 +1,59 @@ +setFrameMode(true); +?> +
> +
"> + +
+ + + + Подробнее + + <?= $banner['NAME']; ?> + +
Реклама +
ООО "ЛК Эволюция"
+
ИНН 9724016636
+
+ erid: +
+
+ +
+ +
+ + 2): ?> +
+ + +
+ + + +
+ +
\ No newline at end of file