本文整理汇总了PHP中CheckSerializedData函数的典型用法代码示例。如果您正苦于以下问题:PHP CheckSerializedData函数的具体用法?PHP CheckSerializedData怎么用?PHP CheckSerializedData使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CheckSerializedData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetPropertyInfo
function GetPropertyInfo($strPrefix, $ID, $boolUnpack = true, $arHiddenPropFields = array())
{
global $arDefPropInfo;
$boolUnpack = true == $boolUnpack ? true : false;
$arResult = false;
if (!is_array($arHiddenPropFields)) {
return $arResult;
}
if (isset($_POST[$strPrefix . $ID . '_NAME']) && 0 < strlen($_POST[$strPrefix . $ID . '_NAME']) && isset($_POST[$strPrefix . $ID . '_PROPINFO'])) {
$strEncodePropInfo = $_POST[$strPrefix . $ID . '_PROPINFO'];
$strPropInfo = base64_decode($strEncodePropInfo);
if (CheckSerializedData($strPropInfo)) {
$arResult = array('ID' => isset($_POST[$strPrefix . $ID . '_ID']) && 0 < intval($_POST[$strPrefix . $ID . '_ID']) ? intval($_POST[$strPrefix . $ID . '_ID']) : 0, 'NAME' => strval($_POST[$strPrefix . $ID . "_NAME"]), 'SORT' => 0 < intval($_POST[$strPrefix . $ID . "_SORT"]) ? intval($_POST[$strPrefix . $ID . "_SORT"]) : 500, 'CODE' => isset($_POST[$strPrefix . $ID . "_CODE"]) ? strval($_POST[$strPrefix . $ID . "_CODE"]) : '', 'MULTIPLE' => isset($_POST[$strPrefix . $ID . "_MULTIPLE"]) && 'Y' == $_POST[$strPrefix . $ID . "_MULTIPLE"] ? 'Y' : 'N', 'IS_REQUIRED' => isset($_POST[$strPrefix . $ID . "_IS_REQUIRED"]) && 'Y' == $_POST[$strPrefix . $ID . "_IS_REQUIRED"] ? 'Y' : 'N', 'ACTIVE' => isset($_POST[$strPrefix . $ID . "_ACTIVE"]) && 'Y' == $_POST[$strPrefix . $ID . "_ACTIVE"] ? 'Y' : 'N', 'USER_TYPE' => false);
if (isset($_POST[$strPrefix . $ID . "_PROPERTY_TYPE"])) {
if (false !== strpos($_POST[$strPrefix . $ID . "_PROPERTY_TYPE"], ":")) {
list($arResult["PROPERTY_TYPE"], $arResult["USER_TYPE"]) = explode(':', $_POST[$strPrefix . $ID . "_PROPERTY_TYPE"], 2);
} else {
$arResult["PROPERTY_TYPE"] = $_POST[$strPrefix . $ID . "_PROPERTY_TYPE"];
}
}
if ($boolUnpack) {
$arPropInfo = unserialize($strPropInfo);
foreach ($arHiddenPropFields as &$strFieldKey) {
$arResult[$strFieldKey] = isset($arPropInfo[$strFieldKey]) ? $arPropInfo[$strFieldKey] : $arDefPropInfo[$strFieldKey];
}
$arResult['ROW_COUNT'] = intval($arResult['ROW_COUNT']);
if (0 >= $arResult['ROW_COUNT']) {
$arResult['ROW_COUNT'] = $arDefPropInfo['ROW_COUNT'];
}
$arResult['COL_COUNT'] = intval($arResult['COL_COUNT']);
if (0 >= $arResult['COL_COUNT']) {
$arResult['COL_COUNT'] = $arDefPropInfo['COL_COUNT'];
}
$arResult['LINK_IBLOCK_ID'] = intval($arResult['LINK_IBLOCK_ID']);
if (0 > $arResult['LINK_IBLOCK_ID']) {
$arResult['LINK_IBLOCK_ID'] = $arDefPropInfo['LINK_IBLOCK_ID'];
}
$arResult['WITH_DESCRIPTION'] = 'Y' == $arResult['WITH_DESCRIPTION'] ? 'Y' : 'N';
$arResult['FILTRABLE'] = 'Y' == $arResult['FILTRABLE'] ? 'Y' : 'N';
$arResult['SEARCHABLE'] = 'Y' == $arResult['SEARCHABLE'] ? 'Y' : 'N';
$arResult['SECTION_PROPERTY'] = 'N' == $arResult['SECTION_PROPERTY'] ? 'N' : 'Y';
$arResult['SMART_FILTER'] = 'Y' == $arResult['SMART_FILTER'] ? 'Y' : 'N';
$arResult['MULTIPLE_CNT'] = intval($arResult['MULTIPLE_CNT']);
if (0 >= $arResult['MULTIPLE_CNT']) {
$arResult['MULTIPLE_CNT'] = $arDefPropInfo['MULTIPLE_CNT'];
}
$arResult['LIST_TYPE'] = 'C' == $arResult['LIST_TYPE'] ? 'C' : 'L';
if ('Y' != COption::GetOptionString("iblock", "show_xml_id", "N") && isset($arResult["XML_ID"])) {
unset($arResult["XML_ID"]);
}
} else {
$arResult['PROPINFO'] = $strEncodePropInfo;
}
if (0 < intval($ID)) {
$arResult['DEL'] = isset($_POST[$strPrefix . $ID . "_DEL"]) && 'Y' == $_POST[$strPrefix . $ID . "_DEL"] ? 'Y' : 'N';
}
}
}
return $arResult;
}
示例2: modifyValueForFetch
public static function modifyValueForFetch($value, $query, $property, $alias)
{
if (strlen($value)) {
if (CheckSerializedData($value) && ($v = @unserialize($value)) !== false) {
$value = $v;
} elseif ($property['MULTIPLE'] == 'Y') {
switch ($property['TYPE']) {
case 'ENUM':
$value = explode(',', $value);
break;
case 'FILE':
$value = explode(', ', $value);
break;
}
}
}
return $value;
}
示例3: array
if (!$bFullForm) {
$arProperty = array();
$PROPERTY = $_POST['PROP'];
$PARAMS = $_POST['PARAMS'];
if (isset($PARAMS['TITLE']) && '' != $PARAMS['TITLE']) {
$APPLICATION->SetTitle($PARAMS['TITLE']);
}
$arFieldsList = $DB->GetTableFieldsList("b_iblock_property");
foreach ($arFieldsList as $strFieldName) {
if (!in_array($strFieldName, $arDisabledPropFields)) {
$arProperty[$strFieldName] = isset($PROPERTY[$strFieldName]) ? htmlspecialcharsback($PROPERTY[$strFieldName]) : '';
}
}
$arProperty['PROPINFO'] = $PROPERTY['PROPINFO'];
$arProperty['PROPINFO'] = base64_decode($arProperty['PROPINFO']);
if (CheckSerializedData($arProperty['PROPINFO'])) {
$arTempo = unserialize($arProperty['PROPINFO']);
if (is_array($arTempo)) {
foreach ($arTempo as $k => $v) {
$arProperty[$k] = $v;
}
}
unset($arTempo);
unset($arProperty['PROPINFO']);
}
$arProperty['MULTIPLE'] = 'Y' == $arProperty['MULTIPLE'] ? 'Y' : 'N';
$arProperty['IS_REQUIRED'] = 'Y' == $arProperty['IS_REQUIRED'] ? 'Y' : 'N';
$arProperty['FILTRABLE'] = 'Y' == $arProperty['FILTRABLE'] ? 'Y' : 'N';
$arProperty['SEARCHABLE'] = 'Y' == $arProperty['SEARCHABLE'] ? 'Y' : 'N';
$arProperty['ACTIVE'] = 'Y' == $arProperty['ACTIVE'] ? 'Y' : 'N';
$arProperty['SECTION_PROPERTY'] = 'N' == $arProperty['SECTION_PROPERTY'] ? 'N' : 'Y';
示例4: foreach
foreach ($arTypesConfig[$key] as $value) {
$arTempo[$value] = '';
}
$arTypeValues[$key] = $arTempo;
}
$arAddParams = array();
$params = array('PARAMS' => array());
$PRICE = 0;
$CURRENCY = array();
$arSKUExport = array('SKU_URL_TEMPLATE_TYPE' => YANDEX_SKU_TEMPLATE_PRODUCT, 'SKU_URL_TEMPLATE' => '', 'SKU_EXPORT_COND' => 0, 'SKU_PROP_COND' => array('PROP_ID' => 0, 'COND' => '', 'VALUES' => array()));
$arXmlData = array();
if (isset($_REQUEST['XML_DATA'])) {
$strXmlData = '';
if ('' != $_REQUEST['XML_DATA']) {
$strXmlData = base64_decode($_REQUEST['XML_DATA']);
if (true == CheckSerializedData($strXmlData)) {
$arXmlData = unserialize($strXmlData);
}
}
}
if (isset($arXmlData['PRICE'])) {
$PRICE = intval($arXmlData['PRICE']);
}
if (isset($arXmlData['CURRENCY'])) {
$CURRENCY = $arXmlData['CURRENCY'];
}
if (isset($arXmlData['TYPE'])) {
$type = $arXmlData['TYPE'];
}
if ($type != 'none' && !in_array($type, $arTypesConfigKeys)) {
$type = 'none';
示例5: ImportTemplate
public static function ImportTemplate($id, $documentType, $autoExecute, $name, $description, $datum, $systemCode = null, $systemImport = false)
{
$id = intval($id);
if ($id <= 0) {
$id = 0;
}
$datumTmp = CheckSerializedData($datum) ? @unserialize($datum) : null;
if (!is_array($datumTmp) || is_array($datumTmp) && !array_key_exists("TEMPLATE", $datumTmp)) {
if (function_exists("gzcompress")) {
$datumTmp = @gzuncompress($datum);
$datumTmp = CheckSerializedData($datumTmp) ? @unserialize($datumTmp) : null;
}
}
if (!is_array($datumTmp) || is_array($datumTmp) && !array_key_exists("TEMPLATE", $datumTmp)) {
throw new Exception(GetMessage("BPCGWTL_WRONG_TEMPLATE"));
}
if (array_key_exists("VERSION", $datumTmp) && $datumTmp["VERSION"] == 2) {
$datumTmp["TEMPLATE"] = self::ConvertArrayCharset($datumTmp["TEMPLATE"], BP_EI_DIRECTION_IMPORT);
$datumTmp["PARAMETERS"] = self::ConvertArrayCharset($datumTmp["PARAMETERS"], BP_EI_DIRECTION_IMPORT);
$datumTmp["VARIABLES"] = self::ConvertArrayCharset($datumTmp["VARIABLES"], BP_EI_DIRECTION_IMPORT);
$datumTmp["CONSTANTS"] = isset($datumTmp["CONSTANTS"]) ? self::ConvertArrayCharset($datumTmp["CONSTANTS"], BP_EI_DIRECTION_IMPORT) : array();
$datumTmp["DOCUMENT_FIELDS"] = self::ConvertArrayCharset($datumTmp["DOCUMENT_FIELDS"], BP_EI_DIRECTION_IMPORT);
}
if (!$systemImport) {
if (!self::WalkThroughWorkflowTemplate($datumTmp["TEMPLATE"], array("CBPWorkflowTemplateLoader", "ImportTemplateChecker"), new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser))) {
return false;
}
} elseif ($id > 0 && !empty($datumTmp["CONSTANTS"])) {
$userConstants = self::getTemplateConstants($id);
if (!empty($userConstants)) {
foreach ($userConstants as $constantName => $constantData) {
if (isset($datumTmp["CONSTANTS"][$constantName])) {
$datumTmp["CONSTANTS"][$constantName]['Default'] = $constantData['Default'];
}
}
}
}
$templateData = array("DOCUMENT_TYPE" => $documentType, "AUTO_EXECUTE" => $autoExecute, "NAME" => $name, "DESCRIPTION" => $description, "TEMPLATE" => $datumTmp["TEMPLATE"], "PARAMETERS" => $datumTmp["PARAMETERS"], "VARIABLES" => $datumTmp["VARIABLES"], "CONSTANTS" => $datumTmp["CONSTANTS"], "USER_ID" => $systemImport ? 1 : $GLOBALS["USER"]->GetID(), "MODIFIER_USER" => new CBPWorkflowTemplateUser($systemImport ? 1 : CBPWorkflowTemplateUser::CurrentUser));
if (!is_null($systemCode)) {
$templateData["SYSTEM_CODE"] = $systemCode;
}
if ($id <= 0) {
$templateData['ACTIVE'] = 'Y';
}
if ($id > 0) {
self::Update($id, $templateData, $systemImport);
} else {
$id = self::Add($templateData, $systemImport);
}
$runtime = CBPRuntime::GetRuntime();
$runtime->StartRuntime();
$documentService = $runtime->GetService("DocumentService");
$arDocumentFields = $documentService->GetDocumentFields($documentType);
if (is_array($datumTmp["DOCUMENT_FIELDS"])) {
$len = strlen("_PRINTABLE");
$arFieldsTmp = array();
foreach ($datumTmp["DOCUMENT_FIELDS"] as $code => $field) {
if (!array_key_exists($code, $arDocumentFields) && strtoupper(substr($code, -$len)) != "_PRINTABLE") {
$arFieldsTmp[$code] = array("name" => $field["Name"], "code" => $code, "type" => $field["Type"], "multiple" => $field["Multiple"], "required" => $field["Required"]);
if (is_array($field["Options"]) && count($field["Options"]) > 0) {
foreach ($field["Options"] as $k => $v) {
$arFieldsTmp[$code]["options"] .= "[" . $k . "]" . $v . "\n";
}
}
unset($field["Name"], $field["Type"], $field["Multiple"], $field["Required"], $field["Options"]);
$arFieldsTmp[$code] = array_merge($arFieldsTmp[$code], $field);
}
}
if (!empty($arFieldsTmp)) {
\Bitrix\Main\Type\Collection::sortByColumn($arFieldsTmp, "sort");
foreach ($arFieldsTmp as $fieldTmp) {
$documentService->AddDocumentField($documentType, $fieldTmp);
}
}
}
return $id;
}
示例6: ParseResult
function ParseResult($result)
{
global $APPLICATION;
$ar_result = array();
$pairs = explode('&', trim($result, " \n\r\t"));
foreach ($pairs as $pair) {
list($name, $value) = explode('=', $pair, 2);
$ar_result[$name] = $value;
}
$this->session_id = urldecode($ar_result['session_id']);
$this->member_id = urldecode($ar_result['member_id']);
$this->hash = urldecode($ar_result['hash']);
$this->status = urldecode($ar_result['status']);
$this->text = urldecode($ar_result['text']);
if (isset($ar_result['encoding'])) {
$this->encoding = urldecode($ar_result['encoding']);
}
$this->strParameters = base64_decode(urldecode($ar_result['parameters']));
if (CheckSerializedData($this->strParameters)) {
$arParameters = unserialize($this->strParameters);
if (isset($ar_result['encoding'])) {
if (array_key_exists("file", $arParameters)) {
$file = $arParameters["file"];
unset($arParameters["file"]);
$this->_decode($arParameters, $this->encoding, SITE_CHARSET);
$arParameters["file"] = $file;
} else {
$this->_decode($arParameters, $this->encoding, SITE_CHARSET);
}
if ($this->text && is_object($APPLICATION)) {
$this->text = $APPLICATION->ConvertCharset($this->text, $this->encoding, SITE_CHARSET);
}
}
$this->arParameters = $arParameters;
}
$this->version = $ar_result['version'];
if (strlen($this->status) <= 0 && strlen($this->text) <= 0 && strlen($this->member_id) <= 0) {
$this->status = "479";
$this->text = GetMessage("MAIN_CMEMBER_ERR7") . " " . substr($result, 0, 1000);
}
}
示例7: trim
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
$arParams['KEY'] = trim($arParams['KEY']);
$arParams['MAP_ID'] =
(strlen($arParams["MAP_ID"])<=0 || !preg_match("/^[A-Za-z_][A-Za-z01-9_]*$/", $arParams["MAP_ID"])) ?
'MAP_'.RandString() : $arParams['MAP_ID'];
/// Обработка списка объектов на карте
if (($strPositionInfo = $arParams['~MAP_DATA']) && CheckSerializedData($strPositionInfo) && ($arResult['POSITION'] = unserialize($strPositionInfo)))
{
if (is_array($arResult['POSITION']) && is_array($arResult['POSITION']['PLACEMARKS']) && ($cnt = count($arResult['POSITION']['PLACEMARKS'])))
{
for ($i = 0; $i < $cnt; $i++)
{
$arResult['POSITION']['PLACEMARKS'][$i]['TEXT'] = str_replace('###RN###', "\r\n", $arResult['POSITION']['PLACEMARKS'][$i]['TEXT']);
}
}
if (is_array($arResult['POSITION']) && is_array($arResult['POSITION']['POLYLINES']) && ($cnt = count($arResult['POSITION']['POLYLINES'])))
{
for ($i = 0; $i < $cnt; $i++)
{
$arResult['POSITION']['POLYLINES'][$i]['TITLE'] = str_replace('###RN###', "\r\n", $arResult['POSITION']['POLYLINES'][$i]['TITLE']);
}
}
}
示例8: array
// menu
$arFields["arMENU"] = array();
foreach ($arFormMenuLang as $arrL) {
$arFields["arMENU"][$arrL["LID"]] = $_REQUEST["MENU_" . $arrL["LID"]];
}
// access rights
$arFields["arGROUP"] = array();
foreach ($arGroups as $arrG) {
$arFields["arGROUP"][$arrG["ID"]] = $_REQUEST["PERMISSION_" . $arrG["ID"]];
}
$res = intval(CForm::Set($arFields, $ID));
if ($res > 0) {
if ($bEditTemplate && $USE_DEFAULT_TEMPLATE == "N") {
// structure
$FORM_STRUCTURE = $_REQUEST["FORM_STRUCTURE"];
$arrFS = CheckSerializedData($FORM_STRUCTURE) ? unserialize($FORM_STRUCTURE) : array();
if (CFormOutput::CheckTemplate($FORM_TEMPLATE, $arrFS)) {
$GLOBALS['CACHE_MANAGER']->ClearByTag('form_' . $res);
foreach ($arrFS as $arQuestion) {
$arQuestionFields = array("FORM_ID" => $res, "TITLE" => $arQuestion["CAPTION_UNFORM"], "TITLE_TYPE" => $arQuestion["isHTMLCaption"] == "N" ? "text" : "html", "SID" => $arQuestion["FIELD_SID"], "REQUIRED" => $arQuestion["isRequired"] == "N" ? "N" : "Y", "IN_RESULTS_TABLE" => $arQuestion["inResultsTable"] == "Y" ? "Y" : "N", "IN_EXCEL_TABLE" => $arQuestion["inExcelTable"] == "Y" ? "Y" : "N", "ACTIVE" => CForm::isFieldInTemplate($arQuestion["FIELD_SID"], $FORM_TEMPLATE) ? "Y" : "N", 'FILTER_TITLE' => $arQuestion['FILTER_TITLE']);
$FIELD_ID = $arQuestion["isNew"] == "Y" ? false : $arQuestion["ID"];
$QID = CFormField::Set($arQuestionFields, $FIELD_ID, 'Y', 'N');
if ($QID) {
foreach ($arQuestion["structure"] as $arAnswer) {
if (strlen($arAnswer["MESSAGE"]) <= 0) {
if ($arAnswer['ANS_NEW'] != 'Y' && in_array($arAnswer['FIELD_TYPE'], array('dropdown', 'multiselect', 'checkbox', 'radio'))) {
CFormAnswer::Delete($arAnswer['ID'], $QID);
}
continue;
}
if (isset($arAnswer['DEFAULT'])) {
示例9: strToLower
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!$this->__component->__parent || empty($this->__component->__parent->__name)) {
$GLOBALS['APPLICATION']->SetAdditionalCSS('/bitrix/components/bitrix/forum/templates/.default/style.css');
$GLOBALS['APPLICATION']->SetAdditionalCSS('/bitrix/components/bitrix/forum/templates/.default/themes/blue/style.css');
$GLOBALS['APPLICATION']->SetAdditionalCSS('/bitrix/components/bitrix/forum/templates/.default/styles/additional.css');
}
$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/js/main/utils.js");
$arParams["SHOW_MAIL"] = $arParams["SEND_MAIL"] <= "A" || $arParams["SEND_MAIL"] <= "E" && !$GLOBALS['USER']->IsAuthorized() ? "N" : "Y";
/************** User options **************************************/
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/" . strToLower($GLOBALS["DB"]->type) . "/favorites.php";
$arUserOptions = CUserOptions::GetOption("forum", "profile", "", $arParams["UID"]);
$arUserOptions = CheckSerializedData($arUserOptions) ? @unserialize($arUserOptions) : array();
$arUserOptions = is_array($arUserOptions) ? $arUserOptions : array();
if (!is_array($arUserOptions["hide"])) {
$arUserOptions["hide"] = array();
}
$arResult["USER"]["SHOW_PANELS"] = array();
foreach (array("photo", "private", "work", "user_prop") as $key) {
$arResult["USER"]["SHOW_PANELS"][$key] = in_array($key, $arUserOptions["hide"]) ? "N" : "Y";
}
if ($arResult["SHOW_EDIT_PROFILE"] == "Y" && check_bitrix_sessid() && !empty($_REQUEST["option"]) && in_array($_REQUEST["option"], array("photo", "private", "work", "user_prop"))) {
$bUpdate = false;
if ($_REQUEST["value"] == "hide" && !in_array($_REQUEST["option"], $arUserOptions["hide"])) {
$arUserOptions["hide"][] = $_REQUEST["option"];
$bUpdate = true;
} elseif ($_REQUEST["value"] != "hide" && in_array($_REQUEST["option"], $arUserOptions["hide"])) {
$key = intVal(array_search($_REQUEST["option"], $arUserOptions["hide"]));
示例10: htmlspecialcharsbx
if (strlen($strError) > 0) {
$DB->InitTableVarsForEdit("b_adv_banner", "", "str_");
$str_SHOW_PAGE = htmlspecialcharsbx($SHOW_PAGE);
$str_NOT_SHOW_PAGE = htmlspecialcharsbx($NOT_SHOW_PAGE);
$str_IMAGE_ID = 0;
$str_FLASH_IMAGE = 0;
}
if (strlen($SEND_EMAIL) <= 0) {
$SEND_EMAIL = "Y";
}
if ($str_TEMPLATE && CheckSerializedData($str_TEMPLATE)) {
$str_TEMPLATE = unserialize(htmlspecialchars_decode($str_TEMPLATE));
} else {
$str_TEMPLATE = array();
}
if ($str_TEMPLATE_FILES && CheckSerializedData($str_TEMPLATE_FILES)) {
$str_TEMPLATE_FILES = unserialize(htmlspecialchars_decode($str_TEMPLATE_FILES));
} else {
$str_TEMPLATE_FILES = array();
}
if ($str_AD_TYPE == 'template') {
$arCurVal = isset($str_TEMPLATE['PROPS']) ? $str_TEMPLATE['PROPS'] : $_POST['TEMPLATE_PROP'];
$templateName = $str_TEMPLATE["NAME"] ? $str_TEMPLATE["NAME"] : $_POST['TEMPLATE_NAME'];
$templateMode = $str_TEMPLATE['MODE'] ? $str_TEMPLATE['MODE'] : $_POST['EXTENDED_MODE'];
if (count($arCurVal) > 0) {
foreach ($arCurVal as $id => $prop) {
$arCurVal[$id]['EXTENDED_MODE'] = $templateMode;
$arPropsTemplate[$id] = CComponentUtil::GetTemplateProps('bitrix:advertising.banner.view', $templateName, '', $arCurVal[$id]);
uasort($arPropsTemplate[$id]["PARAMETERS"], 'pr_comp');
}
} else {
示例11: GetOfferProperties
public static function GetOfferProperties($offerID, $iblockID, $propertiesList, $skuTreeProps = '')
{
$iblockInfo = false;
$result = array();
$iblockID = intval($iblockID);
$offerID = intval($offerID);
if (0 >= $iblockID || 0 >= $offerID)
return $result;
$skuPropsList = array();
if (!empty($skuTreeProps))
{
if (is_array($skuTreeProps))
{
$skuPropsList = $skuTreeProps;
}
else
{
$skuTreeProps = base64_decode((string)$skuTreeProps);
if (false !== $skuTreeProps && CheckSerializedData($skuTreeProps))
{
$skuPropsList = unserialize($skuTreeProps);
if (!is_array($skuPropsList))
{
$skuPropsList = array();
}
}
}
}
if (!is_array($propertiesList))
{
$propertiesList = array();
}
if (!empty($skuPropsList))
{
$propertiesList = array_unique(array_merge($propertiesList, $skuPropsList));
}
if (empty($propertiesList))
return $result;
$propCodes = array_fill_keys($propertiesList, true);
if (self::$catalogIncluded === null)
self::$catalogIncluded = \Freetrix\Main\Loader::includeModule('catalog');
if (self::$catalogIncluded)
{
$iblockInfo = CCatalogSKU::GetInfoByProductIBlock($iblockID);
}
if (empty($iblockInfo))
return $result;
$sortIndex = 1;
$rsProps = CIBlockElement::GetProperty(
$iblockInfo['IBLOCK_ID'],
$offerID,
array("sort"=>"asc", "enum_sort" => "asc", "value_id"=>"asc"),
array("EMPTY"=>"N")
);
while ($oneProp = $rsProps->Fetch())
{
if (!isset($propCodes[$oneProp['CODE']]) && !isset($propCodes[$oneProp['ID']]))
continue;
$propID = (isset($propCodes[$oneProp['CODE']]) ? $oneProp['CODE'] : $oneProp['ID']);
$userTypeProp = false;
$userType = null;
if (isset($oneProp['USER_TYPE']) && !empty($oneProp['USER_TYPE']))
{
$userTypeDescr = CIBlockProperty::GetUserType($oneProp['USER_TYPE']);
if (isset($userTypeDescr['GetPublicViewHTML']))
{
$userTypeProp = true;
$userType = $userTypeDescr['GetPublicViewHTML'];
}
}
if ($userTypeProp)
{
$displayValue = (string)call_user_func_array($userType,
array(
$oneProp,
array('VALUE' => $oneProp['VALUE']),
array('MODE' => 'SIMPLE_TEXT')
));
$result[] = array(
"NAME" => $oneProp["NAME"],
"CODE" => $propID,
"VALUE" => $displayValue,
"SORT" => $sortIndex++,
);
}
else
{
switch ($oneProp["PROPERTY_TYPE"])
{
case "S":
case "N":
$result[] = array(
//.........这里部分代码省略.........
示例12: IncludeModuleLangFile
IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/catalog/export_yandex.php');
set_time_limit(0);
global $USER;
$bTmpUserCreated = false;
if (!CCatalog::IsUserExists()) {
$bTmpUserCreated = true;
if (isset($USER)) {
$USER_TMP = $USER;
unset($USER);
}
$USER = new CUser();
}
CCatalogDiscountSave::Disable();
$arRunErrors = array();
$IBLOCK_ID = (int) $IBLOCK_ID;
if ($XML_DATA && CheckSerializedData($XML_DATA)) {
$XML_DATA = unserialize(stripslashes($XML_DATA));
if (!is_array($XML_DATA)) {
$XML_DATA = array();
}
}
if (!empty($XML_DATA['PRICE'])) {
if ((int) $XML_DATA['PRICE'] > 0) {
$rsCatalogGroups = CCatalogGroup::GetGroupsList(array('CATALOG_GROUP_ID' => $XML_DATA['PRICE'], 'GROUP_ID' => 2));
if (!($arCatalogGroup = $rsCatalogGroups->Fetch())) {
$arRunErrors[] = GetMessage('EBAY_ERR_BAD_PRICE_TYPE');
}
} else {
$arRunErrors[] = GetMessage('EBAY_ERR_BAD_PRICE_TYPE');
}
}
示例13: require_once
<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
require_once($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/prolog.php");
define("HELP_FILE", "settings/urlrewrite_reindex.php");
IncludeModuleLangFile(__FILE__);
if(!$USER->CanDoOperation('edit_php'))
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
$res=false;
if(strlen($Reindex)>0 && check_bitrix_sessid())
{
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_js.php");
if(strlen($Next)<=0 || !CheckSerializedData($_REQUEST['NS']))
{
$NS = array(
"max_execution_time" => $max_execution_time,
"stepped" => $stepped,
"max_file_size" => $max_file_size
);
if($site_id!="")
$NS["SITE_ID"] = $site_id;
}
else
$NS = unserialize($_REQUEST['NS']);
$res = CUrlRewriter::ReIndexAll(($NS["stepped"]=="Y"? $NS["max_execution_time"]:0), $NS);
if(is_array($res)):
示例14: prepareDiscountConditions
protected function prepareDiscountConditions(&$conditions, &$result, &$handlers, $type)
{
global $APPLICATION;
$obCond = null;
$result = '';
$handlers = array();
$type = (int) $type;
if ($type != self::PREPARE_CONDITIONS && $type != self::PREPARE_ACTIONS || empty($conditions)) {
return false;
}
if (!is_array($conditions)) {
if (!CheckSerializedData($conditions)) {
if ($type == self::PREPARE_CONDITIONS) {
$APPLICATION->ThrowException(GetMessage("BT_MOD_SALE_DISC_ERR_BAD_CONDITIONS"), "CONDITIONS");
} else {
$APPLICATION->ThrowException(GetMessage("BT_MOD_SALE_DISC_ERR_BAD_ACTIONS_EXT"), "ACTIONS");
}
return false;
}
$conditions = unserialize($conditions);
if (!is_array($conditions) || empty($conditions)) {
if ($type == self::PREPARE_CONDITIONS) {
$APPLICATION->ThrowException(GetMessage("BT_MOD_SALE_DISC_ERR_BAD_CONDITIONS"), "CONDITIONS");
} else {
$APPLICATION->ThrowException(GetMessage("BT_MOD_SALE_DISC_ERR_BAD_ACTIONS_EXT"), "ACTIONS");
}
return false;
}
}
if ($type == self::PREPARE_CONDITIONS) {
$obCond = new CSaleCondTree();
$boolCond = $obCond->Init(BT_COND_MODE_GENERATE, BT_COND_BUILD_SALE, array());
} else {
$obCond = new CSaleActionTree();
$boolCond = $obCond->Init(BT_COND_MODE_GENERATE, BT_COND_BUILD_SALE_ACTIONS, array());
}
if (!$boolCond) {
return false;
}
$result = $obCond->Generate($conditions, array('ORDER' => '$arOrder', 'ORDER_FIELDS' => '$arOrder', 'ORDER_PROPS' => '$arOrder[\'PROPS\']', 'ORDER_BASKET' => '$arOrder[\'BASKET_ITEMS\']', 'BASKET' => '$arBasket', 'BASKET_ROW' => '$row'));
if ($result == '') {
if ($type == self::PREPARE_CONDITIONS) {
$APPLICATION->ThrowException(GetMessage("BT_MOD_SALE_DISC_ERR_BAD_CONDITIONS"), "CONDITIONS");
} else {
$APPLICATION->ThrowException(GetMessage("BT_MOD_SALE_DISC_ERR_BAD_ACTIONS_EXT"), "ACTIONS");
}
return false;
} else {
$handlers = $obCond->GetConditionHandlers();
}
$conditions = serialize($conditions);
return true;
}
示例15: getIblockIdsWithGroupFiles
protected function getIblockIdsWithGroupFiles()
{
$groupLibOptions = COption::GetOptionString('webdav', 'group_files', array());
if (CheckSerializedData($groupLibOptions)) {
$groupLibOptions = @unserialize($groupLibOptions);
}
if (!is_array($groupLibOptions)) {
$groupLibOptions = array();
}
$groupIblockIds = array();
foreach ($groupLibOptions as $siteOption) {
if (isset($siteOption['id']) && ($siteOption['id'] = (int) $siteOption['id'])) {
$groupIblockIds[] = $siteOption['id'];
}
}
unset($siteOption);
return array_filter(array_unique($groupIblockIds));
}