示例#1
0
define('CATALOG_NEW_OFFERS_IBLOCK_NEED','-1');

$bReadOnly = !$USER->CanDoOperation('catalog_settings');
if ($USER->CanDoOperation('catalog_read') || !$bReadOnly)
{
	Loader::includeModule('catalog');
	Loc::loadMessages(__FILE__);

	$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, '');
	}