Ejemplo n.º 1
0
	}
	//ORDER BY
	$arSort = array(
		"RAND"=>"ASC",
	);
	//EXECUTE
	$rsIBlockElement = CIBlockElement::GetList($arSort, $arFilter, false, false, $arSelect);
	$rsIBlockElement->SetUrlTemplates($arParams["DETAIL_URL"]);
	if($arResult = $rsIBlockElement->GetNext())
	{
		$arResult["PICTURE"] = CFile::GetFileArray($arResult["PREVIEW_PICTURE"]);
		if(!is_array($arResult["PICTURE"]))
			$arResult["PICTURE"] = CFile::GetFileArray($arResult["DETAIL_PICTURE"]);

		$ipropValues = new \Freetrix\Iblock\InheritedProperty\ElementValues($arResult["IBLOCK_ID"], $arResult["ID"]);
		$arResult["IPROPERTY_VALUES"] = $ipropValues->getValues();

		if ($arResult["PICTURE"])
		{
			$arResult["PICTURE"]["ALT"] = $arResult["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_ALT"];
			if ($arResult["PICTURE"]["ALT"] == "")
				$arResult["PICTURE"]["ALT"] = $arResult["NAME"];
			$arResult["PICTURE"]["TITLE"] = $arResult["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_TITLE"];
			if ($arResult["PICTURE"]["TITLE"] == "")
				$arResult["PICTURE"]["TITLE"] = $arResult["NAME"];
		}

		$this->SetResultCacheKeys(array(
		));
		$this->IncludeComponentTemplate();
	}
Ejemplo n.º 2
0
				$arItem["PROPERTIES"] = $obElement->GetProperties();
			$arItem["DISPLAY_PROPERTIES"]=array();
			foreach($arParams["PROPERTY_CODE"] as $pid)
			{
				$prop = &$arItem["PROPERTIES"][$pid];
				if(
					(is_array($prop["VALUE"]) && count($prop["VALUE"])>0)
					|| (!is_array($prop["VALUE"]) && strlen($prop["VALUE"])>0)
				)
				{
					$arItem["DISPLAY_PROPERTIES"][$pid] = CIBlockFormatProperties::GetDisplayValue($arItem, $prop, "photo_out");
				}
			}

			$ipropValues = new \Freetrix\Iblock\InheritedProperty\ElementValues($arItem["IBLOCK_ID"], $arItem["ID"]);
			$arItem["IPROPERTY_VALUES"] = $ipropValues->getValues();

			$arItem["PREVIEW_PICTURE"] = (0 < $arItem["PREVIEW_PICTURE"] ? CFile::GetFileArray($arItem["PREVIEW_PICTURE"]) : false);
			if ($arItem["PREVIEW_PICTURE"])
			{
				$arItem["PREVIEW_PICTURE"]["ALT"] = $arItem["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_ALT"];
				if ($arItem["PREVIEW_PICTURE"]["ALT"] == "")
					$arItem["PREVIEW_PICTURE"]["ALT"] = $arItem["NAME"];
				$arItem["PREVIEW_PICTURE"]["TITLE"] = $arItem["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_TITLE"];
				if ($arItem["PREVIEW_PICTURE"]["TITLE"] == "")
					$arItem["PREVIEW_PICTURE"]["TITLE"] = $arItem["NAME"];
			}

			$arItem["DETAIL_PICTURE"] = (0 < $arItem["DETAIL_PICTURE"] ? CFile::GetFileArray($arItem["DETAIL_PICTURE"]) : false);
			if ($arItem["DETAIL_PICTURE"])
			{
Ejemplo n.º 3
0
				$arResult["NEXT"][] = $arElement;
			}
			else
			{
				array_unshift($arResult["PREV"], $arElement);
			}
		}

		$arResult["CURRENT"]["COUNT"] = CIBlockElement::GetList(array(), $arFilter, array());

		foreach (array("NEXT", "PREV") as $type)
		{
			foreach($arResult[$type] as $key=>$value)
			{
				$ipropValues = new \Freetrix\Iblock\InheritedProperty\ElementValues($value["IBLOCK_ID"], $value["ID"]);
				$IPROPERTY_VALUES = $ipropValues->getValues();

				$arResult[$type][$key]["PICTURE"] = CFile::GetFileArray($value["PREVIEW_PICTURE"]);
				if ($arResult[$type][$key]["PICTURE"])
				{
					$arResult[$type][$key]["PICTURE"]["ALT"] = $IPROPERTY_VALUES["ELEMENT_PREVIEW_PICTURE_FILE_ALT"];
					if ($arResult[$type][$key]["PICTURE"]["ALT"] == "")
						$arResult[$type][$key]["PICTURE"]["ALT"] = $value["NAME"];
					$arResult[$type][$key]["PICTURE"]["TITLE"] = $IPROPERTY_VALUES["ELEMENT_PREVIEW_PICTURE_FILE_TITLE"];
					if ($arResult[$type][$key]["PICTURE"]["TITLE"] == "")
						$arResult[$type][$key]["PICTURE"]["TITLE"] = $value["NAME"];
				}
			}
		}

		$this->SetResultCacheKeys(array(