• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CIBlockPropertyEnum类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CIBlockPropertyEnum的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockPropertyEnum类的具体用法?PHP CIBlockPropertyEnum怎么用?PHP CIBlockPropertyEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CIBlockPropertyEnum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: generateAddCode

 /**
  * Генерация создания Информационного блока
  *
  * generateAddCode
  * @param array $IblockCode
  * @return bool|string
  */
 public function generateAddCode($IblockCode)
 {
     $return = array();
     $iblockObject = $this->iblock->GetList(array(), array('CODE' => $IblockCode, 'CHECK_PERMISSIONS' => 'N'));
     if ($item = $iblockObject->Fetch()) {
         # Установка групп пользователей
         $this->setUserGroupId($item['ID'], $item);
         $item['FIELDS'] = \CIBlock::GetFields($item['ID']);
         Helper::unsetFields(array('ID'), $item);
         if ($return[] = $this->getMethodContent('Bim\\Db\\Iblock\\IblockIntegrate', 'Add', array($item))) {
             $IblockProperty = new \CIBlockProperty();
             $iblockPropertyQuery = $IblockProperty->GetList(array(), array('IBLOCK_CODE' => $item['CODE']));
             while ($iblockProperty = $iblockPropertyQuery->Fetch()) {
                 Helper::unsetFields(array('ID'), $iblockProperty);
                 $iblockProperty['IBLOCK_CODE'] = $item['CODE'];
                 $propertyQuery = \CIBlockPropertyEnum::GetList(array(), array("IBLOCK_ID" => $iblockProperty['IBLOCK_ID'], "CODE" => $iblockProperty['CODE']));
                 while ($propertyValues = $propertyQuery->Fetch()) {
                     Helper::unsetFields(array('ID', 'PROPERTY_ID'), $propertyValues);
                     $iblockProperty['VALUES'][] = $propertyValues;
                 }
                 if (!is_null($iblockProperty['LINK_IBLOCK_ID'])) {
                     $linkedIBlock = $this->iblock->GetList(array(), array('ID' => $iblockProperty['LINK_IBLOCK_ID'], 'CHECK_PERMISSIONS' => 'N'))->Fetch();
                     $iblockProperty['LINK_IBLOCK_CODE'] = $linkedIBlock['CODE'];
                 }
                 $return[] = $this->getMethodContent('Bim\\Db\\Iblock\\IblockPropertyIntegrate', 'Add', array($iblockProperty));
             }
             return implode(PHP_EOL, $return);
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:cjp2600,项目名称:bim-core,代码行数:41,代码来源:Iblock.php


示例2: _getPropertiesEx

function _getPropertiesEx($arParams)
{
    $arFilter = array();
    $arProperties = array();
    $arPropListIds = array();
    if (notEmpty($arParams["type"])) {
        $arFilter["PROPERTY_TYPE"] = $arParams["type"];
    }
    if (notEmpty($arParams["iblock_id"])) {
        $arFilter["IBLOCK_ID"] = iblock($arParams["iblock_id"]);
    }
    $resProperties = \CIBlockProperty::GetList(array(), $arFilter);
    while ($arProperty = $resProperties->Fetch()) {
        $arProperties[$arProperty["CODE"]] = $arProperty;
        if ($arProperty["PROPERTY_TYPE"] == "L") {
            $arPropListIds[] = $arProperty["ID"];
        }
    }
    // В фильтр CIBlockPropertyEnum::GetList() нельзя передать
    // PROPERTY_ID в виде массива ID, поэтому перебираем
    // каждое свойство в цикле
    foreach ($arPropListIds as $propListId) {
        $resPropValues = \CIBlockPropertyEnum::GetList(array('SORT' => 'ASC', 'VALUE' => 'ASC'), array('PROPERTY_ID' => $propListId));
        while ($arPropValue = $resPropValues->Fetch()) {
            $arProperties[$arPropValue["PROPERTY_CODE"]]["VALUES"][$arPropValue["XML_ID"]] = $arPropValue["ID"];
        }
    }
    return $arProperties;
}
开发者ID:rschweppes,项目名称:bitrix-helpers,代码行数:29,代码来源:getproperties.php


示例3: onBeforeElementAddHandler

 static function onBeforeElementAddHandler($arFields)
 {
     $IBLOCK_ID = Config\Option::get("citfact.replaceurl", "IBLOCK_ID", "");
     $SECTION_ID = Config\Option::get("citfact.replaceurl", "SECTION_BREND_ID", "BRENDI");
     $CODE_PROP = Config\Option::get("citfact.replaceurl", "PROPERTY_CODE_BRENDI", "BRENDI");
     if ($IBLOCK_ID == $arFields["IBLOCK_ID"]) {
         $propertyBrand = \CIBlockProperty::GetByID($CODE_PROP, $arFields["IBLOCK_ID"]);
         if ($arResultProperty = $propertyBrand->GetNext()) {
             $propertyBrandValue = \CIBlockPropertyEnum::GetByID($arFields["PROPERTY_VALUES"][$arResultProperty["ID"]][0]["VALUE"]);
         }
         $rqParentSection = \CIBlockSection::GetByID($SECTION_ID);
         if ($arParentSection = $rqParentSection->GetNext()) {
             $arFilter = array('IBLOCK_ID' => $arParentSection['IBLOCK_ID'], '>LEFT_MARGIN' => $arParentSection['LEFT_MARGIN'], '<RIGHT_MARGIN' => $arParentSection['RIGHT_MARGIN'], '>DEPTH_LEVEL' => $arParentSection['DEPTH_LEVEL']);
             // выберет потомков без учета активности
             $rqSectChild = \CIBlockSection::GetList(array('left_margin' => 'asc'), $arFilter);
             while ($arSectChild = $rqSectChild->GetNext()) {
                 $arSections[$arSectChild["NAME"]] = $arSectChild["ID"];
             }
         }
         if (array_key_exists($propertyBrandValue["VALUE"], $arSections)) {
             $arFields["IBLOCK_SECTION"][] = $arSections[$propertyBrandValue["VALUE"]];
         } else {
             $arParams = array("replace_space" => "-", "replace_other" => "-");
             $trans = \Cutil::translit($propertyBrandValue["VALUE"], "ru", $arParams);
             $bs = new \CIBlockSection();
             $arFieldsNewSection = array("ACTIVE" => "Y", "IBLOCK_SECTION_ID" => $SECTION_ID, "IBLOCK_ID" => $IBLOCK_ID, "NAME" => $propertyBrandValue["VALUE"], "CODE" => $trans);
             $resultAdd = $bs->Add($arFieldsNewSection);
             $arFields["IBLOCK_SECTION"][] = $resultAdd;
         }
     }
     return true;
 }
开发者ID:ASDAFF,项目名称:citfact.replaceurl,代码行数:32,代码来源:Event.php


示例4: storeResult

function storeResult($arResult, $arParams) {
    $iblock = CIBlock::GetList(
        array(),
        array(
            'TYPE' => $arParams['IBLOCK_TYPE'],
            'CODE' => $arParams['IBLOCK_CODE'],
        )
    );
    $iblock = $iblock->Fetch();
    
    $el = new CIBlockElement;

    $props = array();
    foreach ($arResult['FIELDS_LIST'] as $arField) {
        if ($arField['FIELD_TYPE'] == 'TEXT' || $arField['FIELD_TYPE'] == 'NUMBER') {
            $props[$arField['CODE']] = array(
                'VALUE' => $arResult['POST_DATA']['~'.$arField['CODE']],
            );
        } elseif ($arField['FIELD_TYPE'] == 'TEXTAREA') {
            $props[$arField['CODE']] = array(
                'VALUE' => array(
                    'TYPE' => 'text',
                    'TEXT' => $arResult['POST_DATA']['~'.$arField['CODE']],
                ),
            );
        } elseif ($arField['FIELD_TYPE'] == 'LIST') {
            $propEnum = CIBlockPropertyEnum::GetList(
                array(),
                array(
                    'XML_ID' => $arResult['POST_DATA']['~'.$arField['CODE']],
                    'CODE' => $arField['CODE'],
                    'IBLOCK_ID' => $iblock['ID'],
                )
            );
            $propEnum = $propEnum->Fetch();
            if ( ! $propEnum) return false;

            $props[$arField['CODE']] = array(
                'VALUE' => $propEnum['ID'],
            );
        }
    }

    $res = $el->Add(array(
        'IBLOCK_TYPE' => $arParams['IBLOCK_TYPE'],
        'IBLOCK_ID' => $iblock['ID'],
        'ACTIVE' => 'Y',
        'PROPERTY_VALUES' => $props,
        'ACTIVE_FROM' => ConvertTimeStamp(time()+CTimeZone::GetOffset(), 'FULL'),
        'NAME' => 'Form result', # !!! NEED TO REPLACE TO DEFAULT VALUE
    ));

    if (!$res) {
        return array(
            'MESSAGE' => $el->LAST_ERROR,
        );
    }

    return true;
}
开发者ID:ASDAFF,项目名称:bitrix-advanced-form,代码行数:60,代码来源:store_result.php


示例5: _applyPropertyListTypeValues

 private function _applyPropertyListTypeValues($id, $values)
 {
     $addValues = array();
     $updateValues = array();
     $useValuesIds = array();
     foreach ($values as $value) {
         $value['PROPERTY_ID'] = $id;
         try {
             $value['ID'] = $this->getReferenceController()->getItemCurrentVersionByReference($value['~reference'])->id;
             $useValuesIds[] = $value['ID'];
             $updateValues[] = $value;
         } catch (\Exception $e) {
             $addValues[] = $value;
         }
     }
     $currentValues = PropertyEnumerationTable::getList(array('filter' => array('=PROPERTY_ID' => $id)))->fetchAll();
     foreach ($currentValues as $value) {
         !in_array($value['ID'], $useValuesIds) && PropertyEnumerationTable::delete(array('ID' => $value['ID'], 'PROPERTY_ID' => $value['PROPERTY_ID']));
     }
     foreach ($addValues as $value) {
         unset($value['ID']);
         unset($value['~reference']);
         $enum = new \CIBlockPropertyEnum();
         $enumElementId = $enum->Add($value);
         if (!$enumElementId) {
             throw new \Exception('Add property list value. Property not save. ' . var_export($value, true));
         }
         $result = PropertyEnumerationTable::update(array('ID' => $enumElementId, 'PROPERTY_ID' => $value['PROPERTY_ID']), $value);
         if (!$result->isSuccess()) {
             throw new \Exception('Add property list value in table. Property not save. ' . var_export($result->getErrorMessages(), true));
         }
         $referenceItem = new ReferenceItem();
         $referenceItem->id = $enumElementId;
         $referenceItem->group = ReferenceController::GROUP_IBLOCK_PROPERTY_LIST_VALUES;
         $referenceItem->reference = $value['~reference'];
         $this->getReferenceController()->registerItem($referenceItem);
     }
     foreach ($updateValues as $value) {
         $vId = $value['ID'];
         unset($value['ID']);
         unset($value['~reference']);
         $result = PropertyEnumerationTable::update(array('ID' => $vId, 'PROPERTY_ID' => $value['PROPERTY_ID']), $value);
         if (!$result->isSuccess()) {
             throw new \Exception('Update property list value. Property not save. ' . var_export($result->getErrorMessages(), true));
         }
     }
 }
开发者ID:ASDAFF,项目名称:bitrix-module-migrations,代码行数:47,代码来源:iblockpropertyhandler.php


示例6: getPropertyEnumValueId

/**
 * Тип свойства - список
 * По коду и значению свойства получить id этого значения
 * В случае отсутствия, значение будет создано и будет возвращен его id
 *
 * <code>
 * $propertyCountryValue = getPropertyEnumValueId($IBLOCK_ID, 'COUNTRIES', 'Япония');
 * $be = new CIBlockElement;
 * $be->Add(array(
 *    "ACTIVE" => 'Y',
 *    "IBLOCK_ID" => $IBLOCK_ID,
 *    "NAME" => $name,
 *    "PROPERTY_VALUES" => array(
 *       'COUNTRIES' => $propertyCountryValue,
 *    )
 *  );
 * </code>
 * @param $IBLOCK_ID int id инфоблока, в котором находится данное свойство
 * @param $prop string код свойства
 * @param $value string значение свойства
 * @return bool|int ID значения свойства или false, если не удалось найти свойство с таким кодом или не удалось создать запись с данным значением
 */
function getPropertyEnumValueId($IBLOCK_ID, $prop, $value)
{
    $property = CIBlockProperty::GetByID($prop, $IBLOCK_ID)->Fetch();
    if (!$property) {
        return false;
    }
    $ar_enum_list = CIBlockProperty::GetPropertyEnum($prop, array("SORT" => "asc"), array("IBLOCK_ID" => $IBLOCK_ID, 'VALUE' => $value))->Fetch();
    if (!$ar_enum_list) {
        $ibpenum = new CIBlockPropertyEnum();
        if ($PropID = $ibpenum->Add(array('PROPERTY_ID' => $property['ID'], 'VALUE' => $value))) {
            $ar_enum_list['ID'] = $PropID;
        } else {
            return false;
        }
    }
    return $ar_enum_list['ID'];
}
开发者ID:ASDAFF,项目名称:Bitrix,代码行数:39,代码来源:iblockElementProperties.php


示例7: generateAddCode

 /**
  * Генерация создания
  *
  * generateAddCode
  * @param array $IblockTypeId
  * @return bool|string
  */
 public function generateAddCode($IblockTypeId)
 {
     $iBlock = new \CIBlock();
     $CIblockType = new \CIBlockType();
     $lang = new \CLanguage();
     $return = array();
     $dbIblockType = $CIblockType->GetByID($IblockTypeId);
     if ($arIblockType = $dbIblockType->GetNext()) {
         $Iblock = new \CIBlock();
         $dbIblock = $Iblock->GetList(array(), array('TYPE' => $IblockTypeId, 'CHECK_PERMISSIONS' => 'N'));
         while ($arIblock = $dbIblock->GetNext()) {
             $IblockProperty = new \CIBlockProperty();
             $dbIblockProperty = $IblockProperty->GetList(array(), array('IBLOCK_CODE' => $arIblock['CODE'], 'CHECK_PERMISSIONS' => 'N'));
             while ($arIblockProperty = $dbIblockProperty->GetNext()) {
                 $dbPropertyValues = \CIBlockPropertyEnum::GetList(array(), array("IBLOCK_ID" => $arIblockProperty['IBLOCK_ID'], "CODE" => $arIblockProperty['CODE']));
                 while ($arPropertyValues = $dbPropertyValues->Fetch()) {
                     $arIblockProperty['VALUES'][$arPropertyValues['ID']] = $arPropertyValues;
                 }
                 Helper::unsetFields(array('ID', '~ID', 'IBLOCK_ID', '~IBLOCK_ID'), $arIblockProperty);
                 $arIblockProperty['IBLOCK_CODE'] = $arIblock['CODE'];
                 foreach ($arIblockProperty as $k => $v) {
                     if (strstr($k, "~") || is_null($v)) {
                         unset($arIblockProperty[$k]);
                     }
                 }
                 if (isset($arIblockProperty['LINK_IBLOCK_ID'])) {
                     $res = $iBlock->GetList(array(), array("ID" => $arIblockProperty['LINK_IBLOCK_ID'], 'CHECK_PERMISSIONS' => 'N'));
                     if ($ar_res = $res->GetNext()) {
                         unset($arIblockProperty['LINK_IBLOCK_ID']);
                         $arIblockProperty['LINK_IBLOCK_CODE'] = $ar_res['CODE'];
                     }
                 }
                 $return[] = $this->getMethodContent('Bim\\Db\\Iblock\\IblockPropertyIntegrate', 'Add', array($arIblockProperty));
             }
             foreach ($arIblock as $k => $v) {
                 if (strstr($k, "~") || $k == 'ID') {
                     unset($arIblock[$k]);
                 }
             }
             $return[] = $this->getMethodContent('Bim\\Db\\Iblock\\IblockIntegrate', 'Add', array($arIblock));
         }
         foreach ($arIblockType as $k => $v) {
             if (strstr($k, "~") || is_null($v)) {
                 unset($arIblockType[$k]);
             }
         }
         $rsLang = $lang->GetList($by = "lid", $order = "desc");
         while ($arLang = $rsLang->Fetch()) {
             $arTypeLang = $CIblockType->GetByIDLang($IblockTypeId, $arLang['LID']);
             $arIblockType["LANG"][$arLang['LID']] = array('NAME' => $arTypeLang['NAME'], 'SECTION_NAME' => $arTypeLang['SECTION_NAME'], 'ELEMENT_NAME' => $arTypeLang['ELEMENT_NAME']);
         }
         $return[] = $this->getMethodContent('Bim\\Db\\Iblock\\IblockTypeIntegrate', 'Add', array($arIblockType));
         $return = array_reverse($return);
         return implode(PHP_EOL, $return);
     } else {
         return false;
     }
 }
开发者ID:cjp2600,项目名称:bim-core,代码行数:65,代码来源:IblockType.php


示例8: getItemsFlagsIds

 static function getItemsFlagsIds($code, $iblockId = IBLOCK_CATALOG)
 {
     $flagsIds = array();
     $flagsDb = \CIBlockPropertyEnum::GetList(array('id' => 'asc'), array('IBLOCK_ID' => $iblockId, 'CODE' => $code));
     while ($flags = $flagsDb->GetNext()) {
         $flagsIds[$flags['XML_ID']] = $flags['ID'];
     }
     return $flagsIds;
 }
开发者ID:AlexSmerw,项目名称:domino,代码行数:9,代码来源:Registry.class.php


示例9: getEnumItemList

 /**
  * getEnumItemList
  * @param $iblockId
  * @param $iblockPropId
  * @return array
  */
 private function getEnumItemList($iblockId, $iblockPropId)
 {
     $result = array();
     $propEnumDbRes = \CIBlockPropertyEnum::GetList(array('SORT' => 'ASC'), array('IBLOCK_ID' => $iblockId, 'PROPERTY_ID' => $iblockPropId));
     if ($propEnumDbRes !== false && $propEnumDbRes->SelectedRowsCount()) {
         $index = 0;
         while ($propEnum = $propEnumDbRes->Fetch()) {
             $result[$index] = array('ID' => $index, 'VALUE' => $propEnum['VALUE'], 'XML_ID' => $propEnum['XML_ID'], 'SORT' => $propEnum['SORT'], 'DEF' => $propEnum['DEF']);
             $index++;
         }
     }
     return $result;
 }
开发者ID:cjp2600,项目名称:bim-core,代码行数:19,代码来源:IblockProperty.php


示例10: getById

 /**
  * Возвращает список всех вариантов для указанного свойства
  * @param int $propertyId
  * @return array
  */
 public static function getById($id)
 {
     if (!isset(self::$_items[$id])) {
         if (!\CModule::IncludeModule('iblock')) {
             throw new \bxar\Exception('Iblock module is not installed');
         }
         self::$_items[$id] = array();
         $res = \CIBlockPropertyEnum::GetList(array('SORT' => 'ASC', 'VALUE' => 'ASC'), array('PROPERTY_ID' => $id));
         while ($ob = $res->GetNext()) {
             self::$_items[$id][] = $ob;
         }
     }
     return self::$_items[$id];
 }
开发者ID:marvin255,项目名称:bxar,代码行数:19,代码来源:Enum.php


示例11: addElementReview

function addElementReview($arResult, $ID_SECTION, $IBLOCK_ID)
{
    CModule::IncludeModule('iblock');
    $property_enums = CIBlockPropertyEnum::GetList(array("DEF" => "DESC", "SORT" => "ASC"), array("IBLOCK_ID" => $IBLOCK_ID, "CODE" => "RATING", "VALUE" => $arResult['RATING']));
    while ($rating = $property_enums->GetNext()) {
        $arRating = $rating["ID"];
    }
    $current_date = dateActiveFrom(date('d.m.Y'));
    $NAME = $current_date . ' ' . $arResult['NAME'];
    $arFields = array("ACTIVE" => "N", "IBLOCK_ID" => $IBLOCK_ID, "IBLOCK_SECTION_ID" => $ID_SECTION, "NAME" => $NAME, "DETAIL_TEXT" => "Описание элемента", "PROPERTY_VALUES" => array("NAME" => $arResult['NAME'], "EMAIL" => $arResult['EMAIL'], "RATING" => array('VALUE' => $arRating), "BENEFITS" => $arResult['BENEFITS'], "DISADVANTAGES" => $arResult['DISADVANTAGES'], "COMMENT" => $arResult['COMMENT']));
    $oElement = new CIBlockElement();
    $idElement = $oElement->Add($arFields, false, false, true);
    return $idElement;
}
开发者ID:CheBurashka334,项目名称:zakrepi,代码行数:14,代码来源:add_comment.php


示例12: GetFilterData

 private function GetFilterData($IBLOCK_ID, $arFields = array())
 {
     $filter_name = $this->sk_filter_name;
     global ${$filter_name};
     $arPROPERTIES = array();
     foreach ($arFields as $i => $PROP_ID) {
         $arSort = array();
         $arFilter = array("ACTIVE" => "Y", "IBLOCK_ID" => $IBLOCK_ID);
         if (intval($PROP_ID) > 0) {
             $arFilter["ID"] = $PROP_ID;
         } else {
             $arFilter["CODE"] = $PROP_ID;
         }
         $properties = CIBlockProperty::GetList($arSort, $arFilter);
         while ($prop_fields = $properties->GetNext()) {
             switch ($prop_fields["PROPERTY_TYPE"]) {
                 case "L":
                     $PROP_ENUM_VALUES = array();
                     $arPropSort = array("value" => "asc");
                     $arPropFilter = array("PROPERTY_ID" => $prop_fields["ID"], "IBLOCK_ID" => $IBLOCK_ID);
                     $prop_enums = CIBlockPropertyEnum::GetList($arPropSort, $arPropFilter);
                     while ($enum_fields = $prop_enums->GetNext()) {
                         $PROP_ENUM_VALUES[] = $enum_fields;
                     }
                     $prop_fields["VALUES"] = $PROP_ENUM_VALUES;
                     break;
                 case "E":
                     $PROP_ENUM_VALUES = array();
                     $arPropSort = array("NAME" => "asc");
                     $arPropFilter = array("ACTIVE" => "Y", "IBLOCK_ID" => $prop_fields["LINK_IBLOCK_ID"]);
                     $arSelFields = array("IBLOCK_ID", "ID", "NAME", "PROPERTY_*");
                     $db_vals = CIBlockElement::GetList($arPropSort, $arPropFilter, false, false, $arSelFields);
                     while ($obElement = $db_vals->GetNextElement()) {
                         $tmp = array();
                         $tmp = $obElement->GetFields();
                         $tmp["PROPERTIES"] = $obElement->GetProperties();
                         $PROP_ENUM_VALUES[$tmp["ID"]] = $tmp;
                     }
                     $prop_fields["VALUES"] = $PROP_ENUM_VALUES;
                     break;
             }
             $arPROPERTIES[$prop_fields["ID"]] = $prop_fields;
         }
     }
     // //  print_r( $arPROPERTIES );
     return $arPROPERTIES;
 }
开发者ID:raffiz,项目名称:my_home_tests,代码行数:47,代码来源:interface.php


示例13: getPropertyIblock

	/**
	 * [getPropertyIblock description]
	 * @return array all products on iblock
	 */
	protected function getPropertyIblock(){
		if (!CModule::IncludeModule("iblock")):
			return false;
		endif;
		$properties = CIBlockProperty::GetList(Array("sort"=>"asc", "name"=>"asc"), Array("ACTIVE"=>"Y", "IBLOCK_ID"=>$this->getIblockId()));
		while ($prop_fields = $properties->GetNext())
		{
			if ($prop_fields["PROPERTY_TYPE"] == "L"):
				$property_enums = CIBlockPropertyEnum::GetList(Array("DEF"=>"DESC", "SORT"=>"ASC"), Array("IBLOCK_ID"=>$this->getIblockId(), "CODE"=>$prop_fields["CODE"]));
				while($enum_fields = $property_enums->GetNext())
				{
				  	$prop_fields["ENUM_LIST"][] = $enum_fields;
				}
			endif;
			$arProperties[] = $prop_fields;
		}
		return $arProperties;
	}
开发者ID:akniyev,项目名称:arteva.ru,代码行数:22,代码来源:addProducts.php


示例14: findCode

 function findCode($id, $val)
 {
     if (CModule::IncludeModule("iblock")) {
         $properties = CIBlockProperty::GetList(array("sort" => "asc", "name" => "asc"), array("ACTIVE" => "Y", 'ID' => $id));
         while ($prop_fields = $properties->GetNext()) {
             $temp['CODE'] = $prop_fields['CODE'];
             if ($prop_fields['PROPERTY_TYPE'] == 'L') {
                 $property_enums = CIBlockPropertyEnum::GetList(array("DEF" => "DESC", "SORT" => "ASC"), array("CODE" => $prop_fields['CODE'], 'ID' => $val));
                 while ($enum_fields = $property_enums->GetNext()) {
                     $temp['VALUE'] = $enum_fields["VALUE"];
                 }
             }
         }
         return $temp;
     } else {
         return false;
     }
 }
开发者ID:sharapudinov,项目名称:lovestore.top,代码行数:18,代码来源:functions.php


示例15: GetEditFormHTML

    function GetEditFormHTML($arUserField, $arHtmlControl)
    {
        $return = '';
        if (CModule::IncludeModule("iblock")) {
            $resdb = CIBlockPropertyEnum::GetList(array("SORT" => "ASC", "VALUE" => "ASC"), array("ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_CATALOG, 'PROPERTY_ID' => PROPERTY_ID_TORGOVAYA_MARKA));
            $arPropertyListValue = array();
            while ($res = $resdb->fetch()) {
                $arPropertyListValue[$res['ID']] = $res['VALUE'];
            }
            if (count($arPropertyListValue) > 0) {
                ob_start();
                ?>
	            <select name="<?php 
                echo $arUserField["FIELD_NAME"];
                ?>
">
	                <option value=""></option>
	                <?php 
                foreach ($arPropertyListValue as $ID => $NAME) {
                    ?>
	                    <option value="<?php 
                    echo $ID;
                    ?>
" <?php 
                    if ($ID == $arUserField["VALUE"]) {
                        echo 'selected';
                    }
                    ?>
><?php 
                    echo $NAME;
                    ?>
</option>
	                <?php 
                }
                ?>
	            </select>
	        <?php 
                $return = ob_get_contents();
                ob_end_clean();
            }
        }
        return $return;
    }
开发者ID:VitaliiSestrenskyi,项目名称:sest,代码行数:43,代码来源:AddNewCUserProperty.php


示例16: date

		});
	});
</script>
<?php 
if (date("N", time()) == 1) {
    $monday = date("j.n.Y", strtotime(date("j.n.Y", time()) . " Monday"));
} else {
    $monday = date("j.n.Y", strtotime(date("j.n.Y", time()) . "  last Monday"));
}
$start_date = $_GET["s"] ? $_GET["s"] : $monday;
$end_date = $_GET["e"] ? $_GET["e"] : date("j.n.Y", strtotime(date("j.n.Y", time()) . "  next Sunday"));
$nextWeek = date("j.n.Y", strtotime("1." . date("n.Y", strtotime($start_date))));
$myID = CUser::GetID();
CModule::IncludeModule("iblock");
$arSelect = array("ID", "IBLOCK_ID", "*");
$property_enums = CIBlockPropertyEnum::GetList(array("SORT" => "ASC"), array("IBLOCK_ID" => 2, "XML_ID" => "FOR_USERS"));
while ($enum_fields = $property_enums->GetNext()) {
    $enums_id[] = $enum_fields["ID"];
}
if (empty($_GET["filter"])) {
    if (date("U", strtotime($start_date)) < date("U", strtotime(date("j.n.Y", time())))) {
        $start_date = date("j.n.Y", strtotime(date("j.n.Y", time()) . " Monday"));
    }
    $arFilter = array("IBLOCK_ID" => 2, array("LOGIC" => "OR", array("IBLOCK_ID" => 2, "PROPERTY_ANC_ID" => $myID)), array("LOGIC" => "AND", array(">=PROPERTY_START_DATE" => trim(CDatabase::CharToDateFunction(ConvertTimeStamp(strtotime($start_date), 'FULL')), "\\'")), array("<=PROPERTY_START_DATE" => trim(CDatabase::CharToDateFunction(ConvertTimeStamp(strtotime($end_date), 'FULL')), "\\'"))));
} elseif (substr($_GET["filter"], 0, 4) == "next") {
    $arFilter = array("IBLOCK_ID" => 2, ">=PROPERTY_START_DATE" => trim(CDatabase::CharToDateFunction(ConvertTimeStamp(strtotime($start_date), 'FULL')), "\\'"), "<=PROPERTY_START_DATE" => trim(CDatabase::CharToDateFunction(ConvertTimeStamp(strtotime($end_date), 'FULL')), "\\'"));
} elseif (substr($_GET["filter"], 0, 4) == "prev") {
    $arFilter = array("IBLOCK_ID" => 2, "<=PROPERTY_START_DATE" => trim(CDatabase::CharToDateFunction(ConvertTimeStamp(strtotime($end_date), 'FULL')), "\\'"));
    if (!empty($_GET["s"])) {
        $arFilter[">=PROPERTY_START_DATE"] = trim(CDatabase::CharToDateFunction(ConvertTimeStamp(strtotime($start_date), 'FULL')), "\\'");
    }
开发者ID:dayAlone,项目名称:MyQube,代码行数:31,代码来源:index.php


示例17: explode

                                $category = explode("/", $category[0]);
                            ?>
                            <?
                                $array_empty = array('');
                                $cat = array();
                                $category = array_diff($category, $array_empty);
                                foreach($category as $item):
                                    array_push($cat ,$item);
                                endforeach;
                            ?>
                         <?
                                //$arr = list_category($cat[count($cat)-1]);
                                /*Получаем значение где(в городе /за городом)*/
                                $params = $cat[0];
                                $city = $params;
                                $property_enums = CIBlockPropertyEnum::GetList(Array("DEF"=>"DESC", "SORT"=>"ASC"), Array("IBLOCK_ID"=>2, "XML_ID"=>$params));
                                if($enum_fields = $property_enums->GetNext())
                                
                                global $arrFilter;
                                //echo $params;
                                $arrFilter = Array(
                                //"PROPERTY_category"=>$arr[0]['ID'],
                                "PROPERTY_params_VALUE" => $enum_fields['~VALUE'],
                                );
                                
								$id_cat = '';
								if($cat[count($cat)-1] != 'sportivnye-sekcii-v-surgute')
								{
									$arSelect_cat = Array("ID", "IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM","PREVIEW_TEXT");//IBLOCK_ID и ID обязательно должны быть указаны, см. описание arSelectFields выше
									$arFilter_cat = Array("IBLOCK_ID"=>1, "CODE"=>$cat[count($cat)-1], "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y");
									$res_cat = CIBlockElement::GetList(Array(), $arFilter_cat, false, false, $arSelect_cat);
开发者ID:CheBurashka334,项目名称:crado,代码行数:31,代码来源:list.php


示例18: array

<?php

CModule::IncludeModule("iblock");
if (!empty($_POST['template_color_submit']) && strlen($_POST['template_color_theme']) > 0) {
    $arSelect = array("ID", "IBLOCK_ID", "NAME", "PROPERTY_COLOR");
    $arFilter = array("IBLOCK_CODE" => "color_theme", "CODE" => "template_color_theme");
    $res = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelect);
    while ($ob = $res->GetNextElement()) {
        $arFields = $ob->GetFields();
        $element_id = $arFields['ID'];
        $iblock_id = $arFields['IBLOCK_ID'];
        $arProps = $ob->GetProperties();
    }
    $property_enums = CIBlockPropertyEnum::GetList(array("DEF" => "DESC", "SORT" => "ASC"), array("IBLOCK_ID" => $iblock_id, "CODE" => "COLOR"));
    while ($enum_fields = $property_enums->GetNext()) {
        if ($enum_fields['XML_ID'] == $_POST['template_color_theme']) {
            $property_enum_id = intval($enum_fields['ID']);
        }
    }
    if ($element_id > 0 && $property_enum_id > 0) {
        CIBlockElement::SetPropertyValuesEx($element_id, false, array('COLOR' => $property_enum_id));
    }
}
$arSelect = array("ID", "IBLOCK_ID", "NAME", "PROPERTY_COLOR");
$arFilter = array("IBLOCK_CODE" => "color_theme", "CODE" => "template_color_theme");
$res = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelect);
while ($ob = $res->GetNextElement()) {
    $arProps = $ob->GetProperties();
}
if (strlen($arProps['COLOR']['VALUE_XML_ID']) > 0) {
    $template_color_theme = $arProps['COLOR']['VALUE_XML_ID'];
开发者ID:sharapudinov,项目名称:lovestore.top,代码行数:31,代码来源:colors.php


示例19: array

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("iblock") || WIZARD_INSTALL_DEMO_DATA === false) {
    return;
}
$rsIBlock = CIBlock::GetList(array(), array("CODE" => "absence", "TYPE" => "structure", "SITE_ID" => WIZARD_SITE_ID));
if (!($arIBlock = $rsIBlock->Fetch())) {
    return;
}
$absence_IBLOCK_ID = $arIBlock["ID"];
$arAbsenceTypes = array();
$dbTypeRes = CIBlockPropertyEnum::GetList(array("SORT" => "ASC", "VALUE" => "ASC"), array('IBLOCK_ID' => $absence_IBLOCK_ID, 'PROPERTY_ID' => 'ABSENCE_TYPE'));
while ($arTypeValue = $dbTypeRes->GetNext()) {
    $arAbsenceTypes[$arTypeValue['XML_ID']] = $arTypeValue['ID'];
}
$arAbsenceUsers = array(12, 43, 84, 95, 118, 138, 166, 188, 210, 240, 276, 305, 379, 403);
foreach ($arAbsenceUsers as $absentUserId) {
    $rsUser = CUser::GetByID($absentUserId);
    if (!$rsUser->Fetch()) {
        continue;
    }
    $date_from = mktime() - ($absentUserId - 200) / 10 * 60 * 60 * 24;
    $date_to = $date_from + 30 * 60 * 60 * 24;
    $arAbsenceUser = array("ACTIVE" => "Y", "IBLOCK_ID" => $absence_IBLOCK_ID, "ACTIVE_FROM" => ConvertTimeStamp($date_from), "ACTIVE_TO" => ConvertTimeStamp($date_to), "NAME" => GetMessage('W_IB_ABSENCE_1_NAME'), "PREVIEW_TEXT" => GetMessage('W_IB_ABSENCE_1_PREV1') . date("Y", $date_from) . GetMessage('W_IB_ABSENCE_1_PREV2'), "PREVIEW_TEXT_TYPE" => "text", "PROPERTY_VALUES" => array("USER" => $absentUserId, "STATE" => GetMessage('W_IB_ABSENCE_1_STATE'), "FINISH_STATE" => GetMessage('W_IB_ABSENCE_1_FINISH'), "ABSENCE_TYPE" => $arAbsenceTypes['VACATION']));
    $el = new CIBlockElement();
    $el->Add($arAbsenceUser);
}
// командировка
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:absence.php


示例20: exportElementProperties

 function exportElementProperties($arElement, $PROPERTY_MAP)
 {
     if ($this->bExtended) {
         $this->ExportPropertyValue("CML2_ACTIVE", $arElement["ACTIVE"] == "Y" ? "true" : "false");
         $this->ExportPropertyValue("CML2_CODE", $arElement["CODE"]);
         $this->ExportPropertyValue("CML2_SORT", intval($arElement["SORT"]));
         $this->ExportPropertyValue("CML2_ACTIVE_FROM", CDatabase::FormatDate($arElement["ACTIVE_FROM"], CLang::GetDateFormat("FULL"), "YYYY-MM-DD HH:MI:SS"));
         $this->ExportPropertyValue("CML2_ACTIVE_TO", CDatabase::FormatDate($arElement["ACTIVE_TO"], CLang::GetDateFormat("FULL"), "YYYY-MM-DD HH:MI:SS"));
         $this->ExportPropertyValue("CML2_PREVIEW_TEXT", $arElement["PREVIEW_TEXT"], $arElement["PREVIEW_TEXT_TYPE"]);
         $this->ExportPropertyValue("CML2_DETAIL_TEXT", $arElement["DETAIL_TEXT"], $arElement["DETAIL_TEXT_TYPE"]);
         $this->ExportPropertyValue("CML2_PREVIEW_PICTURE", $this->ExportFile($arElement["PREVIEW_PICTURE"]));
     }
     $arPropOrder = array("sort" => "asc", "id" => "asc", "enum_sort" => "asc", "value_id" => "asc");
     $rsProps = CIBlockElement::GetProperty($this->arIBlock["ID"], $arElement["ID"], $arPropOrder, array("ACTIVE" => "Y"));
     $arProps = array();
     while ($arProp = $rsProps->Fetch()) {
         $pid = $arProp["ID"];
         if (!array_key_exists($pid, $arProps)) {
             $arProps[$pid] = array("PROPERTY_TYPE" => $arProp["PROPERTY_TYPE"], "LINK_IBLOCK_ID" => $arProp["LINK_IBLOCK_ID"], "VALUES" => array());
         }
         if ($arProp["PROPERTY_TYPE"] == "L") {
             $arProps[$pid]["VALUES"][] = array("VALUE" => $arProp["VALUE_ENUM"], "DESCRIPTION" => $arProp["DESCRIPTION"], "VALUE_ENUM_ID" => $arProp["VALUE"]);
         } else {
             $arProps[$pid]["VALUES"][] = array("VALUE" => $arProp["VALUE"], "DESCRIPTION" => $arProp["DESCRIPTION"], "VALUE_ENUM_ID" => $arProp["VALUE_ENUM_ID"]);
         }
     }
     foreach ($arProps as $pid => $arProp) {
         $bEmpty = true;
         if ($this->next_step["catalog"] && !$this->bExtended) {
             fwrite($this->fp, "\t\t\t\t\t<" . GetMessage("I 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CIBlockRights类代码示例发布时间:2022-05-23
下一篇:
PHP CIBlockProperty类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap