From a627003518c397b0dd0239c43ff52ad2f203a812 Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 28 May 2024 22:36:50 +0300 Subject: [PATCH] additional check for template countable arrays for PHP 8.0+ --- .../templates/.default/template.php | 2 +- .../templates/.default/template.php | 2 +- .../templates/.default/template.php | 2 +- .../catalog.program/.description.php | 8 + .../evolution/catalog.program/.parameters.php | 14 + .../evolution/catalog.program/component.php | 538 ++++++++++++++++++ .../catalog.program/lang/ru/.description.php | 4 + .../catalog.program/lang/ru/.parameters.php | 2 + .../templates/.default/script.js | 26 + .../templates/.default/style.css | 0 .../templates/.default/template.php | 313 ++++++++++ .../templates/ajax/template.php | 22 + .../templates/.default/template.php | 4 +- .../templates/.default/template.php | 4 +- .../templates/.default/template.php | 2 +- .../templates/.default/template.php | 2 +- .../templates/.default/template.php | 2 +- .../leasing.programs.taxi/.description.php | 8 + .../leasing.programs.taxi/component.php | 73 +++ .../lang/ru/.description.php | 4 + .../templates/.default/style.css | 0 .../templates/.default/template.php | 81 +++ .../templates/.default/template.php | 4 +- .../templates/.default/template.php | 2 +- .../templates/.default/template.php | 2 +- .../templates/.default/template.php | 4 +- 26 files changed, 1109 insertions(+), 16 deletions(-) create mode 100644 local/components/evolution/catalog.program/.description.php create mode 100644 local/components/evolution/catalog.program/.parameters.php create mode 100644 local/components/evolution/catalog.program/component.php create mode 100644 local/components/evolution/catalog.program/lang/ru/.description.php create mode 100644 local/components/evolution/catalog.program/lang/ru/.parameters.php create mode 100644 local/components/evolution/catalog.program/templates/.default/script.js create mode 100644 local/components/evolution/catalog.program/templates/.default/style.css create mode 100644 local/components/evolution/catalog.program/templates/.default/template.php create mode 100644 local/components/evolution/catalog.program/templates/ajax/template.php create mode 100644 local/components/evolution/leasing.programs.taxi/.description.php create mode 100644 local/components/evolution/leasing.programs.taxi/component.php create mode 100644 local/components/evolution/leasing.programs.taxi/lang/ru/.description.php create mode 100644 local/components/evolution/leasing.programs.taxi/templates/.default/style.css create mode 100644 local/components/evolution/leasing.programs.taxi/templates/.default/template.php diff --git a/local/components/evolution/about.career.vacancy/templates/.default/template.php b/local/components/evolution/about.career.vacancy/templates/.default/template.php index 68296e2..ff6b371 100644 --- a/local/components/evolution/about.career.vacancy/templates/.default/template.php +++ b/local/components/evolution/about.career.vacancy/templates/.default/template.php @@ -16,7 +16,7 @@ $this->setFrameMode(true);

- 0): ?> + 0): ?>

Регион: diff --git a/local/components/evolution/about.leaders/templates/.default/template.php b/local/components/evolution/about.leaders/templates/.default/template.php index 1144323..04ecdd2 100644 --- a/local/components/evolution/about.leaders/templates/.default/template.php +++ b/local/components/evolution/about.leaders/templates/.default/template.php @@ -12,7 +12,7 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> - 0): ?> + 0): ?>

Руководство

diff --git a/local/components/evolution/catalog.other.positions/templates/.default/template.php b/local/components/evolution/catalog.other.positions/templates/.default/template.php index 2bace59..de3f8b8 100644 --- a/local/components/evolution/catalog.other.positions/templates/.default/template.php +++ b/local/components/evolution/catalog.other.positions/templates/.default/template.php @@ -12,7 +12,7 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> - 0): ?> + 0): ?>

Другие предложения

diff --git a/local/components/evolution/catalog.program/.description.php b/local/components/evolution/catalog.program/.description.php new file mode 100644 index 0000000..a20bdf3 --- /dev/null +++ b/local/components/evolution/catalog.program/.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/catalog.program/.parameters.php b/local/components/evolution/catalog.program/.parameters.php new file mode 100644 index 0000000..0597273 --- /dev/null +++ b/local/components/evolution/catalog.program/.parameters.php @@ -0,0 +1,14 @@ + array( + 'MAP_WIDTH' => array( + 'NAME' => GetMessage('COUNT_PER_PAGE'), + 'TYPE' => 'STRING', + 'DEFAULT' => '3', + 'PARENT' => 'BASE', + ), + ), +); +?> \ No newline at end of file diff --git a/local/components/evolution/catalog.program/component.php b/local/components/evolution/catalog.program/component.php new file mode 100644 index 0000000..81d89dd --- /dev/null +++ b/local/components/evolution/catalog.program/component.php @@ -0,0 +1,538 @@ +StartResultCache(60*60*24, md5(var_export($_POST, true)))) +{ + if(CModule::IncludeModule('iblock')) + { + $breadcrumbs = []; + $canonical = []; + + $arResult = [ + 'SELECTED' => [], + 'TITLES' => [], + 'ITEMS' => [] + ]; + + $query = null; + $query_arr = []; + + $sort = Array("SORT" => "ASC", "NAME" => "ASC"); + if(isset($arParams['SORT'])) + { + if($arParams['SORT'] === "name") + { + $sort = Array("SORT" => "ASC", "NAME" => "ASC"); + $arResult['SCROLL'] = true; + } + if($arParams['SORT'] === "low") + { + $sort = Array("SORT" => "ASC", "PROPERTY_PRICE" => "ASC"); + $query_arr['SORT'] = $arParams['SORT']; + $arResult['SCROLL'] = true; + } + if($arParams['SORT'] === "high") + { + $sort = Array("SORT" => "ASC", "PROPERTY_PRICE" => "DESC"); + $query_arr['SORT'] = $arParams['SORT']; + $arResult['SCROLL'] = true; + } + + $arResult['SELECTED']['SORT'] = $arParams['SORT']; + } + $filter = Array("ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW); + $options = Array("nPageSize" => !empty($arParams['COUNT_PER_PAGE']) ? $arParams['COUNT_PER_PAGE'] : 15); + + $pages_url = $arParams['PATH']; + + $arResult['BRAND_DISABLED'] = false; + $arResult['MODEL_DISABLED'] = false; + $arResult['EXTENDED'] = true; + $arResult['BY_OPTIONS'] = false; + $arResult['FILTER_SMALL'] = $arParams['FILTER_SMALL'] ? true : false; + + $arResult['SHOW_BRANDS_LIST'] = true; + $arResult['SHOW_MODELS_LIST'] = false; + + if(empty($arParams['PROGRAM'])) + { + $arResult['SHOW_SPECIAL_OFFERS'] = true; + } + $arResult['SHOW_PROMO_BRANDS'] = true; + + if(!empty($arParams['BRAND'])) + { + $brands_res = CIBlockElement::GetList(["NAME" => "ASC"], ["IBLOCK_ID" => IBLOCK_ID_BRANDS, "CODE" => $arParams['BRAND']], false, []); + while ($brands_ob_element = $brands_res->GetNextElement()) + { + $brands_ar_res = $brands_ob_element->GetFields(); + $brands_ar_res['PROPERTIES'] = $brands_ob_element->GetProperties(); + + $filter['PROPERTY_BRAND'] = $brands_ar_res['ID']; + $pages_url = $pages_url.$brands_ar_res['CODE']."/"; + $arResult['SELECTED']['BRAND'] = $brands_ar_res['CODE']; + $arResult['SELECTED']['BRAND_ID'] = $brands_ar_res['ID']; + $arResult['SELECTED']['BRAND_UID'] = $brands_ar_res['PROPERTIES']['UID']['VALUE']; + $arResult['TITLES']['BRAND'] = $brands_ar_res['NAME']; + $arResult['TITLES']['TRANSCRIPTION'] = $brands_ar_res['PROPERTIES']['TRANSCRIPTION']['VALUE']; + + if($brands_ar_res['ACTIVE'] === "Y") + { + $arResult['BRAND_DISABLED'] = false; + $arResult['SHOW_BRANDS_LIST'] = false; + $arResult['SHOW_MODELS_LIST'] = true; + $arResult['MODEL_DISABLED'] = false; + } + else + { + $arResult['BRAND_DISABLED'] = true; + $arResult['MODEL_DISABLED'] = true; + $arResult['SHOW_MODELS_LIST'] = false; + } + + $arResult['SHOW_PROMO_BRANDS'] = false; + + array_push($breadcrumbs, [ + "NAME" => $brands_ar_res['NAME'], + "URL" => "https://".SITE_SERVER_NAME.$arParams['PATH'].$arResult['SELECTED']['BRAND']."/", + ]); + + array_push($canonical, $arParams['BRAND']); + } + + $arResult['EXTENDED'] = true; + $arResult['FILTER_SMALL'] = false; + $arResult['SCROLL'] = true; + + if(empty($arResult['SELECTED']['BRAND'])) + { + define('ERROR_404', 'Y'); + } + } + + if(!empty($arParams['MODEL'])) + { + $models_res = CIBlockElement::GetList(["NAME" => "ASC"], ["IBLOCK_ID" => IBLOCK_ID_MODELS, "CODE" => $arParams['MODEL'], "PROPERTY_BRAND_UID" => $arResult['SELECTED']['BRAND_UID']], false, []); + while ($models_ob_element = $models_res->GetNextElement()) + { + $models_ar_res = $models_ob_element->GetFields(); + $models_ar_res['PROPERTIES'] = $models_ob_element->GetProperties(); + + $filter['PROPERTY_MODEL'] = $models_ar_res['ID']; + $pages_url = $pages_url.$models_ar_res['CODE']."/"; + $arResult['SELECTED']['MODEL'] = $models_ar_res['CODE']; + $arResult['TITLES']['MODEL'] = $models_ar_res['NAME']; + + if($models_ar_res['ACTIVE'] === "Y") + { + $arResult['MODEL_DISABLED'] = false; + $arResult['SHOW_MODELS_LIST'] = false; + } + else + { + $arResult['MODEL_DISABLED'] = true; + $arResult['SHOW_PROMO_BRANDS'] = false; + } + + array_push($breadcrumbs, [ + "NAME" => $models_ar_res['NAME'], + "URL" => "https://".SITE_SERVER_NAME.$arParams['PATH'].$arResult['SELECTED']['BRAND']."/".$arResult['SELECTED']['MODEL']."/", + ]); + + array_push($canonical, $arParams['MODEL']); + + if(!is_null($arParams['REGION']) && $arParams['REGION'] !== "root") + { + if($models_ar_res['PROPERTIES']['REGIONS']['VALUE'] !== "Да") + { + $APPLICATION->SetPageProperty("robots", "noindex, nofollow"); + } + } + } + + $arResult['EXTENDED'] = true; + $arResult['SCROLL'] = true; + + if(empty($arResult['SELECTED']['MODEL'])) + { + define('ERROR_404', 'Y'); + } + } + + if(isset($arParams['MODIFICATION'])) + { + if(!empty($arParams['MODIFICATION'])) + { + $arResult['EXTENDED'] = true; + $arResult['SELECTED']['MODIFICATION'] = $arParams['MODIFICATION']; + $arResult['SCROLL'] = true; + + $filter['PROPERTY_MODIFICATION'] = $arParams['MODIFICATION']; + $query_arr['MODIFICATION'] = $arParams['MODIFICATION']; + } + else + { + LocalRedirect("https://".SITE_SERVER_NAME.$arParams['PATH'].$arResult['SELECTED']['BRAND']."/".$arResult['SELECTED']['MODEL']."/", true, "301 Moved permanently"); + } + } + + $parameters_filter_count = 0; + + if(!empty($arParams['DRIVE'])) + { + $parameters_filter_count++; + + $arResult['EXTENDED'] = true; + $arResult['BY_OPTIONS'] = true; + $arResult['SCROLL'] = true; + + $arResult['SELECTED']['DRIVE'] = $arParams['DRIVE']; + $filter['=PROPERTY_DRIVE'] = $arParams['DRIVE']; + + $query_arr['DRIVE'] = $arParams['DRIVE']; + } + + if(!empty($arParams['GEAR'])) + { + $parameters_filter_count++; + + $arResult['EXTENDED'] = true; + $arResult['BY_OPTIONS'] = true; + $arResult['SCROLL'] = true; + + $arResult['SELECTED']['GEAR'] = $arParams['GEAR']; + $filter['=PROPERTY_GEAR'] = $arParams['GEAR']; + + $query_arr['GEAR'] = $arParams['GEAR']; + } + + if(!empty($arParams['ENGINE_FUEL'])) + { + $parameters_filter_count++; + + $arResult['EXTENDED'] = true; + $arResult['BY_OPTIONS'] = true; + $arResult['SCROLL'] = true; + + $arResult['SELECTED']['ENGINE_FUEL'] = $arParams['ENGINE_FUEL']; + $filter['=PROPERTY_ENGINE_FUEL'] = $arParams['ENGINE_FUEL']; + + $query_arr['ENGINE_FUEL'] = $arParams['ENGINE_FUEL']; + } + + if(!empty($arParams['ENGINE_POWER_FROM']) || !empty($arParams['ENGINE_POWER_TO'])) + { + $parameters_filter_count++; + + $arResult['EXTENDED'] = true; + $arResult['BY_OPTIONS'] = true; + $arResult['SCROLL'] = true; + + $filter['> 0) + { + $query = http_build_query($query_arr); + } + + if($arParams['leasing_program'] && $arParams['leasing_program'] !== "") + { + $filter['PROPERTY_LEASING_PROGRAMS'] = $arParams["leasing_program"]; + } + + if(!empty($arParams['BRAND'])) + { + if($arResult['BRAND_DISABLED']) + { + $arResult['SHOW_PROMO_BRANDS'] = false; + } + } + + if(!empty($arParams['BRAND']) && empty($arParams['MODEL'])) + { + $arResult['SHOW_PROMO_MODELS'] = true; + + if($arResult['BRAND_DISABLED']) + { + $arResult['SHOW_PROMO_BRANDS'] = false; + $arResult['SHOW_PROMO_MODELS'] = false; + } + + if($arResult['MODEL_DISABLED']) + { + $arResult['SHOW_PROMO_BRANDS'] = false; + $arResult['SHOW_PROMO_MODELS'] = false; + } + } + + if(!empty($arParams['BRAND']) && !empty($arParams['MODEL'])) + { + if($arResult['MODEL_DISABLED']) + { + $arResult['SHOW_PROMO_BRANDS'] = false; + $arResult['SHOW_PROMO_MODELS'] = false; + } + } + + if(!empty($arParams['PROGRAM'])) + { + $arResult['BRAND_DISABLED'] = false; + $arResult['MODEL_DISABLED'] = false; + } + + if(!empty($arParams['MODEL']) || $arResult['BY_OPTIONS']) + { + if(!$arResult['BRAND_DISABLED'] && !$arResult['MODEL_DISABLED']) + { + $arResult['SHOW_SPECIAL_OFFERS'] = false; + $arResult['SHOW_PROMO_BRANDS'] = false; + $arResult['SHOW_PROMO_MODELS'] = false; + + $res = CIBlockElement::GetList($sort, $filter, false, $options); + + while ($obElement = $res->GetNextElement()) + { + $ar_res = $obElement->GetFields(); + $ar_res['PROPERTIES'] = $obElement->GetProperties(); + $ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(IBLOCK_ID_BRANDS, $ar_res['PROPERTIES']['BRAND']['VALUE']); + $ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(IBLOCK_ID_MODELS, $ar_res['PROPERTIES']['MODEL']['VALUE']); + $ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(IBLOCK_ID_MODIFICATIONS, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']); + + $ar_res['CALCULATION'] = []; + $ar_res['CALCULATION']['MONTHLY'] = number_format(($ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT), 0, ".", " "); + $ar_res['CALCULATION']['SAVINGS_TAX'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 4), 0, ".", " "); + $ar_res['CALCULATION']['SAVINGS_VAT'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 4), 0, ".", " "); + + $arResult['ITEMS'][] = $ar_res; + } + } + } + + if($_REQUEST['PAGEN_1'] > 1) + { + $arResult['SCROLL'] = true; + } + + if(!empty($arResult['TITLES']['BRAND'])) + { + if(!empty($arResult['TITLES']['MODEL'])) + { + $APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в лизинг для юридических лиц и ИП в Москве - купить новый автомобиль ".$arResult['TITLES']['TRANSCRIPTION']." ".$arResult['TITLES']['MODEL']." в лизинг | Эволюция"); + $APPLICATION->SetPageProperty("description", "Новые автомобили ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный."); + } + else + { + $APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." в лизинг для юридических лиц и ИП в Москве - купить новый автомобиль ".$arResult['TITLES']['TRANSCRIPTION']." в лизинг | Эволюция"); + $APPLICATION->SetPageProperty("description", "Новые автомобили ".$arResult['TITLES']['BRAND']." в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить ".$arResult['TITLES']['BRAND']." в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный."); + } + } + + $arResult['SECTION_CODE'] = !empty($arParams['section_code']) ? $arParams['section_code'] : $pages_url; + $arResult['QUERY'] = $query; + + if(count($arResult['ITEMS']) > 0 && $arParams["PAGINATION"] == "Y") + { + $arResult["NAV_STRING"] = $res->GetPageNavStringEx( + $navComponentObject, + "", + "catalog", + "N", + null, + [ + "section_code" => $arResult['SECTION_CODE'], + "query" => $arResult['QUERY'], + ] + ); + } + + $arResult['PAGE_CURRENT'] = $res->NavPageNomer; + $arResult['PAGE_COUNT'] = $res->NavPageCount; + + if(!is_null($arParams['REGION'])) + { + if($arParams['REGION'] === "root") + { + $arResult['TITLE'] = "Лизинг в регионах России"; + $arResult['SUBTITLE'] = " для юридических лиц и ИП"; + + $APPLICATION->SetPageProperty("title", "Лизинг в регионах России для юридических лиц и ИП | Эволюция"); + $APPLICATION->SetPageProperty("description", "Лизинговая компания Эволюция предлагает быстрое оформление авто в лизинг в регионах России для юридических лиц и ИП. Выгодные цены, спецпредложения, простое оформление, консультирование и сопровождение."); + $APPLICATION->SetPageProperty("keywords", "Лизинг в России, лизинг в регионах России"); + + $APPLICATION->AddHeadString(''); + } + else + { + //IBLOCK_ID_CITIES + $res_city = CIBlockElement::GetList([], [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_CITIES, "CODE" => $arParams['REGION'] ], false, []); + + while ($city_element = $res_city->GetNextElement()) + { + $ar_city = $city_element->GetFields(); + $ar_city['PROPERTIES'] = $city_element->GetProperties(); + + $ar_city['PROPERTIES']['OFFICES']['RELATED'] = get_related_array(IBLOCK_ID_CONTACTS, $ar_city['PROPERTIES']['OFFICES']['VALUE']); + + if(isset($ar_city['PROPERTIES']['OFFICES']['RELATED'][0])) + { + $ar_city['LEADER_CRM_ID'] = $ar_city['PROPERTIES']['LEADER_CRM_ID']['VALUE']; + } + + $arResult['CITY'] = $ar_city; + + array_unshift($breadcrumbs, [ + "NAME" => $ar_city['NAME'], + "URL" => "https://".SITE_SERVER_NAME."/regions/".$ar_city['CODE']."/", + ]); + + array_unshift($canonical, $ar_city['CODE']); + + if(!empty($arResult['SELECTED']['MODEL'])) + { + $APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг для юридических лиц и ИП | Эволюция"); + $APPLICATION->SetPageProperty("description", "Новые автомобили ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг для юридических лиц и ИП. Вы можете купить ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный."); + $APPLICATION->SetPageProperty("keywords", $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." ".$ar_city['NAME']." в лизинг, купить ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." ".$ar_city['NAME']." в лизинг"); + } + elseif(!empty($arResult['SELECTED']['BRAND'])) + { + $APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг для юридических лиц и ИП | Эволюция"); + $APPLICATION->SetPageProperty("description", "Новые автомобили ".$arResult['TITLES']['BRAND']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг для юридических лиц и ИП. Вы можете купить ".$arResult['TITLES']['BRAND']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный."); + $APPLICATION->SetPageProperty("keywords", $arResult['TITLES']['BRAND']." ".$ar_city['NAME']." в лизинг, купить ".$arResult['TITLES']['BRAND']." ".$ar_city['NAME']." в лизинг"); + } + else + { + $APPLICATION->SetPageProperty("title", "Лизинг в ".$ar_city['PROPERTIES']['CASE']['VALUE']." для юридических лиц и ИП | Эволюция"); + $APPLICATION->SetPageProperty("description", "Лизинговая компания Эволюция предлагает быстрое оформление авто в лизинг в ".$ar_city['PROPERTIES']['CASE']['VALUE']." для юридических лиц и ИП. Выгодные цены, спецпредложения, простое оформление, консультирование и сопровождение."); + $APPLICATION->SetPageProperty("keywords", "Лизинг в ".$ar_city['PROPERTIES']['CASE']['VALUE'].", лизинг авто ".$ar_city['NAME'].", купить машину в лизинг ".$ar_city['NAME'].""); + } + + $APPLICATION->AddHeadString(' 0 ? "/" : "").'"/>'); + } + + if(!isset($ar_city)) + { + define('ERROR_404', 'Y'); + } + } + } + else + { + if(!isset($arParams['PROGRAM'])) + { + $APPLICATION->AddHeadString(' 0 ? "/" : "").'"/>'); + } + } + + if($arResult['MODEL_DISABLED']) + { + $arResult['MODEL'] = null; + $arResult['SELECTED']['MODEL'] = null; + $arResult['SELECTED']['MODEL_ID'] = null; + $arResult['SELECTED']['MODEL_UID'] = null; + $arResult['SHOW_SPECIAL_OFFERS'] = false; + } + + if($arResult['BRAND_DISABLED']) + { + $arResult['BRAND'] = null; + $arResult['SELECTED']['BRAND'] = null; + $arResult['SELECTED']['BRAND_ID'] = null; + $arResult['SELECTED']['BRAND_UID'] = null; + $arResult['SHOW_SPECIAL_OFFERS'] = false; + } + + foreach($breadcrumbs AS $breadcrumb) + { + $APPLICATION->AddChainItem($breadcrumb['NAME'], $breadcrumb['URL']); + } + + if(isset($_REQUEST['ajax'])) + { + $GLOBALS['APPLICATION']->RestartBuffer(); + + $this->IncludeComponentTemplate(); + $items = ob_get_contents(); + ob_end_clean(); + + header('Content-Type: application/json; charset=utf-8'); + + $response = [ + 'ITEMS' => json_encode(str_replace(["\t","\r","\n"], ["","",""], $items), JSON_UNESCAPED_SLASHES), + 'PAGE_CURRENT' => $arResult['PAGE_CURRENT'], + 'PAGE_COUNT' => $arResult['PAGE_COUNT'], + 'PAGINATION' => json_encode(str_replace(["\t","\r","\n"], ["","",""], $arResult['NAV_STRING']), JSON_UNESCAPED_SLASHES), + ]; + + print json_encode($response, JSON_UNESCAPED_SLASHES); + + die(); + } + else + { + $this->IncludeComponentTemplate(); + } + } +} \ No newline at end of file diff --git a/local/components/evolution/catalog.program/lang/ru/.description.php b/local/components/evolution/catalog.program/lang/ru/.description.php new file mode 100644 index 0000000..cb65bcb --- /dev/null +++ b/local/components/evolution/catalog.program/lang/ru/.description.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/local/components/evolution/catalog.program/lang/ru/.parameters.php b/local/components/evolution/catalog.program/lang/ru/.parameters.php new file mode 100644 index 0000000..f1b414e --- /dev/null +++ b/local/components/evolution/catalog.program/lang/ru/.parameters.php @@ -0,0 +1,2 @@ +setFrameMode(true); + +$title = ""; +$subtitle = ""; + +if(!empty($arParams['REGION']) && $arParams['REGION'] !== "root") +{ + //$title = "Лизинг"; + + if(!empty($arResult['TITLES']['BRAND'])) + { + $title .= " ".$arResult['TITLES']['BRAND']; + + if(!empty($arResult['TITLES']['MODEL'])) + { + $title = $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']; + } + $title = $title." в ".$arResult['CITY']['PROPERTIES']['CASE']['VALUE']." в лизинг"; + $subtitle = " для юридических лиц и ИП"; + } + else + { + $title = "Лизинг в ".$arResult['CITY']['PROPERTIES']['CASE']['VALUE']; + $subtitle = " для юридических лиц и ИП"; + } +} +else +{ + if(!empty($arResult['TITLES']['BRAND'])) + { + $title .= "Новые автомобили ".$arResult['TITLES']['BRAND']; + + if(!empty($arResult['TITLES']['MODEL'])) + { + $title = $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']; + } + + $subtitle = " в лизинг для юридических лиц и ИП"; + } +} + +if(!empty($arResult['TITLE'])) +{ + $title = $arResult['TITLE']; +} + +if(!empty($arResult['SUBTITLE'])) +{ + $subtitle = $arResult['SUBTITLE']; +} + +?> + + +
+
+
+
+
+ +

".$subtitle : ""; ?>

+ +

".$subtitle : ""; ?>

+ +
+ + +
+

СКИДКИ ДО 1,5% + СПЕЦТАРИФ НА КАСКО

+
    +
  • Скидки до 1,5% при покупке
  • +
  • Land Rover в лизинг
  • +
  • Специальный тариф на каско
  • +
+ + +
+ +
"> +
+
+
+ +
+
+ +
+ + +
+
+
+
"> +
+ IncludeComponent( + "evolution:form.catalog.filter", + "", + Array( + "SWITCH" => false, + "SELECTED" => $arResult['SELECTED'], + "PATH" => $arParams['PATH'], + "SORTING" => true, + "PROGRAM" => $arParams['PROGRAM'], + "SCROLL" => $arResult['SCROLL'], + ) + ); ?> +
+
+ + IncludeComponent( + "evolution:catalog.cities.list", + "", + Array( + "TITLE" => "Выберите город", + ) + ); ?> + + 0): ?> + IncludeComponent( + "evolution:catalog.sort", + "", + Array( + "SORT" => $arParams['SORT'], + "FILTER" => $arResult['FILTER_SMALL'], + ) + ); ?> + +
+
+
+
+ + +

Автомобили на данный момент отсутствуют в каталоге, но это не означает, что мы не сможем их для Вас найти. Оставьте заявку или позвоните по номеру горячей линии 8 800 333 75 75 и мы найдём Вам автомобиль!

+

Посмотрите автомобили других марок:

+ + +

Модель на данный момент отсутствует в каталоге, но это не означает, что мы не сможем её для Вас найти. Оставьте заявку или позвоните по номеру горячей линии 8 800 333 75 75 и мы найдём Вам автомобиль!

+ Посмотрите другие модели :

+ */?> + IncludeComponent( + "evolution:catalog.light", + isset($_REQUEST['ajax']) ? "ajax" : "", + array( + "TITLE" => "Посмотрите похожие автомобили на ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL'], + "PAGINATION" => "Y", + "COUNT_PER_PAGE" => 3, + //"BODY" => $_REQUEST['BODY'], + //"BODY_SLUG" => $_REQUEST['BODY_SLUG'], + //"SORT" => $_REQUEST['SORT'], + "PATH" => "/catalog/", + ) + ); + ?> + + + + + IncludeComponent( + "evolution:catalog.city.team", + "", + Array( + "CITY" => $arResult['CITY'], + "BRAND" => $arResult['TITLES']['BRAND'], + "MODEL" => $arResult['TITLES']['MODEL'], + "EXTENDED" => $arResult['EXTENDED'], + ) + ); ?> + + + + IncludeComponent( + "evolution:catalog.special.offers", + "", + Array( + "COUNT" => 3, + "EXTENDED" => $arResult['EXTENDED'], + "BRAND_ID" => $arResult['SELECTED']['BRAND_ID'], + ) + ); ?> + + + + IncludeComponent( + "evolution:catalog.promo.brand", + "", + Array( + "COUNT" => 3, + "PATH" => $arParams['PATH'], + "FILTER_ARRAY" => [ "PROPERTY_PROMO_TAXI_VALUE" => "Да", ], + ) + ); ?> + + + + IncludeComponent( + "evolution:catalog.promo.model", + "", + Array( + "COUNT" => 3, + "BRAND_NAME" => $arResult['TITLES']['BRAND'], + "BRAND_CODE" => $arResult['SELECTED']['BRAND'], + "BRAND_UID" => $arResult['SELECTED']['BRAND_UID'], + "PATH" => $arParams['PATH'], + ) + ); ?> + + + 0): ?> +
+ + IncludeComponent( + "evolution:catalog.list.item", + "", + $arItem + ); ?> + +
+ 1 && $arResult['PAGE_CURRENT'] != $arResult['PAGE_COUNT']): ?> + + + Показать еще + + + + + + + IncludeComponent( + "evolution:catalog.brands", + "", + Array( + "PATH" => $arParams['PATH'], + "TITLE" => "Каталог автомобилей", + "SORT" => $arParams['SORT'], + "FILTER" => $arResult['FILTER_SMALL'], + "BRANDS_FILTER" => ["PROPERTY_TAXI_VALUE" => "Да"], + ) + ); ?> + + + IncludeComponent( + "evolution:catalog.models", + "", + Array( + "PATH" => $arParams['PATH'], + "BRAND" => $_REQUEST['BRAND'], + "RECOMMENDED" => true, + "REGIONS" => !is_null($arParams['REGION']) ? true : false, + ) + ); ?> + + + + IncludeComponent( + "evolution:catalog.city.offices", + "", + Array( + "CITY" => $arResult['CITY'], + ) + ); ?> + + +
+
+ +
+
+
\ No newline at end of file diff --git a/local/components/evolution/catalog.program/templates/ajax/template.php b/local/components/evolution/catalog.program/templates/ajax/template.php new file mode 100644 index 0000000..d76618e --- /dev/null +++ b/local/components/evolution/catalog.program/templates/ajax/template.php @@ -0,0 +1,22 @@ +setFrameMode(true); + +?> + + IncludeComponent( + "evolution:catalog.list.item", + "", + $arItem + ); ?> + \ No newline at end of file diff --git a/local/components/evolution/catalog.promo.brand/templates/.default/template.php b/local/components/evolution/catalog.promo.brand/templates/.default/template.php index 94b1278..94768e7 100644 --- a/local/components/evolution/catalog.promo.brand/templates/.default/template.php +++ b/local/components/evolution/catalog.promo.brand/templates/.default/template.php @@ -12,9 +12,9 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> - 0): ?> + 0): ?> - 0): ?> + 0): ?>

diff --git a/local/components/evolution/catalog.promo.model/templates/.default/template.php b/local/components/evolution/catalog.promo.model/templates/.default/template.php index fd7baef..039cd1d 100644 --- a/local/components/evolution/catalog.promo.model/templates/.default/template.php +++ b/local/components/evolution/catalog.promo.model/templates/.default/template.php @@ -12,9 +12,9 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> - 0): ?> + 0): ?> - 0): ?> + 0): ?>

diff --git a/local/components/evolution/catalog.recommended.models/templates/.default/template.php b/local/components/evolution/catalog.recommended.models/templates/.default/template.php index 1317dbe..82f4fed 100644 --- a/local/components/evolution/catalog.recommended.models/templates/.default/template.php +++ b/local/components/evolution/catalog.recommended.models/templates/.default/template.php @@ -12,7 +12,7 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> - 0): ?> + 0): ?>

Рекомендуемые модели для Вас

diff --git a/local/components/evolution/catalog.special.offers/templates/.default/template.php b/local/components/evolution/catalog.special.offers/templates/.default/template.php index 9f5e079..29da1f7 100644 --- a/local/components/evolution/catalog.special.offers/templates/.default/template.php +++ b/local/components/evolution/catalog.special.offers/templates/.default/template.php @@ -12,7 +12,7 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> - 0): ?> + 0): ?>

" id="catalog_special_h2">Спецпредложения

diff --git a/local/components/evolution/leasing.programs.entry/templates/.default/template.php b/local/components/evolution/leasing.programs.entry/templates/.default/template.php index 0ae6792..3ba64f4 100644 --- a/local/components/evolution/leasing.programs.entry/templates/.default/template.php +++ b/local/components/evolution/leasing.programs.entry/templates/.default/template.php @@ -29,7 +29,7 @@ $this->setFrameMode(true);
- 0): ?> + 0): ?>

Лизинговые предложения

diff --git a/local/components/evolution/leasing.programs.taxi/.description.php b/local/components/evolution/leasing.programs.taxi/.description.php new file mode 100644 index 0000000..a20bdf3 --- /dev/null +++ b/local/components/evolution/leasing.programs.taxi/.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/leasing.programs.taxi/component.php b/local/components/evolution/leasing.programs.taxi/component.php new file mode 100644 index 0000000..4edb550 --- /dev/null +++ b/local/components/evolution/leasing.programs.taxi/component.php @@ -0,0 +1,73 @@ +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 + { + $APPLICATION->AddChainItem($ar_res["NAME"]); + + $APPLICATION->SetPageProperty("title", $arParams['TITLE']); + $APPLICATION->SetPageProperty("description", $arParams['DESCRIPTION']); + $APPLICATION->SetPageProperty("keywords", $arParams['KEYWORDS']); + + $APPLICATION->AddHeadString(''); + } + + $this->IncludeComponentTemplate(); + } +} \ No newline at end of file diff --git a/local/components/evolution/leasing.programs.taxi/lang/ru/.description.php b/local/components/evolution/leasing.programs.taxi/lang/ru/.description.php new file mode 100644 index 0000000..1f56ae4 --- /dev/null +++ b/local/components/evolution/leasing.programs.taxi/lang/ru/.description.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/local/components/evolution/leasing.programs.taxi/templates/.default/style.css b/local/components/evolution/leasing.programs.taxi/templates/.default/style.css new file mode 100644 index 0000000..e69de29 diff --git a/local/components/evolution/leasing.programs.taxi/templates/.default/template.php b/local/components/evolution/leasing.programs.taxi/templates/.default/template.php new file mode 100644 index 0000000..3c7b8d2 --- /dev/null +++ b/local/components/evolution/leasing.programs.taxi/templates/.default/template.php @@ -0,0 +1,81 @@ +setFrameMode(true); +?> +
+
+

+ IncludeComponent( + "evolution:programs.offers.banners", + "", + Array( + "BANNERS" => $arResult['PROPERTIES']['SPECIAL_OFFERS_BANNERS']['VALUE'], + "PAGINATION" => "N", + ) + ); + ?> +
+
+ +
+ 0): ?> +
+
+

Лизинговые предложения

+
+ +
+ +
+ +
+
+
+ + + IncludeComponent( + "evolution:catalog.program", + isset($_REQUEST['ajax']) ? "ajax" : "", + array( + "PAGINATION" => "Y", + "leasing_program" => $arResult['PROPERTIES']['CATALOG']['VALUE_XML_ID'], + //"section_code" => $arResult['DETAIL_PAGE_URL'], + "top_banners" => false, + "FILTER_SMALL" => [ "PROPERTY_TAXI_VALUE" => "Да" ], + "BRAND" => $_REQUEST['BRAND'], + "MODEL" => $_REQUEST['MODEL'], + "MODIFICATION" => $_REQUEST['MODIFICATION'], + "DRIVE" => $_REQUEST['DRIVE'], + "BODY" => $_REQUEST['BODY'], + "GEAR" => $_REQUEST['GEAR'], + "ENGINE_FUEL" => $_REQUEST['ENGINE_FUEL'], + "ENGINE_POWER_FROM" => $_REQUEST['ENGINE_POWER_FROM'], + "ENGINE_POWER_TO" => $_REQUEST['ENGINE_POWER_TO'], + "ENGINE_VOLUME_FROM" => $_REQUEST['ENGINE_VOLUME_FROM'], + "ENGINE_VOLUME_TO" => $_REQUEST['ENGINE_VOLUME_TO'], + "SORT" => $_REQUEST['SORT'], + "PATH" => $arResult['DETAIL_PAGE_URL'], + "PROGRAM" => $arResult['PROPERTIES']['CATALOG']['VALUE_XML_ID'], + ) + ); + ?> + +IncludeComponent( +// "evolution:programs.offers", +// "", +// Array() +// ); +?> \ No newline at end of file diff --git a/local/components/evolution/programs.offers.banners/templates/.default/template.php b/local/components/evolution/programs.offers.banners/templates/.default/template.php index 4a08bc3..416de7d 100644 --- a/local/components/evolution/programs.offers.banners/templates/.default/template.php +++ b/local/components/evolution/programs.offers.banners/templates/.default/template.php @@ -38,7 +38,7 @@ $this->setFrameMode(true);
- 2): ?> + 2): ?>
- +
\ No newline at end of file diff --git a/local/components/evolution/special.offers.offer/templates/.default/template.php b/local/components/evolution/special.offers.offer/templates/.default/template.php index 48fed45..4283c3c 100644 --- a/local/components/evolution/special.offers.offer/templates/.default/template.php +++ b/local/components/evolution/special.offers.offer/templates/.default/template.php @@ -51,7 +51,7 @@ $this->setFrameMode(true);
- 0): ?> + 0): ?>

Лизинговые предложения

diff --git a/local/components/evolution/used.catalog.position/templates/.default/template.php b/local/components/evolution/used.catalog.position/templates/.default/template.php index bd39b2f..74fff80 100644 --- a/local/components/evolution/used.catalog.position/templates/.default/template.php +++ b/local/components/evolution/used.catalog.position/templates/.default/template.php @@ -66,7 +66,7 @@ $this->setFrameMode(true); ]); ?>'/>
- 0): ?> + 0): ?> " src="" alt="" width="100%" height="auto" style="opacity:0.0; display: block;"> 0): ?> $photo_480): ?> diff --git a/local/components/evolution/used.catalog/templates/.default/template.php b/local/components/evolution/used.catalog/templates/.default/template.php index 872ba3f..cc3dc5f 100644 --- a/local/components/evolution/used.catalog/templates/.default/template.php +++ b/local/components/evolution/used.catalog/templates/.default/template.php @@ -137,7 +137,7 @@ if(!empty($arResult['SUBTITLE'])) ); ?>
- 0): ?> + 0): ?> IncludeComponent( "evolution:catalog.sort", "", @@ -153,7 +153,7 @@ if(!empty($arResult['SUBTITLE']))
- 0): ?> + 0): ?>
IncludeComponent(