本文整理汇总了PHP中CIBlock::makeFilePropArray方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlock::makeFilePropArray方法的具体用法?PHP CIBlock::makeFilePropArray怎么用?PHP CIBlock::makeFilePropArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlock
的用法示例。
在下文中一共展示了CIBlock::makeFilePropArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
if (isset($PROP_del[$k1]) && is_array($PROP_del[$k1]))
{
foreach ($PROP_del[$k1] as $prop_value_id => $tmp)
{
if (!array_key_exists($prop_value_id, $PROP[$k1]))
$PROP[$k1][$prop_value_id] = null;
}
}
if (isset($PROP[$k1]) && is_array($PROP[$k1]))
{
foreach ($PROP[$k1] as $prop_value_id => $prop_value)
{
$PROP[$k1][$prop_value_id] = CIBlock::makeFilePropArray(
$PROP[$k1][$prop_value_id],
$PROP_del[$k1][$prop_value_id] === "Y",
isset($_POST["DESCRIPTION_PROP"][$k1][$prop_value_id])? $_POST["DESCRIPTION_PROP"][$k1][$prop_value_id]: $_POST["PROP_descr"][$k1][$prop_value_id]
);
}
}
}
$DESCRIPTION_PROP = $_POST["DESCRIPTION_PROP"];
if(is_array($DESCRIPTION_PROP))
{
foreach($DESCRIPTION_PROP as $k1=>$val1)
{
foreach($val1 as $k2=>$val2)
{
if(is_set($PROP[$k1], $k2) && is_array($PROP[$k1][$k2]) && is_set($PROP[$k1][$k2], "DESCRIPTION"))
$PROP[$k1][$k2]["DESCRIPTION"] = $val2;
示例2: strncmp
foreach($arFields as $k=>$v)
{
if(
$k != "PROPERTY_VALUES"
&& strncmp($k, "PROPERTY_", 9) == 0
)
{
$prop_id = substr($k, 9);
if (isset($arFileProps[$prop_id]))
{
foreach ($v as $prop_value_id => $file)
{
$v[$prop_value_id] = CIBlock::makeFilePropArray(
$v[$prop_value_id],
$_REQUEST["FIELDS_del"][$TYPE.$ID][$k][$prop_value_id]["VALUE"] === "Y",
$_REQUEST["FIELDS_descr"][$TYPE.$ID][$k][$prop_value_id]
);
}
}
if(isset($_REQUEST["FIELDS_descr"][$TYPE.$ID][$k]) && is_array($_REQUEST["FIELDS_descr"][$TYPE.$ID][$k]))
{
foreach($_REQUEST["FIELDS_descr"][$TYPE.$ID][$k] as $PROPERTY_VALUE_ID => $ar)
{
if(
is_array($ar)
&& isset($ar["VALUE"])
&& isset($v[$PROPERTY_VALUE_ID]["VALUE"])
&& is_array($v[$PROPERTY_VALUE_ID]["VALUE"])
)
示例3: array
}
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;
}
}
}
$arPropertySaveValues["CML2_LINK"] = $parentElement;
$arIBlockElementAdd['PROPERTY_VALUES'] = $arPropertySaveValues;
$sku = new \Bitrix\Iblock\Template\Entity\Element(0);
$sku->setFields($arIBlockElementAdd);
$arIBlockElementAdd["NAME"] = htmlspecialcharsback(\Bitrix\Iblock\Template\Engine::process($sku, $title));
unset($arIBlockElementAdd['PROPERTY_VALUES']["CML2_LINK"]);
$idNewElement = $obIBlockElement->Add($arIBlockElementAdd, false, true, true);
if ($idNewElement) {
$productData['ID'] = $idNewElement;
CCatalogProduct::Add($productData, false);