Esempio n. 1
0
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;
}
Esempio n. 2
0
 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;
 }
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';
     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';
 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;
 }
Esempio n. 6
0
 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);
     }
 }
Esempio n. 7
0
<?

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']);
		}
	}
}
Esempio n. 8
0
 // 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'])) {
Esempio n. 9
0
<?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"]));
Esempio n. 10
0
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 {
Esempio n. 11
0
	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(
						"NAME" => $oneProp["NAME"],
						"CODE" => $propID,
						"VALUE" => $oneProp["VALUE"],
						"SORT" => $sortIndex++,
					);
					break;
				case "G":
					$rsSection = CIBlockSection::GetList(
						array(),
						array("=ID"=>$oneProp["VALUE"]),
						false,
						array('ID', 'NAME')
					);
					if ($arSection = $rsSection->Fetch())
					{
						$result[] = array(
							"NAME" => $oneProp["NAME"],
							"CODE" => $propID,
							"VALUE" => $arSection["NAME"],
							"SORT" => $sortIndex++,
						);
					}
					break;
				case "E":
					$rsElement = CIBlockElement::GetList(
						array(),
						array("=ID"=>$oneProp["VALUE"]),
						false,
						false,
						array("ID", "NAME")
					);
					if ($arElement = $rsElement->Fetch())
					{
						$result[] = array(
							"NAME" => $oneProp["NAME"],
							"CODE" => $propID,
							"VALUE" => $arElement["NAME"],
							"SORT" => $sortIndex++,
						);
					}
					break;
				case "L":
					$result[] = array(
						"NAME" => $oneProp["NAME"],
						"CODE" => $propID,
						"VALUE" => $oneProp["VALUE_ENUM"],
						"SORT" => $sortIndex++,
					);
					break;
				}
			}
		}
		return $result;
	}
Esempio n. 12
0
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');
    }
}
Esempio n. 13
0
<?
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)):
Esempio n. 14
0
 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;
 }
Esempio n. 15
0
 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));
 }
Esempio n. 16
0
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
/********************************************************************
				Input params
********************************************************************/
$arParams["iIndex"] = $iIndex = rand();
$message = $_SERVER['REQUEST_METHOD'] == "POST" ? $_POST["message_id"] : $_GET["message_id"];
$action = strToUpper($_SERVER['REQUEST_METHOD'] == "POST" ? $_POST["ACTION"] : $_GET["ACTION"]);
$message = is_array($message) ? $message : array($message);
$res = false;
$arUserSettings = array("first_post" => "show");
if (!empty($arResult["MESSAGE_FIRST"]) && $GLOBALS["USER"]->IsAuthorized()) {
    require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/" . strToLower($GLOBALS["DB"]->type) . "/favorites.php";
    $arUserSettings = CUserOptions::GetOption("forum", "default_template", "");
    $arUserSettings = CheckSerializedData($arUserSettings) ? @unserialize($arUserSettings) : array();
    $arUserSettings["first_post"] = $arUserSettings["first_post"] == "hide" ? "hide" : "show";
}
/********************************************************************
				/Input params
********************************************************************/
if (!empty($arResult["ERROR_MESSAGE"])) {
    ?>
<div class="forum-note-box forum-note-error">
	<div class="forum-note-box-text"><?php 
    echo ShowError($arResult["ERROR_MESSAGE"], "forum-note-error");
    ?>
</div>
</div><?php 
}
if (!empty($arResult["OK_MESSAGE"])) {
Esempio n. 17
0
} else {
    $obAct->Show($arDiscount['ACTIONS']);
}
?>
</td>
	</tr><?php 
$strHidden = '';
$strApp = base64_encode(serialize($arDiscount['ACTIONS']));
$tabControl->EndCustomField('ACTIONS', '<input type="hidden" name="ACTIONS" value="' . htmlspecialcharsbx($strApp) . '">' . '<input type="hidden" name="ACTIONS_CHECK" value="' . htmlspecialcharsbx(md5($strApp)) . '">');
$tabControl->AddSection("BT_SALE_DISCOUNT_SECT_COND", GetMessage("BT_SALE_DISCOUNT_SECTIONS_COND_ADD"));
$tabControl->BeginCustomField("CONDITIONS", GetMessage('BT_SALE_DISCOUNT_EDIT_FIELDS_COND_ADD') . ":", false);
?>
<tr id="tr_CONDITIONS">
		<td valign="top" colspan="2"><div id="tree" style="position: relative; z-index: 1;"></div><?php 
if (!is_array($arDiscount['CONDITIONS'])) {
    if (CheckSerializedData($arDiscount['CONDITIONS'])) {
        $arDiscount['CONDITIONS'] = unserialize($arDiscount['CONDITIONS']);
    } else {
        $arDiscount['CONDITIONS'] = '';
    }
}
$arCondParams = array('FORM_NAME' => 'sale_discount_form', 'CONT_ID' => 'tree', 'JS_NAME' => 'JSSaleCond', 'INIT_CONTROLS' => array('SITE_ID' => $arDiscount['LID'], 'CURRENCY' => CSaleLang::GetLangCurrency($arDiscount['LID'])));
$obCond = new CSaleCondTree();
$boolCond = $obCond->Init(BT_COND_MODE_DEFAULT, BT_COND_BUILD_SALE, $arCondParams);
if (!$boolCond) {
    if ($ex = $APPLICATION->GetException()) {
        echo $ex->GetString() . "<br>";
    }
} else {
    $obCond->Show($arDiscount['CONDITIONS']);
}
Esempio n. 18
0
 /**
  * Imports hot keys from file and binds them to user
  * @param string $fileName - absolute path to file with serialized data
  * @param int $userID - user's id wich recieves our hot-keys from file
  * @return int count added hot keys
  * */
 public function Import($fileName, $userID)
 {
     $fileContent = file_get_contents($fileName);
     if (!$fileContent) {
         return false;
     }
     $arInput = null;
     if (CheckSerializedData($fileContent)) {
         $arInput = unserialize($fileContent);
     }
     if (!is_array($arInput) || empty($arInput)) {
         return false;
     }
     $added = 0;
     foreach ($arInput as $arHotKey) {
         $codeID = false;
         if (!isset($arHotKey['IS_CUSTOM']) || !isset($arHotKey['KEYS_STRING']) || !isset($arHotKey['NAME']) || !$this->CheckKeysString($arHotKey['KEYS_STRING'])) {
             continue;
         }
         //if custom code
         if ($arHotKey['IS_CUSTOM']) {
             if (!isset($arHotKey['CODE'])) {
                 continue;
             }
             $resCodes = self::$codes->GetList(array(), array('CLASS_NAME' => isset($arHotKey['CLASS_NAME']) ? $arHotKey['CLASS_NAME'] : '', 'NAME' => $arHotKey['NAME'], 'CODE' => $arHotKey['CODE']));
             $arCode = $resCodes->Fetch();
             //if same code alredy exist
             if (isset($arCode['ID'])) {
                 $codeID = $arCode['ID'];
             } else {
                 $codeID = self::$codes->Add(array('CLASS_NAME' => isset($arHotKey['CLASS_NAME']) ? $arHotKey['CLASS_NAME'] : "", 'CODE' => $arHotKey['CODE'], 'NAME' => $arHotKey['NAME'], 'COMMENTS' => isset($arHotKey['COMMENTS']) ? $arHotKey['COMMENTS'] : "", 'TITLE_OBJ' => isset($arHotKey['TITLE_OBJ']) ? $arHotKey['TITLE_OBJ'] : "", 'URL' => isset($arHotKey['URL']) ? $arHotKey['URL'] : "", 'IS_CUSTOM' => $arHotKey['IS_CUSTOM']));
             }
         } else {
             $resCodes = self::$codes->GetList(array(), array('CLASS_NAME' => isset($arHotKey['CLASS_NAME']) ? $arHotKey['CLASS_NAME'] : '', 'NAME' => $arHotKey['NAME']));
             $arCode = $resCodes->Fetch();
             if (isset($arCode['ID'])) {
                 $codeID = $arCode['ID'];
             }
         }
         if (!$codeID) {
             continue;
         }
         $resHK = $this->GetList(array(), array("CODE_ID" => $codeID, "USER_ID" => intval($userID)));
         $arHK = $resHK->Fetch();
         //if this code alredy binding to some keys for this user
         if ($arHK) {
             $hkID = $arHK['ID'];
             $this->Update($hkID, array("KEYS_STRING" => $arHotKey["KEYS_STRING"], "CODE_ID" => $codeID, "USER_ID" => intval($userID)));
         } else {
             $hkID = $this->Add(array("KEYS_STRING" => $arHotKey["KEYS_STRING"], "CODE_ID" => $codeID, "USER_ID" => intval($userID)));
         }
         if ($hkID) {
             $added++;
         }
     }
     return $added;
 }
Esempio n. 19
0
	echo CUtil::PhpToJsObject(Array('ERROR' => 'SS_MODULE_NOT_INSTALLED'));
	die();
}
if (intval($userId) <= 0)
{
	echo CUtil::PhpToJsObject(Array('ERROR' => 'AUTHORIZE_ERROR'));
	die();
}

if (check_bitrix_sessid())
{
	CUtil::JSPostUnescape();
	if($_REQUEST['action'] == "getuserdata" || $_REQUEST['action'] == 'getsettings')
	{
		$serializedSocservUser = CUserOptions::GetOption("socialservices", "user_socserv_array", '', $userId);
		if(CheckSerializedData($serializedSocservUser))
			$arResult['SOCSERVARRAY'] = unserialize($serializedSocservUser);
		if(!isset($arResult['SOCSERVARRAY']) || !is_array($arResult['SOCSERVARRAY']))
			$arResult['SOCSERVARRAY'] = '';
		if($_REQUEST['checkEnabled'] == 'true')
			$arResult['ENABLED'] = CUserOptions::GetOption("socialservices", "user_socserv_enable", "N", $userId);
		$arResult['STARTSEND'] = CUserOptions::GetOption("socialservices", "user_socserv_start_day", "N", $userId);
		$arResult['ENDSEND'] = CUserOptions::GetOption("socialservices", "user_socserv_end_day", "N", $userId);
		$arResult['STARTTEXT'] = CUserOptions::GetOption("socialservices", "user_socserv_start_text", GetMessage("JS_CORE_SS_WORKDAY_START"), $userId);
		$arResult['ENDTEXT'] = CUserOptions::GetOption("socialservices", "user_socserv_end_text", GetMessage("JS_CORE_SS_WORKDAY_END"), $userId);
		$arResult['SOCSERVARRAYALL'] = CSocServAuthManager::GetUserArrayForSendMessages($userId);
		$arResult['USER_ID'] = $userId;
		$tooltipPathToUser = COption::GetOptionString("main", "TOOLTIP_PATH_TO_USER", false, SITE_ID);
		if($tooltipPathToUser)
			$pathToUser = str_replace("#user_id#", $userId, $tooltipPathToUser)."edit/?current_fieldset=SOCSERV#soc-serv-title-id";
		else
Esempio n. 20
0
 function GetEditorToolbarConfig($editorType)
 {
     $res = COption::GetOptionString('fileman', "toolbar_config_" . $editorType, false);
     if ($res && CheckSerializedData($res)) {
         $arConfig = unserialize($res);
         if (is_array($arConfig)) {
             return $arConfig;
         }
     }
     return false;
 }
Esempio n. 21
0
	function check_memory_limit()
	{
		$total_steps = 5;

		if (!$this->arTestVars['last_value'])
		{
			$last_success = 0;
			$max = 16;
			$step = 1;
		}
		else
		{
			if (!CheckSerializedData($this->arTestVars['last_value']))
				return false;
			list($last_success, $max, $step) = unserialize($this->arTestVars['last_value']);
		}

		$strRequest = "GET "."/bitrix/admin/site_checker.php?test_type=memory_test&unique_id=".checker_get_unique_id()."&max=".($max - 1)." HTTP/1.1\r\n";
		$strRequest.= "Host: ".$this->host."\r\n";
		$strRequest.= "\r\n";

		if (!$res = $this->ConnectToHost())
			return false;

		if (IsHttpResponseSuccess($res, $strRequest))
		{
			$last_success = $max;
			$max *= 2;
		}
		else
			$max = floor(($last_success + $max) / 2);

		if ($max < 16)
			return false;

		if ($step < $total_steps)
		{
			$this->test_percent = floor(100 / $total_steps * $step);
			$step++;
			$this->arTestVars['last_value'] = serialize(array($last_success, $max, $step));
			return true;
		}
		
		$ok = false;
		$res = GetMessage('SC_NOT_LESS',array('#VAL#' => $last_success));
		if (intval($last_success) > 32)
		{
			$ok = true;
			$cur = ini_get('memory_limit');
			if ($cur > 0 && $cur < $last_success)
			{
				$res .= '<br> '.GetMessage('SC_MEMORY_CHANGED', array('#VAL0#' => $cur, '#VAL1#' => '512M'));
				$ok = null;
			}
		}
		return $this->Result($ok, $res);
	}
Esempio n. 22
0
 public static function GetConfig()
 {
     $arConfig = array();
     $strAr = CUserOptions::GetOption("fileman", "file_copy_move_config", false);
     if ($strAr && CheckSerializedData($strAr)) {
         $arConfig = unserialize($strAr);
     }
     return $arConfig;
 }
Esempio n. 23
0
			);
			?><script>parent.access_check_start(0);</script><?
		}
	}
	else
		echo '<h1>Permission denied: BITRIX SESSID ERROR</h1>';
	exit;
}
elseif($_REQUEST['test_start'])
{
	if (defined('NOT_CHECK_PERMISSIONS') && NOT_CHECK_PERMISSIONS ===true || check_bitrix_sessid())
	{
		$oTest = new CSiteCheckerTest($_REQUEST['step'], (int) $_REQUEST['fast']);
		if ($_REQUEST['global_test_vars'] && ($d = base64_decode($_REQUEST['global_test_vars'])))
		{
			if (!CheckSerializedData($d))
				die('Error unserialize');
			$oTest->arTestVars = unserialize($d);
		}

		$oTest->Start();
		if ($oTest->percent < 100)
		{
			$strNextRequest = '&step='.$oTest->step.'&global_test_vars='.base64_encode(serialize($oTest->arTestVars));
			$strFinalStatus = '';
		}
		else
		{
			$strNextRequest = '';
			$strFinalStatus = '100%';
		}
Esempio n. 24
0
 public static function GetPathes($forSite = false)
 {
     $pathes = array();
     if ($forSite === false) {
         $arAffectedSites = COption::GetOptionString('calendar', 'pathes_sites', false);
         if ($arAffectedSites != false && CheckSerializedData($arAffectedSites)) {
             $arAffectedSites = unserialize($arAffectedSites);
         }
     } else {
         if (is_array($forSite)) {
             $arAffectedSites = $forSite;
         } else {
             $arAffectedSites = array($forSite);
         }
     }
     if (is_array($arAffectedSites) && count($arAffectedSites) > 0) {
         foreach ($arAffectedSites as $s) {
             $ar = COption::GetOptionString("calendar", 'pathes_' . $s, false);
             if ($ar != false && CheckSerializedData($ar)) {
                 $ar = unserialize($ar);
                 if (is_array($ar)) {
                     $pathes[$s] = $ar;
                 }
             }
         }
     }
     if ($forSite !== false) {
         $result = array();
         if (isset($pathes[$forSite]) && is_array($pathes[$forSite])) {
             $result = $pathes[$forSite];
         }
         $arPathes = self::GetPathesList();
         foreach ($arPathes as $pathName) {
             $val = $result[$pathName];
             if (!isset($val) || empty($val)) {
                 if (!isset($SET)) {
                     $SET = self::GetSettings();
                 }
                 $val = $SET[$pathName];
                 $result[$pathName] = $val;
             }
         }
         return $result;
     }
     return $pathes;
 }
Esempio n. 25
0
if (empty($arResult["GROUP"])) {
    $arParams["GID"] = 0;
}
$arResult["GROUP_NAVIGATION"] = array();
$arResult["USER"] = array("CAN_MODERATE" => "N", "HIDDEN_GROUPS" => array(), "HIDDEN_FORUMS" => array());
$arResult["URL"] = array("INDEX" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_FORUMS"], array()), "~INDEX" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_FORUMS"], array()), "RSS" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_RSS"], array("TYPE" => "default", "MODE" => "forum", "IID" => "all")), "~RSS" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_RSS"], array("TYPE" => "default", "MODE" => "forum", "IID" => "all")), "~RSS_DEFAULT" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_RSS"], array("TYPE" => "rss2", "MODE" => "forum", "IID" => "all")), "RSS_DEFAULT" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_RSS"], array("TYPE" => "rss2", "MODE" => "forum", "IID" => "all")));
$arGroupForum = array();
$parser = new forumTextParser(false, false, false, "light");
$parser->MaxStringLen = $arParams["WORD_LENGTH"];
$arResult["FORUMS_FOR_GUEST"] = array();
$arResult["FORUMS_LIST"] = array();
/*******************************************************************/
if ($GLOBALS["USER"]->IsAuthorized()) {
    require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/" . strToLower($GLOBALS["DB"]->type) . "/favorites.php";
    $res = CUserOptions::GetOption("forum", "user_info", "");
    $res = CheckSerializedData($res) ? @unserialize($res) : array();
    $arResult["USER"]["HIDDEN_GROUPS"] = is_array($res["groups"]) ? $res["groups"] : array();
    $arResult["USER"]["HIDDEN_FORUMS"] = is_array($res["forums"]) ? $res["forums"] : array();
}
foreach ($arParams["FID_RANGE"] as $key => $val) {
    if (intVal($val) > 0) {
        $res[] = $val;
    }
}
$arParams["FID_RANGE"] = $res;
$cache = new CPHPCache();
global $NavNum;
$PAGEN_NAME = "PAGEN_" . ($NavNum + 1);
global ${$PAGEN_NAME};
$PAGEN = ${$PAGEN_NAME};
global $CACHE_MANAGER;
Esempio n. 26
0
	public function Show($arConditions)
	{
		$this->arMsg = array();

		if (!$this->boolError)
		{
			if (!empty($arConditions))
			{
				if (!is_array($arConditions))
				{
					if (!CheckSerializedData($arConditions))
					{
						$this->boolError = true;
						$this->arMsg[] = array('id' => 'CONDITIONS', 'text' => Loc::getMessage('BT_MOD_COND_ERR_SHOW_DATA_UNSERIALIZE'));
					}
					else
					{
						$arConditions = unserialize($arConditions);
						if (!is_array($arConditions))
						{
							$this->boolError = true;
							$this->arMsg[] = array('id' => 'CONDITIONS', 'text' => Loc::getMessage('BT_MOD_COND_ERR_SHOW_DATA_UNSERIALIZE'));
						}
					}
				}
			}
		}

		if (!$this->boolError)
		{
			$this->arConditions = (!empty($arConditions) ? $arConditions : $this->GetDefaultConditions());

			$strResult = '';

			$this->ShowScripts();

			if ($this->boolCreateForm)
			{

			}
			if ($this->boolCreateCont)
			{

			}

			$strResult .= '<script type="text/javascript">'."\n";
			$strResult .= 'var '.$this->strJSName.' = new BX.TreeConditions('."\n";
			$strResult .= $this->ShowParams().",\n";
			$strResult .= $this->ShowConditions().",\n";
			$strResult .= $this->ShowControls()."\n";

			$strResult .= ');'."\n";
			$strResult .= '</script>'."\n";

			if ($this->boolCreateCont)
			{

			}
			if ($this->boolCreateForm)
			{

			}

			echo $strResult;
		}
	}
Esempio n. 27
0
 print "<pre>";
 print_r($arFields);
 print "</pre>";
 die();
 */
 if (strlen($strError) <= 0) {
     $res = intval(CFormField::Set($arFields, $ID));
     if ($res > 0) {
         if (intval($ID) > 0) {
             CFormValidator::Clear($ID);
         }
         $ID = $res;
         // process field validators
         if ($additional != "Y") {
             $sValStructSerialized = $_REQUEST["VAL_STRUCTURE"];
             if (CheckSerializedData($sValStructSerialized)) {
                 $arValStructure = unserialize($sValStructSerialized);
                 if (count($arValStructure) > 0) {
                     CFormValidator::SetBatch($WEB_FORM_ID, $ID, $arValStructure);
                 }
             }
         }
         if (strlen($strError) <= 0) {
             if (strlen($_REQUEST['save']) > 0) {
                 LocalRedirect("form_field_list.php?WEB_FORM_ID=" . $WEB_FORM_ID . "&additional=" . $additional . "&lang=" . LANGUAGE_ID);
             } else {
                 LocalRedirect("form_field_edit.php?ID=" . $ID . "&WEB_FORM_ID=" . $WEB_FORM_ID . "&additional=" . $additional . "&lang=" . LANGUAGE_ID . "&" . $tabControl->ActiveTabParam());
             }
         }
     }
     $DB->PrepareFields("b_form_field");
Esempio n. 28
0
//	$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));

$obJSPopup = new CJSPopup('',
	array(
		'TITLE' => GetMessage('MYMV_SET_POPUP_TITLE'),
		'SUFFIX' => 'google_map',
		'ARGS' => ''
	)
);

$arData = array();
if ($_REQUEST['MAP_DATA'])
{
	CUtil::JSPostUnescape();

	if (CheckSerializedData($_REQUEST['MAP_DATA']))
	{
		$arData = unserialize($_REQUEST['MAP_DATA']);

		if (is_array($arData) && is_array($arData['PLACEMARKS']) && ($cnt = count($arData['PLACEMARKS'])))
		{
			for ($i = 0; $i < $cnt; $i++)
			{
				$arData['PLACEMARKS'][$i]['TEXT'] = str_replace('###RN###', "\r\n", $arData['PLACEMARKS'][$i]['TEXT']);
			}
		}
	}
}
?>
<script type="text/javascript" src="/freetrix/components/freetrix/map.google.view/settings/settings_load.js"></script>
<script type="text/javascript">
Esempio n. 29
0
 protected function prepareDiscountConditions(&$conditions, &$result, &$handlers, $type, $site)
 {
     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(Loc::getMessage("BT_MOD_SALE_DISC_ERR_BAD_CONDITIONS"), "CONDITIONS");
             } else {
                 $APPLICATION->ThrowException(Loc::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(Loc::getMessage("BT_MOD_SALE_DISC_ERR_BAD_CONDITIONS"), "CONDITIONS");
             } else {
                 $APPLICATION->ThrowException(Loc::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('INIT_CONTROLS' => array('SITE_ID' => $site, 'CURRENCY' => CSaleLang::GetLangCurrency($site))));
     } 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(Loc::getMessage('BT_MOD_SALE_DISC_ERR_BAD_CONDITIONS'), 'CONDITIONS');
         } else {
             $APPLICATION->ThrowException(Loc::getMessage('BT_MOD_SALE_DISC_ERR_BAD_ACTIONS_EXT'), 'ACTIONS');
         }
         return false;
     } else {
         $handlers['HANDLERS'] = $obCond->GetConditionHandlers();
         $handlers['ENTITY'] = $obCond->GetUsedEntityList();
         $handlers['EXECUTE_MODULE'] = $obCond->GetExecuteModule();
     }
     $conditions = serialize($conditions);
     return true;
 }
echo CUtil::PhpToJSObject(MODULE_ID);
?>
;
var ENTITY = <?php 
echo CUtil::PhpToJSObject(ENTITY);
?>
;
var BPMESS = <?php 
echo CUtil::PhpToJSObject($JSMESS);
?>
;

<?php 
$defUserParamsStr = serialize(array("groups" => array()));
$userParamsStr = CUserOptions::GetOption("~bizprocdesigner", "activity_settings", $defUserParamsStr);
if (empty($userParamsStr) || !CheckSerializedData($userParamsStr)) {
    $userParamsStr = $defUserParamsStr;
}
$userParamsData = unserialize($userParamsStr);
?>
var arUserParams = <?php 
echo CUtil::PhpToJSObject($userParamsData);
?>
;

var CURRENT_SITE_ID = <?php 
echo CUtil::PhpToJSObject(SITE_ID);
?>
;

var arAllId = {};