Esempio n. 1
1
 protected static function save()
 {
     $ary = array();
     foreach (self::$items as $entityTypeID => $time) {
         $ary[\CCrmOwnerType::ResolveName($entityTypeID)] = $time->format(\DateTime::ISO8601);
     }
     Main\Config\Option::set('crm', 'crm_uf_history', serialize($ary), '');
 }
Esempio n. 2
0
 public function DoUninstall()
 {
     $this->uninstallFiles();
     \Bitrix\Main\Config\Option::delete($this->MODULE_ID);
     \Bitrix\Main\ModuleManager::unRegisterModule($this->MODULE_ID);
     return true;
 }
Esempio n. 3
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'));
     }
 }
Esempio n. 4
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"));
     }
 }
Esempio n. 5
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 
        }
    }
Esempio n. 6
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;
 }
Esempio n. 7
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;
     }
 }
Esempio n. 8
0
 public function __construct()
 {
     $window = (int) Option::get('security', 'hotp_user_window', 10);
     if ($window && $window > 0) {
         $this->window = $window;
     }
 }
Esempio n. 9
0
 public function reset()
 {
     $this->isPersistent = false;
     if ($this->name !== '') {
         Main\Config\Option::delete('crm', array('name' => $this->name));
     }
 }
Esempio n. 10
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;
 }
Esempio n. 11
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;
 }
Esempio n. 12
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);
         }
     }
 }
Esempio n. 13
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']));
     }
 }
Esempio n. 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);
 }
Esempio n. 15
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);
 }
Esempio n. 16
0
 public function __construct()
 {
     $interval = (int) Option::get('security', 'totp_interval');
     if ($interval && $interval > 0) {
         $this->interval = $interval;
     }
 }
Esempio n. 17
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);
         	}
         */
     }
 }
Esempio n. 18
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;
 }
Esempio n. 19
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);
     }
 }
Esempio n. 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));
 }
Esempio n. 21
0
 function UnInstallDB()
 {
     Loader::includeModule($this->MODULE_ID);
     // Drop PersonTable
     Application::getConnection(\Adelshin\Person\PersonTable::getConnectionName())->queryExecute('drop table if exists ' . Base::getInstance('\\Adelshin\\Person\\PersonTable')->getDBTableName());
     // Drop GroupTable
     Application::getConnection(\Adelshin\Person\GroupsTable::getConnectionName())->queryExecute('drop table if exists ' . Base::getInstance('\\Adelshin\\Person\\GroupsTable')->getDBTableName());
     Option::delete($this->MODULE_ID);
 }
Esempio n. 22
0
 function DoInstall()
 {
     global $APPLICATION;
     RegisterModule($this->MODULE_ID);
     RegisterModuleDependences('main', 'OnBeforeEventSend', $this->MODULE_ID, '\\Um\\MailTemplate\\HandlerFacade', 'execute');
     \Bitrix\Main\Config\Option::set($this->MODULE_ID, 'tpl_class_name', '\\Um\\MailTemplate\\TwigPoweredTemplateHandler');
     \Bitrix\Main\Config\Option::set($this->MODULE_ID, 'tpl_class_path', '/bitrix/modules/' . $this->MODULE_ID . '/lib/twig_powered.template.handler.php');
     $APPLICATION->IncludeAdminFile(GetMessage('UMT_INSTALL_TITLE'), $this->install_path . '/step.php');
 }
Esempio n. 23
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;
 }
Esempio n. 24
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);
     }
 }
Esempio n. 25
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;
     }
 }
Esempio n. 26
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;
 }
 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");
     }
 }
Esempio n. 28
0
 public static function RemoveOption($module_id, $name = "", $site = false)
 {
     $filter = array();
     if (strlen($name) > 0) {
         $filter["name"] = $name;
     }
     if (strlen($site) > 0) {
         $filter["site_id"] = $site;
     }
     \Bitrix\Main\Config\Option::delete($module_id, $filter);
 }
Esempio n. 29
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'));
     }
 }
 /**
  * @return void
  */
 public function save()
 {
     if ($this->bindings === null) {
         return;
     }
     if (!empty($this->bindings)) {
         Main\Config\Option::set('crm', $this->typeName, serialize($this->bindings));
     } else {
         Main\Config\Option::delete('crm', array('name' => $this->typeName));
     }
 }