Last active
December 3, 2019 09:33
-
-
Save dnikonov/b35379253d2e37c51ea159cfbaadb0f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// result_modifier.php | |
// превью изображений | |
foreach ($arResult["ITEMS"] as $key => &$arItem) { | |
if ($arItem["PREVIEW_PICTURE"]) { | |
$arItem["PREVIEW_PICTURE_THUMB"] = array_change_key_case(CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"], array("width" => 500, "height" => 500), BX_RESIZE_IMAGE_PROPORTIONAL_ALT, true), CASE_UPPER); | |
} | |
if ($arItem["DISPLAY_PROPERTIES"]["SLIDER"]["VALUE"]) { | |
if (count($arItem["DISPLAY_PROPERTIES"]["SLIDER"]["VALUE"]) == 1) { | |
$arItem["DISPLAY_PROPERTIES"]["SLIDER"]["FILE_VALUE"] = array($arItem["DISPLAY_PROPERTIES"]["SLIDER"]["FILE_VALUE"]); | |
} | |
foreach ($arItem["DISPLAY_PROPERTIES"]["SLIDER"]["FILE_VALUE"] as $key2 => $value) { | |
$arItem["DISPLAY_PROPERTIES"]["SLIDER"]["FILE_VALUE"][$key2]["THUMB"] = array_change_key_case(CFile::ResizeImageGet($value, array("width" => 500, "height" => 500), BX_RESIZE_IMAGE_PROPORTIONAL_ALT, true), CASE_UPPER); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment