Пример #1
0
 static function onBeforeElementAddHandler($arFields)
 {
     $IBLOCK_ID = Config\Option::get("citfact.replaceurl", "IBLOCK_ID", "");
     $SECTION_ID = Config\Option::get("citfact.replaceurl", "SECTION_BREND_ID", "BRENDI");
     $CODE_PROP = Config\Option::get("citfact.replaceurl", "PROPERTY_CODE_BRENDI", "BRENDI");
     if ($IBLOCK_ID == $arFields["IBLOCK_ID"]) {
         $propertyBrand = \CIBlockProperty::GetByID($CODE_PROP, $arFields["IBLOCK_ID"]);
         if ($arResultProperty = $propertyBrand->GetNext()) {
             $propertyBrandValue = \CIBlockPropertyEnum::GetByID($arFields["PROPERTY_VALUES"][$arResultProperty["ID"]][0]["VALUE"]);
         }
         $rqParentSection = \CIBlockSection::GetByID($SECTION_ID);
         if ($arParentSection = $rqParentSection->GetNext()) {
             $arFilter = array('IBLOCK_ID' => $arParentSection['IBLOCK_ID'], '>LEFT_MARGIN' => $arParentSection['LEFT_MARGIN'], '<RIGHT_MARGIN' => $arParentSection['RIGHT_MARGIN'], '>DEPTH_LEVEL' => $arParentSection['DEPTH_LEVEL']);
             // выберет потомков без учета активности
             $rqSectChild = \CIBlockSection::GetList(array('left_margin' => 'asc'), $arFilter);
             while ($arSectChild = $rqSectChild->GetNext()) {
                 $arSections[$arSectChild["NAME"]] = $arSectChild["ID"];
             }
         }
         if (array_key_exists($propertyBrandValue["VALUE"], $arSections)) {
             $arFields["IBLOCK_SECTION"][] = $arSections[$propertyBrandValue["VALUE"]];
         } else {
             $arParams = array("replace_space" => "-", "replace_other" => "-");
             $trans = \Cutil::translit($propertyBrandValue["VALUE"], "ru", $arParams);
             $bs = new \CIBlockSection();
             $arFieldsNewSection = array("ACTIVE" => "Y", "IBLOCK_SECTION_ID" => $SECTION_ID, "IBLOCK_ID" => $IBLOCK_ID, "NAME" => $propertyBrandValue["VALUE"], "CODE" => $trans);
             $resultAdd = $bs->Add($arFieldsNewSection);
             $arFields["IBLOCK_SECTION"][] = $resultAdd;
         }
     }
     return true;
 }
Пример #2
0
 public function __construct()
 {
     $interval = (int) Option::get('security', 'totp_interval');
     if ($interval && $interval > 0) {
         $this->interval = $interval;
     }
 }
Пример #3
0
 protected function hasProperFilename($filename)
 {
     if (!$this->filename_pattern) {
         $this->filename_pattern = Option::get(UM_BM_MODULE_NAME, 'migration_filename_regexp', self::DEFAULT_FILENAME_PATTERN);
     }
     return preg_match($this->filename_pattern, $filename);
 }
Пример #4
0
 /**
  * @param $arOrder
  * @param $deliveryCode
  * @param $arErrors
  * @return bool
  * @throws \Bitrix\Main\ArgumentNullException
  * @throws \Bitrix\Main\SystemException
  * @internal
  * @deprecated
  */
 static function DoProcessOrder(&$arOrder, $deliveryCode, &$arErrors)
 {
     if (strlen($deliveryCode) <= 0 || $deliveryCode == '0') {
         return false;
     }
     if ($service = \Bitrix\Sale\Delivery\Services\Manager::getServiceByCode($deliveryCode)) {
         $isOrderConverted = \Bitrix\Main\Config\Option::get("main", "~sale_converted_15", 'N');
         $arOrderTmpDel = array("PRICE" => $arOrder["ORDER_PRICE"] + $arOrder["TAX_PRICE"] - $arOrder["DISCOUNT_PRICE"], "WEIGHT" => $arOrder["ORDER_WEIGHT"], "LOCATION_FROM" => COption::GetOptionString('sale', 'location', '2961', $arOrder["SITE_ID"]), "LOCATION_TO" => isset($arOrder["DELIVERY_LOCATION"]) ? $arOrder["DELIVERY_LOCATION"] : 0, "LOCATION_ZIP" => $arOrder["DELIVERY_LOCATION_ZIP"], "ITEMS" => $arOrder["BASKET_ITEMS"], "CURRENCY" => $arOrder["CURRENCY"]);
         if ($isOrderConverted == "Y" && !empty($arOrder['ORDER_PROP']) && is_array($arOrder['ORDER_PROP'])) {
             $arOrderTmpDel['PROPERTIES'] = $arOrder['ORDER_PROP'];
         }
         //$r = $propCollection->setValuesFromPost($fields, $_FILES);
         $arOrder["DELIVERY_ID"] = $deliveryCode;
         $shipment = self::convertOrderOldToNew($arOrderTmpDel);
         if (isset($arOrder["DELIVERY_EXTRA_SERVICES"])) {
             $service->getExtraServices()->setValues($arOrder["DELIVERY_EXTRA_SERVICES"]);
         }
         $calculationResult = $service->calculate($shipment);
         if (!$calculationResult->isSuccess()) {
             $arErrors[] = array("CODE" => "CALCULATE", "TEXT" => implode("<br>\n", $calculationResult->getErrorMessages()));
         } else {
             $arOrder["DELIVERY_PRICE"] = roundEx($calculationResult->getPrice(), SALE_VALUE_PRECISION);
         }
     } else {
         $arErrors[] = array("CODE" => "CALCULATE", "TEXT" => GetMessage('SKGD_DELIVERY_NOT_FOUND'));
     }
 }
Пример #5
0
 public static function setPageMeta($sectionId, $propertyValues)
 {
     $page = self::getPageByUrl($GLOBALS['APPLICATION']->GetCurPage(false));
     if (!$page) {
         $seoTitleTemplate = Option::get('xpage.seofilter', 'SEO_TITLE', null);
         $seoDescriptionTemplate = Option::get('xpage.seofilter', 'SEO_DESCRIPTION', null);
         $seoKeywordsTemplate = Option::get('xpage.seofilter', 'SEO_KEYWORDS', null);
         $pageTitleTemplate = Option::get('xpage.seofilter', 'SEO_H1', null);
         $page['PAGE_TITLE'] = self::compileTemplate($seoTitleTemplate, $sectionId, $propertyValues);
         $page['PAGE_TITLE_H1'] = self::compileTemplate($pageTitleTemplate, $sectionId, $propertyValues);
         $page['META_KEYWORDS'] = self::compileTemplate($seoKeywordsTemplate, $sectionId, $propertyValues);
         $page['META_DESCRIPTION'] = self::compileTemplate($seoDescriptionTemplate, $sectionId, $propertyValues);
     }
     if ($page['PAGE_TITLE_H1']) {
         $GLOBALS['APPLICATION']->SetTitle(trim($page['PAGE_TITLE_H1']));
     }
     if ($page['PAGE_TITLE']) {
         $GLOBALS['APPLICATION']->SetPageProperty('title', trim($page['PAGE_TITLE']));
     }
     if ($page['META_KEYWORDS']) {
         $GLOBALS['APPLICATION']->SetPageProperty('keywords', trim($page['META_KEYWORDS']));
     }
     if ($page['META_DESCRIPTION']) {
         $GLOBALS['APPLICATION']->SetPageProperty('description', trim($page['META_DESCRIPTION']));
     }
 }
Пример #6
0
 public function __construct()
 {
     $this->hosts = Config\Option::get('security', $this->optionPrefix . 'hosts', '');
     $this->action = Config\Option::get('security', $this->optionPrefix . 'action', '');
     $this->actionOptions = unserialize(Config\Option::get('security', $this->optionPrefix . 'action_options', '{}'));
     $this->isLogNeeded = Config\Option::get('security', $this->optionPrefix . 'logging', false);
 }
Пример #7
0
 public function __construct()
 {
     $diskEnabled = \Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk');
     if (!$diskEnabled) {
         $this->validUrls = array_merge($this->validUrls, array("/company/personal.php", "/extranet/contacts/personal.php", "/docs/index.php", "/docs/shared/index.php", "/workgroups/index.php"));
     }
 }
Пример #8
0
 /**
  * @param null $mailingId
  * @param null $mailingChainId
  * @throws \Bitrix\Main\ArgumentException
  */
 public static function actualizeAgent($mailingId = null, $mailingChainId = null)
 {
     $agent = new \CAgent();
     $isSendByTimeMethodCron = \Bitrix\Main\Config\Option::get("sender", "auto_method") === 'cron';
     $arFilter = array();
     if ($mailingId) {
         $arFilter['=MAILING_ID'] = $mailingId;
     }
     if ($mailingChainId) {
         $arFilter['=ID'] = $mailingChainId;
     }
     $mailingChainDb = MailingChainTable::getList(array('select' => array('ID', 'STATUS', 'AUTO_SEND_TIME', 'MAILING_ACTIVE' => 'MAILING.ACTIVE'), 'filter' => $arFilter));
     while ($mailingChain = $mailingChainDb->fetch()) {
         $agentName = static::getAgentName($mailingChain['ID']);
         $rsAgents = $agent->GetList(array("ID" => "DESC"), array("MODULE_ID" => "sender", "NAME" => $agentName));
         while ($arAgent = $rsAgents->Fetch()) {
             $agent->Delete($arAgent["ID"]);
         }
         if ($isSendByTimeMethodCron || empty($mailingChain['AUTO_SEND_TIME'])) {
             continue;
         }
         if ($mailingChain['MAILING_ACTIVE'] == 'Y' && $mailingChain['STATUS'] == MailingChainTable::STATUS_SEND) {
             if (!empty($mailingChain['AUTO_SEND_TIME'])) {
                 $dateExecute = $mailingChain['AUTO_SEND_TIME'];
             } else {
                 $dateExecute = "";
             }
             $interval = \Bitrix\Main\Config\Option::get('sender', 'auto_agent_interval', "0");
             $agent->AddAgent($agentName, "sender", "N", intval($interval), null, "Y", $dateExecute);
         }
     }
 }
Пример #9
0
    public static function showTab($div, $iblockElementInfo)
    {
        $engineList = array();
        if (Option::get('main', 'vendor', '') == '1c_bitrix') {
            $engineList[] = array("DIV" => "yandex_direct", "TAB" => Loc::getMessage("SEO_ADV_YANDEX_DIRECT"), "TITLE" => Loc::getMessage("SEO_ADV_YANDEX_DIRECT_TITLE"), "HANDLER" => IO\Path::combine(Application::getDocumentRoot(), BX_ROOT, "/modules/seo/admin/tab/seo_search_yandex_direct.php"));
        }
        if (count($engineList) > 0) {
            $engineTabControl = new \CAdminViewTabControl("engineTabControl", $engineList);
            ?>
<tr>
	<td colspan="2">
<?php 
            $engineTabControl->begin();
            foreach ($engineList as $engineTab) {
                $engineTabControl->beginNextTab();
                $file = new IO\File($engineTab["HANDLER"]);
                if ($file->isExists()) {
                    require $file->getPath();
                }
            }
            $engineTabControl->end();
            ?>
	</td>
</tr>
<?php 
        }
    }
Пример #10
0
 public static function AddBlogPost($arFields)
 {
     if (!is_array($_POST)) {
         $_POST = array();
     }
     $_POST = array_merge($_POST, array("apply" => "Y", "decode" => "N"), $arFields);
     $strPathToPost = COption::GetOptionString("socialnetwork", "userblogpost_page", false, SITE_ID);
     $strPathToSmile = COption::GetOptionString("socialnetwork", "smile_page", false, SITE_ID);
     $BlogGroupID = COption::GetOptionString("socialnetwork", "userbloggroup_id", false, SITE_ID);
     $arBlogComponentParams = array("IS_REST" => "Y", "ID" => "new", "PATH_TO_POST" => $strPathToPost, "PATH_TO_SMILE" => $strPathToSmile, "GROUP_ID" => $BlogGroupID, "USER_ID" => $GLOBALS["USER"]->GetID(), "USE_SOCNET" => "Y", "MICROBLOG" => "Y");
     ob_start();
     $result = $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:socialnetwork.blog.post.edit", "", $arBlogComponentParams, false, array("HIDE_ICONS" => "Y"));
     ob_end_clean();
     if (!$result) {
         throw new Exception('Error');
     } else {
         if (isset($arFields["FILES"]) && \Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk') && ($storage = \Bitrix\Disk\Driver::getInstance()->getStorageByUserId($GLOBALS["USER"]->GetID())) && ($folder = $storage->getFolderForUploadedFiles($GLOBALS["USER"]->GetID()))) {
             // upload to storage
             $arResultFile = array();
             foreach ($arFields["FILES"] as $tmp) {
                 $arFile = CRestUtil::saveFile($tmp);
                 if (is_array($arFile)) {
                     $file = $folder->uploadFile($arFile, array('NAME' => $arFile["name"], 'CREATED_BY' => $GLOBALS["USER"]->GetID()), array(), true);
                     if ($file) {
                         $arResultFile[] = \Bitrix\Disk\Uf\FileUserType::NEW_FILE_PREFIX . $file->getId();
                     }
                 }
             }
             if (!empty($arResultFile)) {
                 CBlogPost::Update($result, array("HAS_PROPS" => "Y", "UF_BLOG_POST_FILE" => $arResultFile));
             }
         }
         return $result;
     }
 }
Пример #11
0
 /**
  * @return Form
  */
 public function create()
 {
     if (!in_array($this->params->get('TYPE'), array('IBLOCK', 'HLBLOCK', 'CUSTOM'))) {
         $this->params->set('TYPE', 'CUSTOM');
     }
     switch ($this->params->get('TYPE')) {
         case 'IBLOCK':
             $builder = 'Citfact\\Form\\Builder\\IBlockBuilder';
             $storage = 'Citfact\\Form\\Storage\\IBlockStorage';
             $validator = 'Citfact\\Form\\Validator\\IBlockValidator';
             break;
         case 'HLBLOCK':
             $builder = 'Citfact\\Form\\Builder\\UserFieldBuilder';
             $storage = 'Citfact\\Form\\Storage\\HighLoadBlockStorage';
             $validator = 'Citfact\\Form\\Validator\\UserFieldValidator';
             break;
         case 'CUSTOM':
             $builder = $this->params->get('BUILDER') ?: Config\Option::get('citfact.form', 'BUILDER');
             $storage = $this->params->get('STORAGE') ?: Config\Option::get('citfact.form', 'STORAGE');
             $validator = $this->params->get('VALIDATOR') ?: Config\Option::get('citfact.form', 'VALIDATOR');
             break;
     }
     $mailer = new Mailer($this->params, new \CEventType(), new \CEvent());
     $form = new Form($this->params, new $builder(), new $validator(), new $storage());
     $form->setMailer($mailer);
     return $form;
 }
Пример #12
0
 public function __construct()
 {
     $window = (int) Option::get('security', 'hotp_user_window', 10);
     if ($window && $window > 0) {
         $this->window = $window;
     }
 }
Пример #13
0
 /**
  * @return array
  */
 public static function getInstalledCurrencies()
 {
     $installedCurrencies = (string) Option::get('currency', 'installed_currencies');
     if ($installedCurrencies === '') {
         $currencyList = array();
         $searched = false;
         $languageIterator = LanguageTable::getList(array('select' => array('ID'), 'filter' => array('ID' => 'ua')));
         if ($oneLanguage = $languageIterator->fetch()) {
             $currencyList = array('RUB', 'USD', 'EUR', 'UAH');
             $searched = true;
         }
         if (!$searched) {
             $languageIterator = LanguageTable::getList(array('select' => array('ID'), 'filter' => array('ID' => 'ru')));
             if ($oneLanguage = $languageIterator->fetch()) {
                 $currencyList = array('RUB', 'USD', 'EUR', 'UAH');
                 $searched = true;
             }
         }
         if (!$searched) {
             $currencyList = array('USD', 'EUR');
         }
         Option::set('currency', 'installed_currencies', implode(',', $currencyList), '');
         return $currencyList;
     } else {
         return explode(',', $installedCurrencies);
     }
 }
Пример #14
0
 public function setCookie($name, $value, $time = false, $folder = "/", $domain = false, $secure = false, $spread = true, $name_prefix = false)
 {
     if ($time === false) {
         $time = time() + 60 * 60 * 24 * 30 * 12;
     }
     // 30 суток * 12 ~ 1 год
     if ($name_prefix === false) {
         $name = \Bitrix\Main\Config\Option::get("main", "cookie_name", "BITRIX_SM") . "_" . $name;
     } else {
         $name = $name_prefix . "_" . $name;
     }
     if ($domain === false) {
         $domain = $this->getCookieDomain();
     }
     if ($spread === "Y" || $spread === true) {
         $spread_mode = static::SPREAD_DOMAIN | static::SPREAD_SITES;
     } elseif ($spread >= 1) {
         $spread_mode = $spread;
     } else {
         $spread_mode = static::SPREAD_DOMAIN;
     }
     //current domain only
     if ($spread_mode & static::SPREAD_DOMAIN) {
         setcookie($name, $value, $time, $folder, $domain, $secure);
     }
     //spread over sites
     //		if($spread_mode & static::SPREAD_SITES)
     //			$this->arrSPREAD_COOKIE[$name] = array("V" => $value, "T" => $time, "F" => $folder, "D" => $domain, "S" => $secure);
 }
Пример #15
0
 private static function needProxyToDiskByDocType($documentType)
 {
     if (!(\Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk'))) {
         return false;
     }
     if (empty($documentType)) {
         return false;
     }
     $storage = null;
     if (substr($documentType, 0, 7) == 'STORAGE') {
         $storageId = (int) substr($documentType, 8);
         if ($storageId) {
             $storage = \Bitrix\Disk\Storage::loadById($storageId);
         }
         if ($storage) {
             return $storage;
         }
     }
     list(, $iblockId, $typeLib, $entityId) = explode('_', $documentType);
     if ($typeLib == 'user') {
         $storage = \Bitrix\Disk\Driver::getInstance()->getStorageByUserId($entityId);
     } elseif ($typeLib == 'group') {
         $storage = \Bitrix\Disk\Driver::getInstance()->getStorageByGroupId($entityId);
     } else {
         return false;
     }
     return $storage;
 }
Пример #16
0
 function __wd_get_root_section($IBLOCK_ID, $object, $object_id)
 {
     $result = CIBlockWebdavSocnet::GetSectionID($IBLOCK_ID, $object, $object_id);
     if (intval($result) > 0) {
         return $result;
     } else {
         __wd_check_uf_use_bp_property($arParams["IBLOCK_ID"]);
         $arFields = array("IBLOCK_ID" => $IBLOCK_ID, "ACTIVE" => "Y", "SOCNET_GROUP_ID" => false, "IBLOCK_SECTION_ID" => 0, "UF_USE_BP" => "N");
         if ($object == "user") {
             $dbUser = CUser::GetByID($object_id);
             $arUser = $dbUser->Fetch();
             $arFields["NAME"] = trim($arUser['LAST_NAME'] . " " . $arUser['FIRST_NAME']);
             $arFields["NAME"] = trim(!empty($arFields["NAME"]) ? $arFields["NAME"] : $arUser['LOGIN']);
             $arFields['CREATED_BY'] = $arUser['ID'];
             $arFields['MODIFIED_BY'] = $arUser['ID'];
             if (CIBlock::GetArrayByID($IBLOCK_ID, "RIGHTS_MODE") === "E") {
                 $arTasks = CWebDavIblock::GetTasks();
                 $arFields['RIGHTS'] = array('n0' => array('GROUP_CODE' => 'U' . $object_id, 'TASK_ID' => $arTasks['X']));
             }
         } else {
             /*		$res = CSocNetGroup::GetByID($arResult["VARIABLES"]["group_id"]);
             				if (!$res)
             				{
             					$arParams["ERROR_MESSAGE"] = GetMessage("SONET_GROUP_NOT_EXISTS");
             					return 0;
             				} */
             $arFields["SOCNET_GROUP_ID"] = $object_id;
             //$arGroup = CSocNetGroup::GetByID($object_id);
             $arFields["NAME"] = GetMessage("SONET_GROUP_PREFIX") . $object_id;
             $dbGroup = CSocNetGroup::GetList(array(), array("ID" => (int) $object_id), false, false, array("ID", "SITE_ID", "NAME"));
             if ($arGroup = $dbGroup->Fetch()) {
                 $arFields["NAME"] = GetMessage("SONET_GROUP_PREFIX") . $arGroup["NAME"];
             }
             if (CIBlock::GetArrayByID($IBLOCK_ID, "RIGHTS_MODE") === "E") {
                 $arTasks = CWebDavIblock::GetTasks();
                 $arFields['RIGHTS'] = array('n0' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_A', 'TASK_ID' => $arTasks['X']), 'n1' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_E', 'TASK_ID' => $arTasks['W']), 'n2' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_K', 'TASK_ID' => $arTasks['W']));
             }
         }
         if (\Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk')) {
             \Bitrix\Disk\Driver::getInstance()->addGroupStorage($arFields["SOCNET_GROUP_ID"]);
         }
         $GLOBALS["UF_USE_BP"] = $arFields["UF_USE_BP"];
         $GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("IBLOCK_" . $IBLOCK_ID . "_SECTION", $arFields);
         $bs = new CIBlockSection();
         $sectionID = $bs->Add($arFields);
         if (!$sectionID) {
             $arParams["ERROR_MESSAGE"] = $bs->LAST_ERROR;
             return 0;
         }
         WDClearComponentCache(array("webdav.element.edit", "webdav.element.hist", "webdav.element.upload", "webdav.element.view", "webdav.menu", "webdav.section.edit", "webdav.section.list"));
         return true;
         /*
         	if ($ob->workflow == 'bizproc')
         	{
         		__wd_create_default_bp_user_and_groups($arBizProcParameters);
         	}
         */
     }
 }
Пример #17
0
 private static function generateCookieName($name)
 {
     $cookiePrefix = \Bitrix\Main\Config\Option::get("main", "cookie_name", "BITRIX_SM") . "_";
     if (strpos($name, $cookiePrefix) !== 0) {
         $name = $cookiePrefix . $name;
     }
     return $name;
 }
Пример #18
0
 public function Start(CBPRuntime $runtime = null)
 {
     parent::Start($runtime);
     $skipTypes = \Bitrix\Main\Config\Option::get("bizproc", "log_skip_types", CBPTrackingType::ExecuteActivity . ',' . CBPTrackingType::CloseActivity);
     if ($skipTypes !== '') {
         $this->skipTypes = explode(',', $skipTypes);
     }
 }
Пример #19
0
 public static function checkGroupUsage()
 {
     $optValue = Config\Option::get("sale", self::PROJECT_USES_GROUPS_OPT, '', '');
     if (!$optValue) {
         // option is undefined, we are not sure if there are groups or not
         return self::getGroupUsage();
     }
     return $optValue == 'Y';
 }
Пример #20
0
 public static function getCompletedPercent()
 {
     $currentValue = Option::get('sender', self::$optionName, '');
     if ($currentValue === '') {
         $currentValue = count(self::$stages);
     }
     $currentValue = intval($currentValue);
     return array('CURRENT' => $currentValue, 'ALL' => count(self::$stages));
 }
Пример #21
0
 public static function getOption($module_name, $name, $default_value)
 {
     if (class_exists('\\Bitrix\\Main\\Config\\Option')) {
         $result = \Bitrix\Main\Config\Option::get($module_name, $name, $default_value);
     } else {
         $result = \COption::getOptionString($module_name, $name, $default_value);
     }
     return $result;
 }
Пример #22
0
	/**
	 * <p>Возвращает строковое значение параметра <i>option_id</i>, принадлежащего модулю <i>module_id</i>. Если не установлен параметр <i>site_id</i> то делается попытка найти числовой параметр <i>option_id</i>, принадлежащий модулю <i>module_id</i> для текущего сайта. Если такого параметра нет, возвращается параметр, общий для всех сайтов.</p>
	 *
	 *
	 *
	 *
	 * @param string $module_id  <a href="http://dev.1c-bitrix.ru/api_help/main/general/identifiers.php">Идентификатор модуля</a>.
	 *
	 *
	 *
	 * @param string $option_id  Идентификатор параметра.
	 *
	 *
	 *
	 * @param mixed $default_value = false Значение по умолчанию.<br>Если <i>default_value</i> не задан, то значение для
	 * <i>default_value</i> будет браться из массива с именем ${<i>module_id</i>."_default_option"}
	 * заданного в файле <b>/bitrix/modules/</b><i>module_id</i><b>/default_option.php</b>.
	 *
	 *
	 *
	 * @param string $site_id = false Идентификатор сайта для которого будут возвращены параметры.
	 * Необязательный. По умолчанию - false (для текущего сайта или если не
	 * установлены то общие для всех сайтов)
	 *
	 *
	 *
	 * @return string 
	 *
	 *
	 * <h4>Example</h4> 
	 * <pre>
	 * &lt;?
	 * // получим поле "При регистрации добавлять в группу" 
	 * // из настроек главного модуля
	 * $default_group = <b>COption::GetOptionString</b>("main", "new_user_registration_def_group", "2");
	 * if($default_group!="")
	 *     $arrGroups = explode(",",$default_group);
	 * ?&gt;
	 * </pre>
	 *
	 *
	 *
	 * <h4>See Also</h4> 
	 * <ul> <li>[link=89621]Параметры модуля[/link] </li> <li> <a
	 * href="http://dev.1c-bitrix.ru/api_help/main/settings.php">Настройки главного модуля</a> </li>
	 * <li> <a href="http://dev.1c-bitrix.ru/api_help/main/reference/coption/getoptionint.php">COption::GetOptionInt</a> </li>
	 * </ul><a name="examples"></a>
	 *
	 *
	 * @static
	 * @link http://dev.1c-bitrix.ru/api_help/main/reference/coption/getoptionstring.php
	 * @author Bitrix
	 */
	public static function GetOptionString($module_id, $name, $def="", $site=false, $bExactSite=false)
	{
		if ($bExactSite)
		{
			$v = \Bitrix\Main\Config\Option::getRealValue($module_id, $name, $site);
			return $v === null ? false : $v;
		}

		return \Bitrix\Main\Config\Option::get($module_id, $name, $def, $site);
	}
Пример #23
0
 public function showResult()
 {
     $this->applyJsonHeaders();
     $minifyJson = Option::get('main', 'use_minified_assets', 'N');
     if ($minifyJson == 'Y') {
         echo json_encode($this->arResult, JSON_UNESCAPED_UNICODE);
     } else {
         echo json_encode($this->arResult, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
     }
 }
Пример #24
0
 /**
  * Update session data
  *
  * @param int $id				FuserId.
  * @return void
  */
 protected static function updateSession($id)
 {
     \CSaleUser::updateSessionSaleUserID();
     if ((string) Main\Config\Option::get('sale', 'encode_fuser_id') != 'Y' && isset($_SESSION['SALE_USER_ID'])) {
         $_SESSION['SALE_USER_ID'] = (int) $_SESSION['SALE_USER_ID'];
     }
     if (!isset($_SESSION['SALE_USER_ID']) || (string) $_SESSION['SALE_USER_ID'] == '' || $_SESSION['SALE_USER_ID'] === 0) {
         $_SESSION['SALE_USER_ID'] = $id;
     }
 }
Пример #25
0
 public function getAnchorSchemes()
 {
     if ($this->anchorSchemes === null) {
         static $schemes = null;
         if ($schemes === null) {
             $schemes = \Bitrix\Main\Config\Option::get("main", "~parser_anchor_schemes", "http|https|news|ftp|aim|mailto|file");
         }
         $this->anchorSchemes = $schemes;
     }
     return $this->anchorSchemes;
 }
Пример #26
0
 public static function load()
 {
     $s = Main\Config\Option::get('crm', 'crm_lead_conversion', '', '');
     $params = $s !== '' ? unserialize($s) : null;
     if (!is_array($params)) {
         return null;
     }
     $item = new LeadConversionConfig();
     $item->internalize($params);
     return $item;
 }
 private function __construct()
 {
     $useGZipCompressionOption = \Bitrix\Main\Config\Option::get("bizproc", "use_gzip_compression", "");
     if ($useGZipCompressionOption === "Y") {
         $this->useGZipCompression = true;
     } elseif ($useGZipCompressionOption === "N") {
         $this->useGZipCompression = false;
     } else {
         $this->useGZipCompression = function_exists("gzcompress");
     }
 }
Пример #28
0
 public function __construct()
 {
     $useGZipCompressionOption = \Bitrix\Main\Config\Option::get("bizproc", "use_gzip_compression", "");
     if ($useGZipCompressionOption === "Y") {
         $this->useGZipCompression = true;
     } elseif ($useGZipCompressionOption === "N") {
         $this->useGZipCompression = false;
     } else {
         $this->useGZipCompression = function_exists("gzcompress") && ($GLOBALS["DB"]->type != "ORACLE" || !defined('BX_UTF'));
     }
 }
Пример #29
0
 /**
  * Returns current instance of the React.
  *
  * @return React
  */
 public static function getInstance()
 {
     if (isset(static::$instance)) {
         return static::$instance;
     }
     $documentRoot = rtrim($_SERVER['DOCUMENT_ROOT'], "/\\");
     $moduleId = 'citfact.reactengine';
     $reactPath = sprintf('%s%s', $documentRoot, Option::get($moduleId, 'REACT_SOURCE'));
     $appPath = sprintf('%s%s', $documentRoot, Option::get($moduleId, 'APP_SOURCE'));
     static::$instance = new static($reactPath, $appPath);
     return static::$instance;
 }
Пример #30
0
 /**
  * @param array $arFields
  * @return string
  */
 public static function getLinkSub(array $fields)
 {
     $tag = \Bitrix\Main\Mail\Tracking::getSignedTag(static::MODULE_ID, $fields);
     $urlPage = \Bitrix\Main\Config\Option::get('sender', 'sub_link');
     if ($urlPage == "") {
         $bitrixDirectory = \Bitrix\Main\Application::getInstance()->getPersonalRoot();
         $result = $bitrixDirectory . '/tools/sender_sub_confirm.php?sender_subscription=confirm&tag=' . urlencode($tag);
     } else {
         $result = $urlPage . (strpos($urlPage, "?") === false ? "?" : "&") . 'sender_subscription=confirm&tag=' . urlencode($tag);
     }
     return $result;
 }