当前位置: 首页>>代码示例>>PHP>>正文


PHP Option::get方法代码示例

本文整理汇总了PHP中Bitrix\Main\Config\Option::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Option::get方法的具体用法?PHP Option::get怎么用?PHP Option::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bitrix\Main\Config\Option的用法示例。


在下文中一共展示了Option::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onBeforeElementAddHandler

 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;
 }
开发者ID:ASDAFF,项目名称:citfact.replaceurl,代码行数:32,代码来源:Event.php

示例2: __construct

 public function __construct()
 {
     $interval = (int) Option::get('security', 'totp_interval');
     if ($interval && $interval > 0) {
         $this->interval = $interval;
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:7,代码来源:totpalgorithm.php

示例3: hasProperFilename

 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);
 }
开发者ID:u-mulder,项目名称:bixmigs,代码行数:7,代码来源:bxmg_dispatcher.php

示例4: DoProcessOrder

 /**
  * @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'));
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:37,代码来源:delivery.php

示例5: setPageMeta

 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']));
     }
 }
开发者ID:HannibalLecktor,项目名称:alfa74,代码行数:26,代码来源:metamanager.php

示例6: __construct

 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);
 }
开发者ID:spas-viktor,项目名称:books,代码行数:7,代码来源:hostrestriction.php

示例7: __construct

 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"));
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:7,代码来源:mobile_event.php

示例8: actualizeAgent

 /**
  * @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);
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:37,代码来源:mailingmanager.php

示例9: showTab

    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 
        }
    }
开发者ID:webgksupport,项目名称:alpina,代码行数:27,代码来源:advtabengine.php

示例10: AddBlogPost

 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;
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:35,代码来源:rest.php

示例11: create

 /**
  * @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;
 }
开发者ID:ASDAFF,项目名称:citfact.form,代码行数:30,代码来源:FormFactory.php

示例12: __construct

 public function __construct()
 {
     $window = (int) Option::get('security', 'hotp_user_window', 10);
     if ($window && $window > 0) {
         $this->window = $window;
     }
 }
开发者ID:sharapudinov,项目名称:tovarov.top,代码行数:7,代码来源:hotpalgorithm.php

示例13: getInstalledCurrencies

 /**
  * @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);
     }
 }
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:30,代码来源:currencymanager.php

示例14: needProxyToDiskByDocType

 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;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:28,代码来源:iblocksocnetbizproc.php

示例15: __wd_get_root_section

 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);
         	}
         */
     }
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:59,代码来源:webdav_settings.php


注:本文中的Bitrix\Main\Config\Option::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。