Ejemplo n.º 1
0
				if ($strWarning == '')
				{
					$bs = new CIBlockElement;

					$arPREVIEW_PICTURE = CIBlock::makeFileArray(
						array_key_exists("PREVIEW_PICTURE", $_FILES)? $_FILES["PREVIEW_PICTURE"]: $_REQUEST["PREVIEW_PICTURE"],
						${"PREVIEW_PICTURE_del"} === "Y",
						${"PREVIEW_PICTURE_descr"}
					);
					if ($arPREVIEW_PICTURE["error"] == 0)
						$arPREVIEW_PICTURE["COPY_FILE"] = "Y";

					$arDETAIL_PICTURE = CIBlock::makeFileArray(
						array_key_exists("DETAIL_PICTURE", $_FILES)? $_FILES["DETAIL_PICTURE"]: $_REQUEST["DETAIL_PICTURE"],
						${"DETAIL_PICTURE_del"} === "Y",
						${"DETAIL_PICTURE_descr"}
					);
					if ($arDETAIL_PICTURE["error"] == 0)
						$arDETAIL_PICTURE["COPY_FILE"] = "Y";

					$arFields = array(
						"ACTIVE" => $_POST["ACTIVE"],
						"MODIFIED_BY" => $USER->GetID(),
						"IBLOCK_ID" => $IBLOCK_ID,
						"ACTIVE_FROM" => $_POST["ACTIVE_FROM"],
						"ACTIVE_TO" => $_POST["ACTIVE_TO"],
						"SORT" => $_POST["SORT"],
						"NAME" => $_POST["NAME"],
						"CODE" => trim($_POST["CODE"], " \t\n\r"),
						"TAGS" => $_POST["TAGS"],
Ejemplo n.º 2
0
			}

			if (array_key_exists("PREVIEW_PICTURE", $arFields))
			{
				$arFields["PREVIEW_PICTURE"] = CIBlock::makeFileArray(
					$arFields["PREVIEW_PICTURE"],
					$_REQUEST["FIELDS_del"][$TYPE.$ID]["PREVIEW_PICTURE"] === "Y",
					$_REQUEST["FIELDS_descr"][$TYPE.$ID]["PREVIEW_PICTURE"]
				);
			}

			if (array_key_exists("DETAIL_PICTURE", $arFields))
			{
				$arFields["DETAIL_PICTURE"] = CIBlock::makeFileArray(
					$arFields["DETAIL_PICTURE"],
					$_REQUEST["FIELDS_del"][$TYPE.$ID]["DETAIL_PICTURE"] === "Y",
					$_REQUEST["FIELDS_descr"][$TYPE.$ID]["DETAIL_PICTURE"]
				);
			}

			if(!is_array($arFields["PROPERTY_VALUES"]))
				$arFields["PROPERTY_VALUES"] = array();
			$bFieldProps = array();
			foreach($arFields as $k=>$v)
			{
				if(
					$k != "PROPERTY_VALUES"
					&& strncmp($k, "PROPERTY_", 9) == 0
				)
				{
					$prop_id = substr($k, 9);
 foreach ($arPropertyValueCombinationResult[$imageRowId] as $srcKey => $srcValue) {
     if ($srcValue == '-1') {
         continue;
     }
     if (!isset($arFilePropertiesExt[$srcKey]) && $srcKey != 'DETAIL' && $srcKey != 'ANNOUNCE') {
         continue;
     }
     switch ($srcKey) {
         case 'ANNOUNCE':
             $arIBlockElementAdd['PREVIEW_PICTURE'] = CIBlock::makeFileArray($srcValue, false);
             if ($arIBlockElementAdd['PREVIEW_PICTURE']['error'] == 0) {
                 $arIBlockElementAdd['PREVIEW_PICTURE']['COPY_FILE'] = 'Y';
             }
             break;
         case 'DETAIL':
             $arIBlockElementAdd['DETAIL_PICTURE'] = CIBlock::makeFileArray($srcValue, false);
             if ($arIBlockElementAdd['DETAIL_PICTURE']['error'] == 0) {
                 $arIBlockElementAdd['DETAIL_PICTURE']['COPY_FILE'] = 'Y';
             }
             break;
         default:
             if (is_array($srcValue)) {
                 $arPropertySaveValues[$srcKey] = array();
                 foreach ($srcValue as $fileID => $fileValue) {
                     $arPropertySaveValues[$srcKey][$fileID] = CIBlock::makeFilePropArray($srcValue[$fileID], false);
                 }
             } else {
                 $arPropertySaveValues[$srcKey] = CIBlock::makeFilePropArray($srcValue, false);
             }
             break;
     }