本文整理汇总了PHP中Bitrix\Main\Config\Option::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Option::delete方法的具体用法?PHP Option::delete怎么用?PHP Option::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Main\Config\Option
的用法示例。
在下文中一共展示了Option::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DoUninstall
public function DoUninstall()
{
$this->uninstallFiles();
\Bitrix\Main\Config\Option::delete($this->MODULE_ID);
\Bitrix\Main\ModuleManager::unRegisterModule($this->MODULE_ID);
return true;
}
示例2: reset
public function reset()
{
$this->isPersistent = false;
if ($this->name !== '') {
Main\Config\Option::delete('crm', array('name' => $this->name));
}
}
示例3: set
public function set($value)
{
$value = (int) $value;
if ($value === $this->default) {
Main\Config\Option::delete('crm', array('name' => $this->name));
} else {
Main\Config\Option::set('crm', $this->name, $value, '');
}
}
示例4: UnInstallDB
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);
}
示例5: save
/**
* @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));
}
}
示例6: RemoveOption
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);
}
示例7: UnInstallDB
function UnInstallDB($params = array())
{
UnRegisterModuleDependences('conversion', 'OnGetCounterTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetCounterTypes');
UnRegisterModuleDependences('conversion', 'OnGetAttributeTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetAttributeTypes');
UnRegisterModuleDependences('conversion', 'OnGetAttributeGroupTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetAttributeGroupTypes');
UnRegisterModuleDependences('conversion', 'OnSetDayContextAttributes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onSetDayContextAttributes');
UnRegisterModuleDependences('main', 'OnProlog', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onProlog');
ModuleManager::unRegisterModule('conversion');
if ($params['SAVE_TABLES'] !== 'Y') {
global $DB;
$DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/conversion/install/db/' . strtolower($DB->type) . '/uninstall.sql');
Option::delete('conversion', array('name' => 'START_DATE_TIME'));
Option::delete('conversion', array('name' => 'BASE_CURRENCY'));
Option::delete('conversion', array('name' => 'GENERATE_INITIAL_DATA'));
}
return true;
}
示例8: array
$useSaleDiscountOnly = false;
$saleIsInstalled = ModuleManager::isModuleInstalled('sale');
if ($saleIsInstalled)
{
$useSaleDiscountOnly = (string)Option::get('sale', 'use_sale_discount_only') == 'Y';
}
$applyDiscSaveModeList = CCatalogDiscountSave::GetApplyModeList(true);
if ($_SERVER['REQUEST_METHOD'] == 'GET' && !empty($_REQUEST['RestoreDefaults']) && !$bReadOnly && check_bitrix_sessid())
{
if (!$USER->IsAdmin())
$strValTmp = Option::get('catalog', 'avail_content_groups');
Option::delete('catalog', array());
$z = CGroup::GetList(($v1="id"),($v2="asc"), array("ACTIVE" => "Y", "ADMIN" => "N"));
while($zr = $z->Fetch())
$APPLICATION->DelGroupRight($module_id, array($zr["ID"]));
if (!$USER->IsAdmin())
Option::set('catalog', 'avail_content_groups', $strValTmp, '');
}
$arAllOptions = array(
array("export_default_path", Loc::getMessage("CAT_EXPORT_DEFAULT_PATH"), "/bitrix/catalog_export/", array("text", 30)),
array("default_catalog_1c", Loc::getMessage("CAT_DEF_IBLOCK"), "", array("text", 30)),
array("deactivate_1c_no_price", Loc::getMessage("CAT_DEACT_NOPRICE"), "N", array("checkbox")),
array("yandex_xml_period", Loc::getMessage("CAT_YANDEX_XML_PERIOD"), "24", array("text", 5)),
);
示例9: sprintf
use Bitrix\Main\Application;
use Bitrix\Main\Config\Option;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\Text\String;
if (!$USER->isAdmin()) {
$APPLICATION->authForm('Nope');
}
$app = Application::getInstance();
$context = $app->getContext();
$request = $context->getRequest();
Loc::loadMessages($context->getServer()->getDocumentRoot() . "/bitrix/modules/main/options.php");
Loc::loadMessages(__FILE__);
$tabControl = new CAdminTabControl("tabControl", array(array("DIV" => "edit1", "TAB" => Loc::getMessage("MAIN_TAB_SET"), "TITLE" => Loc::getMessage("MAIN_TAB_TITLE_SET"))));
if ((!empty($save) || !empty($restore)) && $request->isPost() && check_bitrix_sessid()) {
if (!empty($restore)) {
Option::delete(ADMIN_MODULE_NAME);
CAdminMessage::showMessage(array("MESSAGE" => Loc::getMessage("REFERENCES_OPTIONS_RESTORED"), "TYPE" => "OK"));
} elseif ($request->getPost('max_image_size') && $request->getPost('max_image_size') > 0 && $request->getPost('max_image_size') < 100000) {
Option::set(ADMIN_MODULE_NAME, "max_image_size", $request->getPost('max_image_size'));
CAdminMessage::showMessage(array("MESSAGE" => Loc::getMessage("REFERENCES_OPTIONS_SAVED"), "TYPE" => "OK"));
} else {
CAdminMessage::showMessage(Loc::getMessage("REFERENCES_INVALID_VALUE"));
}
}
$tabControl->begin();
?>
<form method="post" action="<?php
echo sprintf('%s?mid=%s&lang=%s', $request->getRequestedPage(), urlencode($mid), LANGUAGE_ID);
?>
">
示例10: array
$db_payments = CSalePaySystem::GetList(array("ID" => "ASC"), array());
$payments = array();
while ($payment = $db_payments->Fetch()) {
$payments[] = array("value" => $payment["ID"], "title" => $payment["NAME"]);
}
$groups = array();
$db_gr = CGroup::GetList($by = "c_sort", $o = "desc", array());
while ($group = $db_gr->Fetch()) {
$groups[] = array("value" => $group["ID"], "title" => $group["NAME"]);
}
$all_options = array(array("domain_gateway", Loc::getMessage("DEVTM_BEGATEWAY_DOMAIN_GATEWAY_DESC"), "text"), array("domain_payment_page", Loc::getMessage("DEVTM_BEGATEWAY_DOMAIN_GATEWAY_PAGE_DESC"), "text"), array("transaction_type", Loc::getMessage("DEVTM_BEGATEWAY_TRANSACTION_TYPE_DESC"), "select", array(array("title" => Loc::getMessage("DEVTM_BEGATEWAY_TRANSACTION_TYPE_PAYMENT_NAME"), "value" => "payment"), array("title" => Loc::getMessage("DEVTM_BEGATEWAY_TRANSACTION_TYPE_AUTHORIZATION_NAME"), "value" => "authorization"))), array("shop_id", Loc::getMessage("DEVTM_BEGATEWAY_SHOP_ID_DESC"), "text"), array("shop_key", Loc::getMessage("DEVTM_BEGATEWAY_SHOP_KEY_DESC"), "text"), array("notification_url", Loc::getMessage("DEVTM_BEGATEWAY_NOTIFICATION_URL_DESC"), "text"), array("success_url", Loc::getMessage("DEVTM_BEGATEWAY_SUCCESS_URL_DESC"), "text"), array("fail_url", Loc::getMessage("DEVTM_BEGATEWAY_FAIL_URL_DESC"), "text"), array("cancel_url", Loc::getMessage("DEVTM_BEGATEWAY_CANCEL_URL_DESC"), "text"), array("form_type", Loc::getMessage("DEVTM_BEGATEWAY_FORM_TYPE_DESC"), "select", array(array("title" => Loc::getMessage("DEVTM_BEGATEWAY_FORM_TYPE_REDIRECT_NAME"), "value" => "redirect"), array("title" => Loc::getMessage("DEVTM_BEGATEWAY_FORM_TYPE_INLINE_NAME"), "value" => "inline"), array("title" => Loc::getMessage("DEVTM_BEGATEWAY_FORM_TYPE_OVERLAY_NAME"), "value" => "overlay"))), array("css_form", Loc::getMessage("DEVTM_BEGATEWAY_CSS_FORM_DESC"), "textarea"), array("payment_system_id", Loc::getMessage("DEVTM_BEGATEWAY_PAYMENT_SYSTEM_DESC"), "select", $payments), array("group_ids", Loc::getMessage("DEVTM_BEGATEWAY_GROUPS_DESC"), "select", $groups));
$tabs = array(array("DIV" => "edit1", "TAB" => Loc::getMessage("DEVTM_BEGATEWAY_TAB_NAME"), "ICON" => "begateway-icon", "TITLE" => Loc::getMessage("DEVTM_BEGATEWAY_TAB_DESC")));
$o_tab = new CAdminTabControl("beGatewayTabControl", $tabs);
if ($REQUEST_METHOD == "POST" && strlen($save . $reset) > 0 && check_bitrix_sessid()) {
if (strlen($reset) > 0) {
\Bitrix\Main\Config\Option::delete($module_id);
} else {
foreach ($all_options as &$option) {
if (isset($_REQUEST[$option[0]])) {
if ($option[2] == "text" || $option[2] == "textarea") {
\Bitrix\Main\Config\Option::set($module_id, $option[0], $_REQUEST[$option[0]]);
} else {
if ($option[2] == "select") {
foreach ($option[3] as $k => &$v) {
if (is_array($_REQUEST[$option[0]]) && in_array($v["value"], $_REQUEST[$option[0]])) {
\Bitrix\Main\Config\Option::set($module_id, $option[0], implode("|", $_REQUEST[$option[0]]));
break;
} elseif ($_REQUEST[$option[0]] == $v["value"]) {
\Bitrix\Main\Config\Option::set($module_id, $option[0], $_REQUEST[$option[0]]);
break;
}
示例11: GetConfig
function GetConfig($siteId = false)
{
global $APPLICATION;
$shopLocationId = CSaleHelper::getShopLocationId($siteId);
$arShopLocation = \CSaleHelper::getLocationByIdHitCached($shopLocationId);
if (!$arShopLocation) {
$arShopLocation = array();
}
if (isset($_REQUEST["SET_DEFAULT_TARIF_ZONES"]) && $_REQUEST["SET_DEFAULT_TARIF_ZONES"] == "Y") {
Option::delete('sale', array('name' => 'delivery_rus_post_prev_loc'));
}
$shopPrevLocationId = Option::get('sale', 'delivery_rus_post_prev_loc', "");
/* if shop's location was changed */
if (strlen($shopPrevLocationId) <= 0 || $shopPrevLocationId != $shopLocationId) {
Option::set('sale', 'delivery_rus_post_prev_loc', $shopLocationId);
Option::delete('sale', array('name' => 'delivery_regs_to_zones'));
Option::delete('sale', array('name' => 'delivery_rus_post_tarifs'));
}
$arConfig = array('CONFIG_GROUPS' => array('zones' => GetMessage('SALE_DH_RP_CONFIG_GROUP_ZONES'), 'tarifs' => GetMessage('SALE_DH_RP_CONFIG_GROUP_TARIFS'), 'land' => GetMessage('SALE_DH_RP_CONFIG_GROUP_LAND'), 'avia' => GetMessage('SALE_DH_RP_CONFIG_GROUP_AVIA')));
// Zones tab
$arRegions = CSaleDeliveryHelper::getRegionsList();
$arZones = array();
$arZones[0] = GetMessage('SALE_DH_RP_CONFIG_ZONES_EMPTY');
for ($i = 1; $i <= self::$ZONES_COUNT; $i++) {
$arZones[$i] = GetMessage('SALE_DH_RP_CONFIG_ZONE') . ' ' . $i;
}
$arRegsToZones = CSaleHelper::getOptionOrImportValues('delivery_regs_to_zones', array('CDeliveryRusPost', 'importZonesFromCsv'), array($arShopLocation));
$arConfig['CONFIG']['SET_DEFAULT_TARIF_ZONES'] = array('TYPE' => 'CUSTOM', 'TITLE' => GetMessage('SALE_DH_RP_SET_DEFAULT_TARIF_ZONES'), 'GROUP' => 'zones', 'DEFAULT' => '<a href="' . $APPLICATION->GetCurPageParam('', array('SET_DEFAULT_TARIF_ZONES')) . '&SET_DEFAULT_TARIF_ZONES=Y">' . GetMessage('SALE_DH_RP_SET_DEFAULT_TARIF_ZONES_SET') . '</a>');
foreach ($arRegions as $regId => $regName) {
$codeByName = self::getRegionCodeByOldName($regName);
// old location
$code = strlen($codeByName) > 0 ? $codeByName : $regId;
if (isset($arRegsToZones[$code])) {
$arConfig['CONFIG']['REG_' . $code] = array('TYPE' => 'DROPDOWN', 'DEFAULT' => isset($arRegsToZones[$code]) ? $arRegsToZones[$code] : '0', 'TITLE' => $regName, 'GROUP' => 'zones', 'VALUES' => $arZones);
}
}
/*
tarifs tab
1. land
1.1. Base Price
*/
$arConfig['CONFIG']['tarif_section_1'] = array('TYPE' => 'SECTION', 'TITLE' => GetMessage('SALE_DH_RP_WEIGHT_LESS'), 'GROUP' => 'tarifs');
$arTarifs = CSaleHelper::getOptionOrImportValues('delivery_rus_post_tarifs', array('CDeliveryRusPost', 'getTarifsByRegionFromCsv'), array($arShopLocation));
foreach ($arZones as $zoneId => $zoneName) {
if ($zoneId <= 0) {
continue;
}
$tarifId = self::$TARIF_LESS_500[$zoneId];
$arConfig['CONFIG']['ZONE_RATE_MAIN_' . $zoneId] = array('TYPE' => 'STRING', 'DEFAULT' => isset($arTarifs[$tarifId]) ? $arTarifs[$tarifId] : '0', 'TITLE' => $zoneName, 'GROUP' => 'tarifs');
}
$arConfig['CONFIG']['tarif_section_2'] = array('TYPE' => 'SECTION', 'TITLE' => GetMessage('SALE_DH_RP_WEIGHT_MORE'), 'GROUP' => 'tarifs');
foreach ($arZones as $zoneId => $zoneName) {
if ($zoneId <= 0) {
continue;
}
$tarifId = self::$TARIF_MORE_500[$zoneId];
$arConfig['CONFIG']['ZONE_RATE_ADD_' . $zoneId] = array('TYPE' => 'STRING', 'DEFAULT' => isset($arTarifs[$tarifId]) ? $arTarifs[$tarifId] : '0', 'TITLE' => $zoneName, 'GROUP' => 'tarifs');
}
/* Additional services */
$arConfig['CONFIG']['tarif_add_services'] = array('TYPE' => 'SECTION', 'TITLE' => GetMessage('SALE_DH_RP_ADD_SRV'), 'GROUP' => 'tarifs');
/* 1.2 Service heavy weight 10 - 20 kg */
$tarifId = self::$TARIF_HEAVY_WEIGHT;
$arConfig['CONFIG']['service_' . $tarifId . '_enabled'] = array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_RP_SRV_HEAVY'), 'GROUP' => 'tarifs', 'DEFAULT' => 'Y', 'HIDE_BY_NAMES' => array('service_' . $tarifId . '_value'));
$arConfig['CONFIG']['service_' . $tarifId . '_value'] = array('TYPE' => 'STRING', 'TITLE' => GetMessage('SALE_DH_RP_SRV_HEAVY_VAL') . ' %', 'GROUP' => 'tarifs', 'DEFAULT' => isset($arTarifs[$tarifId]) ? $arTarifs[$tarifId] : '0');
/* 1.5 Service fragile */
$tarifId = self::$TARIF_FRAGILE;
$arConfig['CONFIG']['service_' . $tarifId . '_enabled'] = array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_RP_SRV_FRGL'), 'GROUP' => 'tarifs', 'DEFAULT' => 'Y', 'HIDE_BY_NAMES' => array('service_' . $tarifId . '_value'), 'TOP_LINE' => 'Y');
$arConfig['CONFIG']['service_' . $tarifId . '_value'] = array('TYPE' => 'STRING', 'TITLE' => GetMessage('SALE_DH_RP_SRV_FRGL_VAL') . ' %', 'GROUP' => 'tarifs', 'DEFAULT' => isset($arTarifs[$tarifId]) ? $arTarifs[$tarifId] : '0');
/* 4. Service declared value */
$tarifId = self::$TARIF_DECLARED_VAL;
$arConfig['CONFIG']['service_' . $tarifId . '_enabled'] = array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_RP_SRV_DECL'), 'GROUP' => 'tarifs', 'DEFAULT' => 'Y', 'HIDE_BY_NAMES' => array('service_' . $tarifId . '_value'), 'TOP_LINE' => 'Y');
$arConfig['CONFIG']['service_' . $tarifId . '_value'] = array('TYPE' => 'STRING', 'TITLE' => GetMessage('SALE_DH_RP_SRV_DECL_VAL'), 'GROUP' => 'tarifs', 'DEFAULT' => isset($arTarifs[$tarifId]) ? $arTarifs[$tarifId] : '0');
// land tab
$aviableBoxes = self::getAviableBoxes();
foreach ($aviableBoxes as $boxId => $arBox) {
CSaleDeliveryHelper::makeBoxConfig($boxId, $arBox, 'land', $arConfig);
}
/* 2.1 avia tab*/
foreach ($aviableBoxes as $boxId => $arBox) {
CSaleDeliveryHelper::makeBoxConfig($boxId, $arBox, 'avia', $arConfig);
}
$tarifId = self::$TARIF_AVIA_STANDART;
$arConfig['CONFIG']['tarif_avia_services'] = array('TYPE' => 'SECTION', 'TITLE' => GetMessage('SALE_DH_RP_TARIFS_AVIA'), 'GROUP' => 'avia');
$arConfig['CONFIG']['tarif_avia_' . $tarifId . '_value'] = array('TYPE' => 'STRING', 'TITLE' => GetMessage('SALE_DH_RP_TARIF_AVIA_STNDRT'), 'GROUP' => 'avia', 'DEFAULT' => isset($arTarifs[$tarifId]) ? $arTarifs[$tarifId] : '0');
$tarifId = self::$TARIF_AVIA_HEAVY;
$arConfig['CONFIG']['tarif_avia_' . $tarifId . '_value'] = array('TYPE' => 'STRING', 'TITLE' => GetMessage('SALE_DH_RP_TARIF_AVIA_HEAVY'), 'GROUP' => 'avia', 'DEFAULT' => isset($arTarifs[$tarifId]) ? $arTarifs[$tarifId] : '0');
return $arConfig;
}
示例12: deleteLinkUsageOption
private static function deleteLinkUsageOption()
{
Config\Option::delete("sale", array('name' => static::getLinkOptionName()));
}
示例13: Array
$allOptions = Array(
array("IBLOCK_ID",Loc::getMessage('IBLOCK_ID'),"text",""),
array("PROPERTY_NAME",Loc::getMessage('PROPERTY_NAME'),"text","Главный раздел"),
array("PROPERTY_CODE",Loc::getMessage('PROPERTY_CODE'),"text", "MAIN_SECTION"),
array("ADD_PROPERTY",Loc::getMessage('ADD_PROPERTY'),"checkbox",""),
);
$controlTabs = array(
array("DIV" => "edit1", "TAB" => Loc::getMessage('REPLACEURL_TAB'), "TITLE" => Loc::getMessage('REPLACEURL_TAB_TITLE')),
);
$tabControl = new CAdminTabControl("tabControl", $controlTabs);
$arNotes = array();
if ($request->isPost() && $request->getPost('RESTORE_DEFAULTS')){
Config\Option::delete($moduleId);
}
if ($request->isPost() && $request->getPost('UPDATE')){
foreach($allOptions as $option)
{
if($option[2] != "checkbox"){
$value = $request->getPost($option[0]);
if(!empty($value)){
Config\Option::set($moduleId, $option[0], $value);
}else{
$arNotes[] = "Поле не может быть пустым";
}
}
}
}
示例14: save
public function save()
{
self::$currentSettings = $this->settings;
\Bitrix\Main\Config\Option::delete('crm', array('name' => 'dup_ctrl'));
\Bitrix\Main\Config\Option::set('crm', 'dup_ctrl', serialize(self::$currentSettings));
}
示例15: uninstallDB
public function uninstallDB()
{
Loader::includeModule($this->MODULE_ID);
Application::getConnection(\Shantilab\YandexDirect\AccountsTable::getConnectionName())->queryExecute('drop table if exists ' . Base::getInstance('\\Shantilab\\YandexDirect\\AccountsTable')->getDBTableName());
Option::delete($this->MODULE_ID);
}