本文整理汇总了PHP中CIBlockElement::SetPropertyValuesEx方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockElement::SetPropertyValuesEx方法的具体用法?PHP CIBlockElement::SetPropertyValuesEx怎么用?PHP CIBlockElement::SetPropertyValuesEx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockElement
的用法示例。
在下文中一共展示了CIBlockElement::SetPropertyValuesEx方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnProductCatalogHandler
function OnProductCatalogHandler($ID, $arFields)
{
Bitrix\Main\Loader::includeModule('iblock');
Bitrix\Main\Loader::includeModule('catalog');
define('IBLOCK_ID_PRODUCTS', 2);
define('IBLOCK_ID_OFFERS', 3);
$query = new \Bitrix\Main\Entity\Query(Bitrix\Iblock\ElementTable::getEntity());
$query->setSelect(array("ID", "IBLOCK_ID"))->setFilter(array("ID" => $ID))->setOrder(array("ID" => "ASC"));
$resElement = $query->exec()->fetch();
if ($resElement['IBLOCK_ID'] == IBLOCK_ID_PRODUCTS) {
CIBlockElement::SetPropertyValuesEx($ID, $resElement['IBLOCK_ID'], array("AVAILABLE_QUANTITY_CATALOG" => $arFields['QUANTITY']));
} elseif ($resElement['IBLOCK_ID'] == IBLOCK_ID_OFFERS) {
//1
$rsElementOffer = CIBlockElement::GetList(array(), array("ID" => $ID), false, false, array("ID", "IBLOCK_ID", 'NAME', "PROPERTY_CML2_LINK"))->fetch();
$resElemOfferProduct = (int) $rsElementOffer['PROPERTY_CML2_LINK_VALUE'];
//2
$resOffersCML2 = CIBlockElement::GetList(array(), array("PROPERTY_CML2_LINK" => $resElemOfferProduct, 'IBLOCK_ID' => IBLOCK_ID_OFFERS), false, false, array("ID", "IBLOCK_ID", 'NAME'));
//3
$arrOffersIDs = array();
while ($res = $resOffersCML2->fetch()) {
$arrOffersIDs[] = $res['ID'];
}
//4
$availQuant = array();
foreach ($arrOffersIDs as $k => $v) {
$ar_res_cat = CCatalogProduct::GetList(array("ID" => "DESC"), array("ID" => (int) $v), false, false, array("ID", "QUANTITY", 'ELEMENT_IBLOCK_ID', 'ELEMENT_NAME'))->fetch();
$availQuant[] = $ar_res_cat['QUANTITY'];
}
//5
$minAvailQuant = (int) min($availQuant);
//6
$resUpdateSCU = CIBlockElement::SetPropertyValuesEx($resElemOfferProduct, IBLOCK_ID_PRODUCTS, array("AVAILABLE_QUANTITY_CATALOG" => $minAvailQuant));
}
}
示例2: trackStartedTask
function trackStartedTask($stopStartedTask = true)
{
CModule::IncludeModule('iblock');
$res = CIBlockElement::GetList(array(), array("IBLOCK_ID" => TASKS_IBLOCK_ID, 'ACTIVE' => 'Y', "PROPERTY_PROGRAMMER" => CUser::GetID(), "PROPERTY_STATUS" => STATUS_LIST_WORK), false, false, array('ID', 'NAME', 'PROPERTY_PROJECT', 'PROPERTY_STATUS_DATE'));
if ($taskArr = $res->Fetch()) {
if ($stopStartedTask) {
CIBlockElement::SetPropertyValuesEx($taskArr['ID'], TASKS_IBLOCK_ID, array('STATUS' => STATUS_LIST_PAUSE));
}
$link = TASKS_LIST_URL . $taskArr["PROPERTY_PROJECT_VALUE"] . '/' . $taskArr['ID'] . '/';
$date = new DateTime($taskArr["PROPERTY_STATUS_DATE_VALUE"]);
$curdate = new DateTime();
$diff = $date->diff($curdate);
$h = $diff->format('%h');
$i = $diff->format('%i');
if ($h || $i) {
$timingText = '';
if ($h) {
$timingText = "{$h} ч, ";
}
if ($i) {
$timingText = $timingText . "{$i} мин. ";
}
$decTime = $h + $i / 60;
$decTime = round($decTime, 2);
$el = new CIBlockElement();
if ($el->Add(array("DATE_ACTIVE_FROM" => ConvertTimeStamp(time(), "SHORT"), "MODIFIED_BY" => CUser::GetID(), "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => TRACKING_IBLOCK_ID, "NAME" => 'Без названия' . ' (' . $decTime . 'ч.)', "ACTIVE" => "Y", "PROPERTY_VALUES" => array("HOURS" => $decTime, "TASK" => $taskArr['ID'])))) {
crmEntitiesHelper::recalcTaskTracking($taskArr['ID']);
ToolTip::Add("+ {$timingText} в трекер задачи \"<a target=\"_blank\" href=\"{$link}\">{$taskArr['ID']} {$taskArr['NAME']}</a>\"");
} else {
ToolTip::AddError($el->LAST_ERROR);
}
}
}
}
示例3: updateIBlockProperty
public static function updateIBlockProperty($ID, $TYPE, $arMessage, $arTopic = array())
{
if ($ID > 0 && $arMessage["PARAM1"] != "IB" && IsModuleInstalled("iblock")) {
$arTopic = empty($arTopic) ? CForumTopic::GetByID($arMessage["TOPIC_ID"]) : $arTopic;
if (!empty($arTopic) && $arTopic["XML_ID"] == "IBLOCK_" . $arMessage["PARAM2"] && CModule::IncludeModule("iblock")) {
CIBlockElement::SetPropertyValuesEx($arMessage["PARAM2"], 0, array("FORUM_MESSAGE_CNT" => array("VALUE" => CForumMessage::GetList(array(), array("TOPIC_ID" => $arMessage["TOPIC_ID"], "APPROVED" => "Y", "!PARAM1" => "IB"), true), "DESCRIPTION" => "")));
}
}
}
示例4: reCalculateCommentsCnt
function reCalculateCommentsCnt($itemID)
{
$res = CIBlockElement::GetList(array("DATE_CREATE" => "DESC"), array("PROPERTY_ITEM" => $itemID, "IBLOCK_ID" => COption::GetOptionString('comments', 'iblock'), "ACTIVE" => "Y"), false, false, array('ID', 'IBLOCK_ID'));
while ($ar_fields = $res->GetNext()) {
$n++;
// ай пока что через пень-колоду
}
global $CACHE_MANAGER;
$CACHE_MANAGER->ClearByTag('iblock_id_9');
// абы што
CIBlockElement::SetPropertyValuesEx($itemID, false, array('COMMNETS_CNT' => $n));
}
示例5: UpdateBreedParent
function UpdateBreedParent() {
global $intBlockID, $USER, $intRootSection;
$intAdvertID = intval($_REQUEST['advert_id']);
$intParentMthID = intval($_REQUEST['parent_mth_id']);
$intParentFthID = intval($_REQUEST['parent_fth_id']);
if ($intAdvertID && ($intParentMthID || $intParentFthID)) {
$objE = CIBlockElement::GetList(array(), array('IBLOCK_ID' => $intBlockID, 'ID' => $intAdvertID, 'SECTION_ID' => $intRootSection, 'INCLUDE_SUBSECTIONS' => 'Y', 'ACTIVE' => 'Y'));
if ($arrAdvertA = $objE->GetNext()) {
if (intval($arrAdvertA['IBLOCK_SECTION_ID']) && ($arrAdvertA['CREATED_BY'] == $USER->GetID() || $USER->IsAdmin())) {
// Проапдейтим родителей
if ($intParentMthID) CIBlockElement::SetPropertyValuesEx($intParentMthID, false, array('BREED' => intval($arrAdvertA['IBLOCK_SECTION_ID'])));
if ($intParentFthID) CIBlockElement::SetPropertyValuesEx($intParentFthID, false, array('BREED' => intval($arrAdvertA['IBLOCK_SECTION_ID'])));
}//\\ if
}//\\ if
}//\\ if
}//\\UpdateBreedParent
示例6: foreach
foreach ($arResult["PostToShow"]["GRATS"] as $arGrat) {
if (ToLower($arGrat["XML_ID"]) == ToLower($_POST["GRAT_TYPE"])) {
$arGratFromPOST = $arGrat;
break;
}
}
foreach ($_POST["GRAT"]["U"] as $code) {
if (preg_match('/^U(\\d+)$/', $code, $matches)) {
$arUsersFromPOST[] = $matches[1];
}
}
if ($arGratFromPOST && $arUsersFromPOST) {
$el = new CIBlockElement();
$new_grat_element_id = $el->Add(array("IBLOCK_ID" => $honour_iblock_id, "DATE_ACTIVE_FROM" => ConvertTimeStamp(), "NAME" => str_replace("#GRAT_NAME#", $arGratFromPOST["VALUE"], GetMessage("BLOG_GRAT_IBLOCKELEMENT_NAME"))), false, false);
if ($new_grat_element_id > 0) {
CIBlockElement::SetPropertyValuesEx($new_grat_element_id, $honour_iblock_id, array("USERS" => $arUsersFromPOST, "GRATITUDE" => array("VALUE" => $arGratFromPOST["ID"])));
CBlogPost::Update($newID, array("DETAIL_TEXT_TYPE" => "text", "UF_GRATITUDE" => $new_grat_element_id));
}
}
}
CBlogPostCategory::DeleteByPostID($newID);
foreach ($CATEGORYtmp as $v) {
CBlogPostCategory::Add(array("BLOG_ID" => $arBlog["ID"], "POST_ID" => $newID, "CATEGORY_ID" => $v));
}
$DB->Query("UPDATE b_blog_image SET POST_ID=" . $newID . " WHERE BLOG_ID=" . $arBlog["ID"] . " AND POST_ID=0", true);
$bHasImg = false;
$bHasTag = false;
$bHasProps = false;
$bHasOnlyAll = false;
if (!empty($CATEGORYtmp)) {
$bHasTag = true;
示例7: updateIBlockProperty
public static function updateIBlockProperty($ID, $TYPE, $arMessage)
{
if ($ID > 0 && $arMessage["PARAM1"] != "IB" && !empty($arMessage["PARAM2"]) && CModule::IncludeModule("iblock")) {
CIBlockElement::SetPropertyValuesEx($arMessage["PARAM2"], 0, array("FORUM_MESSAGE_CNT" => array("VALUE" => CForumMessage::GetList(array(), array("TOPIC_ID" => $arMessage["TOPIC_ID"], "APPROVED" => "Y", "!PARAM1" => "IB"), true), "DESCRIPTION" => "")));
}
}
示例8: insertRow
/**
* Insert database row
*
* @param $fields
* @return mixed
*/
protected function insertRow($fields)
{
$bxIb = new \CIBlockElement();
$fields['IBLOCK_ID'] = $this->iblockId();
$res = $bxIb->Add($fields);
if (!$res) {
throw new SaveException($bxIb->LAST_ERROR);
}
if ($this->fileProperties) {
foreach ($this->fileProperties ?: array() as $propertyName) {
$this->applyFilesToRow($propertyName, $fields[$propertyName], $res);
unset($fields[$propertyName]);
}
}
\CIBlockElement::SetPropertyValuesEx($res, $this->iblockId(), $fields);
return $res;
}
示例9: InviteGuests
//.........这里部分代码省略.........
if ($res !== true) {
return $this->ThrowError(strlen($res) > 0 ? $res : GetMessage('EC_EVENT_DEL_ERROR'));
}
$arDeletedUsers[] = $arOldEvent["ID"];
if ($arOldEvent["PROPERTY_VALUES"]["CONFIRMED"] != "N") {
// Send message
CEventCalendar::SendInvitationMessage(array('type' => "cancel", 'email' => $arOldEvent["CREATED_BY"]["EMAIL"], 'name' => $arOldEvent['NAME'], "from" => $arOldEvent["ACTIVE_FROM"], "to" => $arOldEvent["ACTIVE_TO"], "desc" => $arOldEvent['DETAIL_TEXT'], "pathToUserCalendar" => $pathToUserCalendar, "guestId" => $guest_id, "guestName" => $arOldEvent["CREATED_BY"]["FULL_NAME"], "userId" => $userId, "ownerName" => $ownerName));
}
}
}
// Update info
if (count($arUpdGuests) > 0) {
$arCalendarEventProps = $arCalendarEvent["PROPERTY_VALUES"];
unset($arCalendarEvent["PROPERTY_VALUES"]);
//Check if we have to update child events
foreach ($arUpdGuests as $guest_id => $arOldEvent) {
if ($guest_id == $userId && $this->ownerType == 'USER') {
continue;
}
$bReinvite = false;
$bCH_from = CEventCalendar::TrimTime($arOldEvent["ACTIVE_FROM"]) != CEventCalendar::TrimTime($arCalendarEvent["ACTIVE_FROM"]);
$bCH_to = CEventCalendar::TrimTime($arOldEvent["ACTIVE_TO"]) != CEventCalendar::TrimTime($arCalendarEvent["ACTIVE_TO"]);
$bTimeChanged = $bCH_from || $bCH_to;
$bCH_name = $arOldEvent["NAME"] != $arCalendarEvent["NAME"];
$bCH_desc = $arOldEvent["DETAIL_TEXT"] != $arCalendarEvent["DETAIL_TEXT"];
$bFieldsChanged = $bCH_name || $bCH_desc;
$bCH_loc = $arOldEvent["PROPERTY_VALUES"]["LOCATION"] != $arCalendarEventProps["LOCATION"];
$bCH_repeat = $arOldEvent["PROPERTY_VALUES"]["PERIOD_TYPE"] != $arCalendarEventProps["PERIOD_TYPE"] || $arOldEvent["PROPERTY_VALUES"]["PERIOD_COUNT"] != $arCalendarEventProps["PERIOD_COUNT"] || $arOldEvent["PROPERTY_VALUES"]["EVENT_LENGTH"] != $arCalendarEventProps["EVENT_LENGTH"] || $arOldEvent["PROPERTY_VALUES"]["PERIOD_ADDITIONAL"] != $arCalendarEventProps["PERIOD_ADDITIONAL"];
$bCH_imp = $arOldEvent["PROPERTY_VALUES"]["IMPORTANCE"] != $arCalendarEventProps["IMPORTANCE"];
$bCH_meettxt = $arOldEvent["PROPERTY_VALUES"]["MEETING_TEXT"] != $arCalendarEventProps["MEETING_TEXT"]['VALUE']['TEXT'];
$bPropertyChanged = $bCH_repeat || $bCH_loc || $bCH_meettxt || $bCH_imp;
if (count($arParams['reinviteParamsList']) > 0) {
$bReinvite = in_array('name', $arParams['reinviteParamsList']) && $bCH_name;
if (!$bReinvite) {
$bReinvite = in_array('desc', $arParams['reinviteParamsList']) && $bCH_desc;
}
if (!$bReinvite) {
$bReinvite = in_array('from', $arParams['reinviteParamsList']) && $bCH_from;
}
if (!$bReinvite) {
$bReinvite = in_array('to', $arParams['reinviteParamsList']) && $bCH_to;
}
if (!$bReinvite) {
$bReinvite = in_array('location', $arParams['reinviteParamsList']) && $bCH_loc;
}
if (!$bReinvite) {
$bReinvite = in_array('guest_list', $arParams['reinviteParamsList']) && (count($arDeletedUsers) > 0 || count($arNewGuests) > 0);
}
if (!$bReinvite) {
$bReinvite = in_array('repeating', $arParams['reinviteParamsList']) && $bCH_repeat;
}
if (!$bReinvite) {
$bReinvite = in_array('importance', $arParams['reinviteParamsList']) && $bCH_imp;
}
if (!$bReinvite) {
$bReinvite = in_array('meet_text', $arParams['reinviteParamsList']) && $bCH_meettxt;
}
}
if ($bTimeChanged || $bFieldsChanged || $bPropertyChanged) {
if ($guest_id != $userId) {
if ($bReinvite) {
$arCalendarEventProps["CONFIRMED"] = CEventCalendar::GetConfirmedID($iblockId, "Q");
$arGuestConfirm[$guest_id] = 'Q';
}
$arFields = array("ACTIVE_FROM" => $arCalendarEvent["ACTIVE_FROM"], "ACTIVE_TO" => $arCalendarEvent["ACTIVE_TO"], "NAME" => $arCalendarEvent["NAME"], "DETAIL_TEXT" => $arCalendarEvent["DETAIL_TEXT"], "DETAIL_TEXT_TYPE" => 'html');
// If it's EXCHANGE - we try to save event to exchange
if ($bExchange) {
foreach ($arCalendarEventProps as $prKey => $prVal) {
$arFields["PROPERTY_" . $prKey] = $prVal;
}
$calendarXmlId = CECCalendar::GetExchangeXmlId($arOldEvent["IBLOCK_ID"], $arOldEvent['IBLOCK_SECTION_ID']);
if (strlen($calendarXmlId) > 0 && $calendarXmlId !== 0) {
$eventModLabel = CECEvent::GetExchModLabel($arOldEvent["IBLOCK_ID"], $arOldEvent["ID"]);
$eventXmlId = CECEvent::GetExchangeXmlId($arOldEvent["IBLOCK_ID"], $arOldEvent["ID"]);
$exchRes = CDavExchangeCalendar::DoUpdateItem($guest_id, $eventXmlId, $eventModLabel, $arFields);
if (!is_array($exchRes) || !array_key_exists("XML_ID", $exchRes)) {
return CEventCalendar::ThrowError(CEventCalendar::CollectExchangeErros($exchRes));
}
// It's ok, we successfuly save event to exchange calendar - and save it to DB
$arFields['XML_ID'] = $exchRes['XML_ID'];
//$arFields['PROPERTY_VALUES']['BXDAVEX_LABEL'] = $exchRes['MODIFICATION_LABEL'];
$arCalendarEventProps['BXDAVEX_LABEL'] = $exchRes['MODIFICATION_LABEL'];
}
}
$obElement = new CIBlockElement();
$obElement->SetPropertyValuesEx($arOldEvent["ID"], $arOldEvent["IBLOCK_ID"], $arCalendarEventProps, array("DoNotValidateLists" => true));
if ($bTimeChanged || $bFieldsChanged) {
$obElement->Update($arOldEvent["ID"], $arFields, false);
}
}
// Send message
if ($guest_id != $userId) {
CEventCalendar::SendInvitationMessage(array('type' => "change", 'email' => $arOldEvent["CREATED_BY"]["EMAIL"], 'name' => $arOldEvent['NAME'], "from" => $arOldEvent["ACTIVE_FROM"], "to" => $arOldEvent["ACTIVE_TO"], "location" => $loc, "meetingText" => $arParams['meetingText'], "pathToUserCalendar" => $pathToUserCalendar, "guestId" => $guest_id, "guestName" => $arOldEvent["CREATED_BY"]["FULL_NAME"], "userId" => $userId, "eventId" => $arOldEvent["ID"], "ownerName" => $ownerName));
}
}
}
}
$this->ClearCache($this->cachePath . 'events/' . $iblockId . '/');
return $arGuestConfirm;
}
示例10: switch
if (!$bPermissions) {
$lAdmin->AddGroupError(GetMessage("IBEL_A_UPDERR3") . " (ID:" . $ID . ")", $ID);
continue;
}
switch ($_REQUEST['action']) {
case "properties":
$arUpdate = array();
foreach($fields as $code => $field) {
if($_REQUEST[$code]) {
$arUpdate[$code] = $_REQUEST[$code];
}
}
foreach ($props as $prop) {
if($_REQUEST['props'][$prop["ID"]]) {
CIBlockElement::SetPropertyValuesEx($ID, $IBLOCK_ID, array($prop["ID"] => $_REQUEST['props'][$prop["ID"]]));
}
}
if($bCatalog && $_REQUEST['base_price_multiplier'] && isset($_REQUEST['base_price_add']) ) {
$arr = CPrice::GetBasePrice($ID);
$price = $arr["PRICE"];
$price = $price * $_REQUEST['base_price_multiplier'];
$price = $price + $_REQUEST['base_price_add'];
CPrice::SetBasePrice($ID, $price, $arr["CURRENCY"]);
}
if(count($arUpdate)) {
$el = new CIBlockElement;
$el->Update($ID, $arUpdate);
}
break;
case "delete":
示例11: OnPayads
/**
* @param $id ID заказа
* @param $val статус оплаты Y или N
* функция после подтверждения оплаты
* изменяет статус объявления на VIP
*/
function OnPayads($id,$val)
{
// Если оплата Y
if($val == 'Y')
{
//SendEmailPartnerByOrder($id, "SALE_ORDER_PAIDPARTNER");
$dbBasketItems = CSaleBasket::GetList(
array("PRICE" => "DESC"),
array(
"ORDER_ID" => $id
),
false,
false,
array("ID", "NAME")
);
while ($arBasketItems = $dbBasketItems->Fetch())
{
$dbProp = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "ASC"), array("BASKET_ID" => $arBasketItems["ID"]));
if($arProp = $dbProp -> GetNext())
{
$dbProp = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "ASC"), array("BASKET_ID" => $arBasketItems["ID"]));
if($arProp = $dbProp -> GetNext())
{
if($arProp['CODE']=='TEST_VIP'){
$status_true=true;
$ELEMENT_ID = intval($arProp['VALUE']);
$PROPERTY_CODE = "VIPORDERCHECK";
$PROPERTY_VALUE = "Y";
if (CModule::IncludeModule("iblock"))
CIBlockElement::SetPropertyValuesEx($ELEMENT_ID, false, array($PROPERTY_CODE => $PROPERTY_VALUE));
}
if($arProp['CODE']=='TEST_ADSUP'){
$status_true=true;
$ELEMENT_ID = intval($arProp['VALUE']);
$PROPERTY_CODE = "ADSUP";
$PROPERTY_VALUE = "Y";
if (CModule::IncludeModule("iblock")){
//CIBlockElement::SetPropertyValuesEx($ELEMENT_ID, false, array($PROPERTY_CODE => $PROPERTY_VALUE));
$el = new CIBlockElement;
$el->Update($ELEMENT_ID, Array('TIMESTAMP_X' => true,"ACTIVE_FROM"=>date("d.m.Y H:i:s")));
}
}
}
}
}
if($status_true){
CSaleOrder::StatusOrder($id, "Y");
}else{
CSaleOrder::StatusOrder($id, "P");
}
}
}
示例12: GetIBlockSectionPath
$rsPath = GetIBlockSectionPath($arFields["IBLOCK_ID"], $arFields["IBLOCK_SECTION_ID"]);
while ($arPath = $rsPath->GetNext()) {
$arrPath[] = array("ID" => $arPath["ID"], "NAME" => $arPath["NAME"]);
}
$res = CIBlockElement::GetProperty($arFields["IBLOCK_ID"], $arFields["ID"], array(), array("ID" => $prop_id));
$update = 0;
$arRes = array();
while ($arRes = $res->GetNext()) {
if ($arRes["VALUE"] != $arrPath[0]["NAME"]) {
$update = 1;
}
}
if ($update > 0) {
$arUpdateProps[$prop_id] = 2985;
if (count($arUpdateProps) > 0) {
CIBlockElement::SetPropertyValuesEx($arFields["ID"], $arFields["IBLOCK_ID"], $arUpdateProps);
}
}
}
}
$lastID = intval($arFields["ID"]);
}
$rsLeftBorder = CIBlockElement::GetList(array("ID" => "ASC"), array("IBLOCK_ID" => $BID, "<=ID" => $lastID));
$leftBorderCnt = $rsLeftBorder->SelectedRowsCount();
$rsAll = CIBlockElement::GetList(array("ID" => "ASC"), array("IBLOCK_ID" => $BID));
$allCnt = $rsAll->SelectedRowsCount();
$p = round(100 * $leftBorderCnt / $allCnt, 2);
echo 'CurrentStatus = Array(' . $p . ',"' . ($p < 100 ? '&lastid=' . $lastID : '') . '","Обрабатываю запись с ID #' . $lastID . '");';
die;
}
$clean_test_table = '<table id="result_table" cellpadding="0" cellspacing="0" border="0" width="100%" class="internal">' . '<tr class="heading">' . '<td>Текущее действие</td>' . '<td width="1%"> </td>' . '</tr>' . '</table>';
示例13: array
$ibprop->Update($arProperty["THEME"], $arFields);
if ($lang == 'ru') {
$arThemeElement = array("277" => array("254", "253"), "256" => array("259", "258", "255"));
} elseif ($lang == 'en') {
$arThemeElement = array("161" => array("1", "8", "92"), "163" => array("169", "88", "89", "93"));
} elseif ($lang == 'de') {
$arThemeElement = array("161" => array("35", "88", "77"), "163" => array("38", "83", "82", "166"));
}
foreach ($arThemeElement as $ThemeID => $ThemeElements) {
$rsElemetTheme = CIBlockElement::GetList(array("show_counter" => "desc"), array("XML_ID" => $ThemeID, "IBLOCK_ID" => $iblockIDTheme));
if ($arElemetTheme = $rsElemetTheme->Fetch()) {
$elementIDTheme = $arElemetTheme["ID"];
foreach ($ThemeElements as $ElementID) {
$rsElemet = CIBlockElement::GetList(array("show_counter" => "desc"), array("XML_ID" => $ElementID, "IBLOCK_ID" => $iblockID), false, false, array("ID"));
if ($arElemet = $rsElemet->Fetch()) {
CIBlockElement::SetPropertyValuesEx($arElemet["ID"], $iblockID, array("THEME" => $elementIDTheme));
}
}
}
}
}
$arProperty = array();
$dbProperty = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $iblockID));
while ($arProp = $dbProperty->Fetch()) {
$arProperty[$arProp["CODE"]] = $arProp["ID"];
}
WizardServices::IncludeServiceLang("news.php", $lang);
CUserOptions::SetOption("form", "form_element_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_NEWS_1") . '--,--ACTIVE_FROM--#--' . GetMessage("WZD_OPTION_NEWS_3") . '--,--NAME--#--' . GetMessage("WZD_OPTION_NEWS_5") . '--,--CODE--#--' . GetMessage("WZD_OPTION_NEWS_11") . '--,--PREVIEW_PICTURE--#--' . GetMessage("WZD_OPTION_NEWS_4") . '--,--PROPERTY_' . $arProperty['MAIN'] . '--#--' . GetMessage("WZD_OPTION_NEWS_9") . '--,--PROPERTY_' . $arProperty['PARTMAIN'] . '--#--' . GetMessage("WZD_OPTION_NEWS_8") . '--,--PROPERTY_' . $arProperty['LINK_SOURCE'] . '--#--' . GetMessage("WZD_OPTION_NEWS_6") . '--,--PROPERTY_' . $arProperty['THEME'] . '--#--' . GetMessage("WZD_OPTION_NEWS_7") . '--,--PREVIEW_TEXT--#--' . GetMessage("WZD_OPTION_NEWS_15") . '--,--DETAIL_TEXT--#--' . GetMessage("WZD_OPTION_NEWS_10") . '--,--SECTIONS--#--' . GetMessage("WZD_OPTION_NEWS_13") . '--;--'));
CUserOptions::SetOption("list", "tbl_iblock_list_" . md5($iblockType . "." . $iblockID), array('columns' => 'NAME,ACTIVE,DATE_ACTIVE_FROM', 'by' => 'timestamp_x', 'order' => 'desc', 'page_size' => '20'));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/news/index.php", array("NEWS_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/themes/index.php", array("NEWS_IBLOCK_ID" => $iblockID));
示例14: array
CIBlockElement::SetPropertyValuesEx(intval($elementId), IBLOCK_CATALOGUE, array("C_TO_EDIT_FLAG" => 809));
// Ответственный контент-менеджер
CIBlockElement::SetPropertyValuesEx(intval($elementId), IBLOCK_CATALOGUE, array("C_MANAGER" => intval($_GET["set-content-manager"])));
// Комментарий к доработкам
CIBlockElement::SetPropertyValuesEx(intval($elementId), IBLOCK_CATALOGUE, array("C_COMMENT" => $_GET["to-edit-comment"]));
}
echo '<p class="success-text">Отправлено на редактирование позиций: '.count($_GET["check"]).'<br />Ответственный: '.$arUsersAll[$_GET["set-content-manager"]].'</p>';
}
}
// Если кликнули Принять (снять галочку «на доработку»)
if (isset($_GET["add-to-completed"]) && !empty($_GET["add-to-completed"]))
{
if (empty($_GET["check"]))
{
echo '<p class="warning-text">Необходимо выбрать позиции к принятию</p>';
}
else
{
// Для каждого элеметна установим флаг отправки на редактирование и назначим ответственного
foreach ($_GET["check"] as $elementId)
{
// Галочка на редактирование
CIBlockElement::SetPropertyValuesEx(intval($elementId), IBLOCK_CATALOGUE, array("C_TO_EDIT_FLAG" => false));
}
echo '<p class="success-text">Принято позиций: '.count($_GET["check"]).'</p>';
}
}
?>
示例15: CUser
$user = new CUser();
$password = randString(7);
$arFields = array("NAME" => $arFileds["first_name"], "LAST_NAME" => $arFileds["last_name"], "EMAIL" => $arFileds["email"], "LOGIN" => $arFileds["email"], "PERSONAL_BIRTHDAY" => str_replace("/", ".", $arFileds["birthday"]), "LID" => "ru", "ACTIVE" => "Y", "PASSWORD" => $password, "CONFIRM_PASSWORD" => $password, "PERSONAL_PHOTO" => CFile::MakeFileArray("http://graph.facebook.com/" . $arFileds["id"] . "/picture?type=large"));
$ID = $user->Add($arFields);
}
}
// Тут пользователь должен быть полюбому
// Авторизуем его
$userRes = new CUser();
$userRes->Authorize($ID);
}
//Получаем друзей пользователя Фэйсбука
$fUrl = "https://graph.facebook.com/me/friends?access_token={$fb_token}";
$fResponse = file_get_contents($fUrl);
$FriendsData = json_decode($fResponse);
$FriendsDataSerialized = serialize($FriendsData);
$ob = CIBlockElement::GetList(array("SORT" => "ASC"), array("PROPERTY_USER" => $USER::GetId(), "IBLOCK_ID" => IB_USER_PROPS), FALSE, FALSE, array("ID", "PROPERTY_USER", "PROPERTY_LINK_NEWS", "PROPERTY_LINK_EVENT", "PROPERTY_LINK_STOK"))->Fetch();
if ($ob) {
CIBlockElement::SetPropertyValuesEx(intval($ob["ID"]), IB_USER_PROPS, array("TOKEN_FACEBOOK" => $fb_token, "FRIENDS_FACEBOOK" => $FriendsDataSerialized, "ID_FACEBOOK" => $arFileds["id"]));
if ($_GET['r']) {
$path = base64_decode($_GET['r']);
header('Location: ' . $path);
exit;
}
}
LocalRedirect("/personal/");
}
if ($_GET['error']) {
LocalRedirect($_SESSION['SOC_SERV_ATTACH_REDIRECT_PAGE']);
}
//LocalRedirect("/personal/safety/?vk=ok");