Merge branch 'master' of github.com:merelendor/evoleasing-site

This commit is contained in:
merelendor 2023-07-09 16:55:01 +03:00
commit df7ac5b890
7 changed files with 321 additions and 5 deletions

1
.gitignore vendored
View File

@ -12,4 +12,5 @@ vizitka/tmp/
vkteamssetup.exe
local/*.json
local/*.txt
local/commands/
!local/sitemap.php

View File

@ -18,4 +18,15 @@
.catalog_filter_used *[data-desktop-order] {
width: 100% !important;
}
}
@media (max-width: 767px)
{
#filter .filter_body .filter_column:last-child {
margin-bottom: 10px !important;
}
#filter .filter_header {
margin-bottom: 80px !important;
}
}

View File

@ -329,10 +329,10 @@ function resize_image($image, $filename, $width, $height, $quality)
$original_height = imagesy($source);
$panel_width = $width;
$panel_height = ($original_height * ($width / $original_width));
$panel_height = intval($original_height * floatval($width / $original_width));
$panel = imagecreatetruecolor($panel_width, $panel_height);
imagecopyresampled($panel, $source, 0, 0, 0, 0, $panel_width, $panel_height, $original_width, $original_height);
imagecopyresampled($resized, $panel, 0, 0, 0, (($panel_height - $height) / 2), $width, $height, $panel_width, $height);
imagecopyresampled($resized, $panel, 0, 0, 0, intval(($panel_height - $height) / 2), $width, $height, $panel_width, $height);
imagejpeg($resized, $tempfile_filename, $quality);
@ -452,9 +452,6 @@ foreach($json as $car)
}
}
print "photos_property_values\n\n";
print_r($photos_property_values);
CIBlockElement::SetPropertyValueCode($new_used_car_id, "PHOTO", $photo_property_value);
CIBlockElement::SetPropertyValueCode($new_used_car_id, "PHOTOS_1080", $photos_1080_property_values);
CIBlockElement::SetPropertyValueCode($new_used_car_id, "PHOTOS_480", $photos_480_property_values);

View File

@ -0,0 +1,194 @@
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
{
die();
}
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/rest/install/public/marketplace/.left.menu_ext.php");
$arMenu = array();
$extranetSite = (
\Bitrix\Main\Loader::includeModule('extranet')
&& \CExtranet::isExtranetSite(SITE_ID)
);
if(
!$extranetSite
&& (
SITE_TEMPLATE_ID == 'bitrix24'
|| \Bitrix\Main\ModuleManager::isModuleInstalled('bitrix24')
)
)
{
$arMenu[] = Array(
GetMessage("MENU_MARKETPLACE_ALL"),
SITE_DIR."marketplace/",
Array(),
Array("menu_item_id" => "menu_marketplace"),
""
);
}
if(
!$extranetSite
&& CModule::IncludeModule("rest")
)
{
if (\CRestUtil::isAdmin())
{
$arMenu[] = Array(
GetMessage("MENU_MARKETPLACE_INSTALLED"),
SITE_DIR."marketplace/installed/",
Array(),
Array("menu_item_id" => "menu_marketplace_installed"),
""
);
}
$arUserGroupCode = $USER->GetAccessCodes();
$arMenuApps = array();
$dbApps = \Bitrix\Rest\AppTable::getList(
[
'order' => [
"ID" => "ASC"
],
'filter' => [
"=ACTIVE" => \Bitrix\Rest\AppTable::ACTIVE
],
'select' => [
'ID',
'CODE',
'CLIENT_ID',
'STATUS',
'ACTIVE',
'ACCESS',
'MENU_NAME' => 'LANG.MENU_NAME',
'MENU_NAME_DEFAULT' => 'LANG_DEFAULT.MENU_NAME',
'MENU_NAME_LICENSE' => 'LANG_LICENSE.MENU_NAME',
],
]
);
foreach ($dbApps->fetchCollection() as $app)
{
$arApp = [
'ID' => $app->getId(),
'CODE' => $app->getCode(),
'ACTIVE' => $app->getActive(),
'CLIENT_ID' => $app->getClientId(),
'ACCESS' => $app->getAccess(),
'MENU_NAME' => !is_null($app->getLang()) ? $app->getLang()->getMenuName() : '',
'MENU_NAME_DEFAULT' => !is_null($app->getLangDefault()) ? $app->getLangDefault()->getMenuName() : '',
'MENU_NAME_LICENSE' => !is_null($app->getLangLicense()) ? $app->getLangLicense()->getMenuName() : ''
];
if($arApp['CODE'] === \CRestUtil::BITRIX_1C_APP_CODE)
{
continue;
}
$lang = in_array(LANGUAGE_ID, array("ru", "en", "de"))
? LANGUAGE_ID
: \Bitrix\Main\Localization\Loc::getDefaultLang(LANGUAGE_ID);
if ($arApp["MENU_NAME"] === '' && $arApp['MENU_NAME_DEFAULT'] === '' && $arApp['MENU_NAME_LICENSE'] === '')
{
$app->fillLangAll();
if (!is_null($app->getLangAll()))
{
$langList = [];
foreach ($app->getLangAll() as $appLang)
{
if ($appLang->getMenuName() !== '')
{
$langList[$appLang->getLanguageId()] = $appLang->getMenuName();
}
}
if (isset($langList[$lang]) && $langList[$lang])
{
$arApp["MENU_NAME"] = $langList[$lang];
}
elseif (isset($langList['en']) && $langList['en'])
{
$arApp["MENU_NAME"] = $langList['en'];
}
elseif (!empty($langList))
{
$arApp["MENU_NAME"] = reset($langList);
}
}
}
if($arApp["MENU_NAME"] <> '' || $arApp['MENU_NAME_DEFAULT'] <> '' || $arApp['MENU_NAME_LICENSE'] <> '')
{
$appRightAvailable = false;
if(\CRestUtil::isAdmin())
{
$appRightAvailable = true;
}
elseif(!empty($arApp["ACCESS"]))
{
$rights = explode(",", $arApp["ACCESS"]);
foreach($rights as $rightID)
{
if(in_array($rightID, $arUserGroupCode))
{
$appRightAvailable = true;
break;
}
}
}
else
{
$appRightAvailable = true;
}
if($appRightAvailable)
{
$appName = $arApp["MENU_NAME"];
if($appName == '')
{
$appName = $arApp['MENU_NAME_DEFAULT'];
}
if($appName == '')
{
$appName = $arApp['MENU_NAME_LICENSE'];
}
$arMenuApps[] = Array(
htmlspecialcharsbx($appName),
\CRestUtil::getApplicationPage($arApp['ID'], 'ID', $arApp),
Array(
\CRestUtil::getApplicationPage($arApp['ID'], 'CODE', $arApp),
\CRestUtil::getApplicationPage($arApp['ID'], 'CLIENT_ID', $arApp),
),
Array("is_application" => "Y", "app_id" => $arApp["ID"]),
""
);
}
}
}
if ($USER->IsAuthorized())
{
$urlDevOps = \Bitrix\Rest\Url\DevOps::getInstance()->getIndexUrl();
$arMenu[] = [
GetMessage("REST_MENU_MARKETPLACE_DEVOPS"),
$urlDevOps,
[],
[
"menu_item_id" => "menu_marketplace_hook"
],
"",
];
}
$arMenu = array_merge($arMenu, $arMenuApps);
}
$aMenuLinks = array_merge($arMenu, $aMenuLinks);

30
marketplace/app/index.php Normal file
View File

@ -0,0 +1,30 @@
<?php
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$component = $component ?? null;
$APPLICATION->IncludeComponent(
"bitrix:ui.sidepanel.wrapper",
"",
array(
"POPUP_COMPONENT_NAME" => "bitrix:app.layout",
"POPUP_COMPONENT_TEMPLATE_NAME" => ".default",
"POPUP_COMPONENT_PARAMS" => array(
"COMPONENT_TEMPLATE" => ".default",
"DETAIL_URL" => SITE_DIR."marketplace/detail/#code#/",
"SEF_MODE" => "Y",
"IS_SLIDER" => (\CRestUtil::isSlider() ? "Y" : "N"),
"SEF_FOLDER" => SITE_DIR."marketplace/app/",
"SEF_URL_TEMPLATES" => array(
"application" => "#id#/",
),
"USE_PADDING" => 'N'
),
"USE_PADDING" => false,
"PAGE_MODE" => true,
"USE_UI_TOOLBAR" => "N",
"PLAIN_VIEW" => (\CRestUtil::isSlider() ? "Y" : "N")
),
$component
);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");

View File

@ -0,0 +1,38 @@
<?php
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
global $APPLICATION;
$request = Bitrix\Main\Application::getInstance()->getContext()->getRequest();
if ($request->get('inSlider') === 'N')
{
$APPLICATION->includeComponent(
'bitrix:rest.configuration',
'',
array(
"SEF_MODE" => "Y",
'SEF_FOLDER' => \Bitrix\Rest\Marketplace\Url::getConfigurationUrl(),
),
false, array('HIDE_ICONS' => 'Y')
);
}
else
{
$APPLICATION->SetTitle("");
$APPLICATION->IncludeComponent(
"bitrix:ui.sidepanel.wrapper",
"",
[
"POPUP_COMPONENT_NAME" => "bitrix:rest.configuration",
"POPUP_COMPONENT_TEMPLATE_NAME" => ".default",
"POPUP_COMPONENT_PARAMS" => [
"SEF_MODE" => "Y",
'SEF_FOLDER' => \Bitrix\Rest\Marketplace\Url::getConfigurationUrl(),
],
"PAGE_MODE" => false,
"USE_PADDING" => false,
"RELOAD_GRID_AFTER_SAVE" => 'all'
]
);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");
}
?>

45
marketplace/index.php Normal file
View File

@ -0,0 +1,45 @@
<?php
use Bitrix\Main\Context;
use Bitrix\Main\Loader;
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
global $APPLICATION;
$APPLICATION->SetTitle("");
if (Loader::includeModule('market')) {
$path = str_replace('/marketplace/', '/market/', Context::getCurrent()->getRequest()->getRequestUri());
LocalRedirect($path);
}
$APPLICATION->IncludeComponent(
"bitrix:ui.sidepanel.wrapper",
"",
array(
"POPUP_COMPONENT_NAME" => "bitrix:rest.marketplace",
"POPUP_COMPONENT_TEMPLATE_NAME" => ".default",
"POPUP_COMPONENT_PARAMS" => array(
"SEF_MODE" => "Y",
"SEF_FOLDER" => SITE_DIR."marketplace/",
"APPLICATION_URL" => SITE_DIR."marketplace/app/#id#/",
"SEF_URL_TEMPLATES" => array(
//"top" => "",
"category" => "category/#category#/",
"detail" => "detail/#app#/",
"placement_view" => "view/#APP#/",
"placement" => "placement/#PLACEMENT_ID#/",
"search" => "search/",
"buy" => "buy/",
"updates" => "updates/",
"installed" => "installed/",
)
),
"USE_UI_TOOLBAR" => "Y",
"USE_PADDING" => false,
"PAGE_MODE" => false
),
);
?>
<?php require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php") ?>