Exemplo n.º 1
0
 public function DoUninstall()
 {
     $this->uninstallFiles();
     \Bitrix\Main\Config\Option::delete($this->MODULE_ID);
     \Bitrix\Main\ModuleManager::unRegisterModule($this->MODULE_ID);
     return true;
 }
Exemplo n.º 2
0
 public function DoUninstall()
 {
     $this->UnInstallFiles();
     ModuleManager::unRegisterModule($this->MODULE_ID);
     $eventManager = \Bitrix\Main\EventManager::getInstance();
     $eventManager->unRegisterEventHandler("fileman", "OnBeforeHTMLEditorScriptRuns", $this->MODULE_ID, '\\Newkaliningrad\\Typografru\\Typograf', "onBeforeHTMLEditorScriptRuns");
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if (!Loader::includeModule('search')) {
         throw new BitrixException('Search module is not installed');
     }
     $searchResult = array();
     $bar = new ProgressBar($output, 0);
     do {
         $bar->display();
         $searchResult = \CSearch::ReIndexAll($input->getOption('full'), static::UPDATE_TIME, $searchResult);
         $bar->advance();
         $bar->clear();
         if (is_array($searchResult) && $searchResult['MODULE'] == 'main') {
             list(, $path) = explode("|", $searchResult["ID"], 2);
             $output->writeln("\r       " . $path, OutputInterface::VERBOSITY_VERBOSE);
         }
     } while (is_array($searchResult));
     $bar->finish();
     $bar->clear();
     $output->write("\r");
     if (ModuleManager::isModuleInstalled('socialnetwork')) {
         $output->writeln('<info>The Social Network module needs to be reindexed using the Social Network component in the public section of site.</info>');
     }
     $output->writeln(sprintf('<info>Reindexed</info> %d element%s.', $searchResult, $searchResult > 1 ? 's' : ''));
     return 0;
 }
Exemplo n.º 4
0
 /**
  * Gets security context (access provider) for user.
  * Attention! File/Folder can use anywhere and SecurityContext have to check rights anywhere (any module).
  * @param mixed $user User which use for check rights.
  * @return SecurityContext
  */
 public function getSecurityContextByUser($user)
 {
     if ($this->isCurrentUser($user)) {
         /** @noinspection PhpDynamicAsStaticMethodCallInspection */
         if (Loader::includeModule('socialnetwork') && \CSocnetUser::isCurrentUserModuleAdmin()) {
             return new FakeSecurityContext($user);
         }
         if (UserModel::isCurrentUserAdmin()) {
             return new FakeSecurityContext($user);
         }
     } else {
         $userId = UserModel::resolveUserId($user);
         /** @noinspection PhpDynamicAsStaticMethodCallInspection */
         if ($userId && Loader::includeModule('socialnetwork') && \CSocnetUser::isUserModuleAdmin($userId)) {
             return new FakeSecurityContext($user);
         }
         try {
             if ($userId && ModuleManager::isModuleInstalled('bitrix24') && Loader::includeModule('bitrix24') && \CBitrix24::isPortalAdmin($userId)) {
                 return new FakeSecurityContext($user);
             } elseif ($userId) {
                 //Check user group 1 ('Admins')
                 $tmpUser = new \CUser();
                 $arGroups = $tmpUser->getUserGroup($userId);
                 if (in_array(1, $arGroups)) {
                     return new FakeSecurityContext($user);
                 }
             }
         } catch (\Exception $e) {
         }
     }
     return new DiskSecurityContext($user);
 }
Exemplo n.º 5
0
 function DoUninstall()
 {
     $this->unInstallDB();
     $this->unInstallFiles();
     ModuleManager::unRegisterModule($this->MODULE_ID);
     $GLOBALS['APPLICATION']->IncludeAdminFile(GetMessage("UMBM_UNINSTALL_TITLE"), $this->install_source . 'unstep.php');
 }
Exemplo n.º 6
0
 public function UnInstallDB($arParams = array())
 {
     global $errors;
     //COption::RemoveOption($this->getModuleId());
     \Bitrix\Main\ModuleManager::unRegisterModule($this->MODULE_ID);
     return true;
 }
Exemplo n.º 7
0
    public function doUninstall()
    {
        ModuleManager::unregisterModule($this->MODULE_ID);
        $this->UnInstallFiles();
        $this->uninstallDB();

        UnRegisterModuleDependences('iblock', 'OnBeforeIBlockElementDelete', $this->MODULE_ID, '\Iiko\Event', 'onIBlockElementDelete');
    }
Exemplo n.º 8
0
 public static function getActiveUsersCount()
 {
     $sql = "SELECT COUNT(ID) " . "FROM b_user " . "WHERE ACTIVE = 'Y' " . "   AND LAST_LOGIN IS NOT NULL";
     if (ModuleManager::isModuleInstalled("intranet")) {
         $sql = "SELECT COUNT(U.ID) " . "FROM b_user U " . "WHERE U.ACTIVE = 'Y' " . "   AND U.LAST_LOGIN IS NOT NULL " . "   AND EXISTS(" . "       SELECT 'x' " . "       FROM b_utm_user UF, b_user_field F " . "       WHERE F.ENTITY_ID = 'USER' " . "           AND F.FIELD_NAME = 'UF_DEPARTMENT' " . "           AND UF.FIELD_ID = F.ID " . "           AND UF.VALUE_ID = U.ID " . "           AND UF.VALUE_INT IS NOT NULL " . "           AND UF.VALUE_INT <> 0" . "   )";
     }
     $connection = Application::getConnection();
     return $connection->queryScalar($sql);
 }
Exemplo n.º 9
0
 /**
  * Check if user is extranet user
  * @param integer $userID User ID
  * @return boolean
  */
 public static function isExternalUser($userID)
 {
     if (!ModuleManager::isModuleInstalled('extranet')) {
         return false;
     }
     $dbResult = \CUser::getList($o = 'ID', $b = 'ASC', array('ID_EQUAL_EXACT' => $userID), array('FIELDS' => array('ID'), 'SELECT' => array('UF_DEPARTMENT')));
     $user = $dbResult->Fetch();
     return !(is_array($user) && isset($user['UF_DEPARTMENT']) && isset($user['UF_DEPARTMENT'][0]) && $user['UF_DEPARTMENT'][0] > 0);
 }
Exemplo n.º 10
0
 public static function isPaidLicense()
 {
     if (self::$isLicensePaid !== null) {
         return self::$isLicensePaid;
     }
     if (!(ModuleManager::isModuleInstalled('bitrix24') && Loader::includeModule('bitrix24')) && method_exists('CBitrix24', 'IsLicensePaid')) {
         return self::$isLicensePaid = false;
     }
     return self::$isLicensePaid = \CBitrix24::IsLicensePaid();
 }
Exemplo n.º 11
0
 function UnInstallDB($arParams = 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');
     global $DB;
     $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/conversion/install/db/' . strtolower($DB->type) . '/uninstall.sql');
     ModuleManager::unRegisterModule('conversion');
     return true;
 }
Exemplo n.º 12
0
 public static function IsAdmin($userID = 0)
 {
     if (!is_int($userID)) {
         $userID = is_numeric($userID) ? (int) $userID : 0;
     }
     $result = false;
     if ($userID <= 0) {
         $user = CCrmSecurityHelper::GetCurrentUser();
         $userID = $user->GetID();
         if ($userID <= 0) {
             false;
         }
         if (isset(self::$USER_ADMIN_FLAGS[$userID])) {
             return self::$USER_ADMIN_FLAGS[$userID];
         }
         $result = $user->IsAdmin();
         if ($result) {
             self::$USER_ADMIN_FLAGS[$userID] = true;
             return true;
         }
         try {
             if (\Bitrix\Main\ModuleManager::isModuleInstalled('bitrix24') && CModule::IncludeModule('bitrix24')) {
                 if (class_exists('CBitrix24') && method_exists('CBitrix24', 'IsPortalAdmin')) {
                     // New style check
                     $result = CBitrix24::IsPortalAdmin($userID);
                 } else {
                     // Check user group 1 ('Portal admins')
                     $arGroups = $user->GetUserGroup($userID);
                     $result = in_array(1, $arGroups);
                 }
             }
         } catch (Exception $e) {
         }
     } else {
         if (isset(self::$USER_ADMIN_FLAGS[$userID])) {
             return self::$USER_ADMIN_FLAGS[$userID];
         }
         try {
             if (IsModuleInstalled('bitrix24') && CModule::IncludeModule('bitrix24') && class_exists('CBitrix24') && method_exists('CBitrix24', 'IsPortalAdmin')) {
                 // Bitrix24 context new style check
                 $result = CBitrix24::IsPortalAdmin($userID);
             } else {
                 //Check user group 1 ('Admins')
                 $user = new CUser();
                 $arGroups = $user->GetUserGroup($userID);
                 $result = in_array(1, $arGroups);
             }
         } catch (Exception $e) {
         }
     }
     self::$USER_ADMIN_FLAGS[$userID] = $result;
     return $result;
 }
Exemplo n.º 13
0
	public static function initDiscountSettings()
	{
		if (self::$useSaleDiscount === null)
		{
			self::$useSaleDiscount = ModuleManager::isModuleInstalled('sale') && (string)Option::get('sale', 'use_sale_discount_only') == 'Y';
		}
		if (self::$getPercentFromBasePrice === null)
		{
			$moduleID = (self::$useSaleDiscount ? 'sale' : 'catalog');
			self::$getPercentFromBasePrice = (string)Option::get($moduleID, 'get_discount_percent_from_base_price') == 'Y';
		}
	}
Exemplo n.º 14
0
 public static function onUserLoginSocserv($params)
 {
     global $USER;
     if ($params['EXTERNAL_AUTH_ID'] === \CSocServBitrix24Net::ID && \Bitrix\Main\ModuleManager::isModuleInstalled('bitrix24')) {
         $notificationOptions = \CUserOptions::getOption("socialservices", "notifications", array());
         $lastDate = 0;
         if (isset($notificationOptions["CONTACTS_NOTIFY_DATE"])) {
             $lastDate = $notificationOptions["CONTACTS_NOTIFY_DATE"];
         }
         if ($lastDate < time() - 86400) {
             static::notifyPossible($USER->getId());
             $notificationOptions["CONTACTS_NOTIFY_DATE"] = time();
             \CUserOptions::setOption("socialservices", "notifications", $notificationOptions);
         }
     }
 }
Exemplo n.º 15
0
 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;
 }
Exemplo n.º 16
0
 function buildSaleAdminMobileMenu()
 {
     $items = array(array("text" => GetMessage("SMOB_ALL_ORDERS"), "data-url" => "/bitrix/admin/mobile/sale_orders_list.php", "data-pageid" => "orders_list", "default" => true, "push-param" => "sl"), array("text" => GetMessage("SMOB_WAITING_FOR_PAY"), "data-url" => "/bitrix/admin/mobile/sale_orders_list.php?action=get_filtered&filter_name=waiting_for_pay", "data-pageid" => "orders_waiting_for_pay"), array("text" => GetMessage("SMOB_WAITING_FOR_DELIVERY"), "data-url" => "/bitrix/admin/mobile/sale_orders_list.php?action=get_filtered&filter_name=waiting_for_delivery", "data-pageid" => "orders_waiting_for_delivery"));
     if (\Bitrix\Main\ModuleManager::isModuleInstalled("pull")) {
         $items[] = array("text" => GetMessage("SMOB_PUSH_SETTINGS"), "data-url" => "/bitrix/admin/mobile/sale_orders_push.php", "data-pageid" => "orders_push");
     }
     $arMenu = array(array("text" => GetMessage("SMOB_ORDERS_MANAGEMENT"), "type" => "section", "items" => $items));
     $arRepMenu = self::getMobileReports();
     if ($arRepMenu) {
         $arMenu[] = $arRepMenu;
     }
     $startSortMenuPosition = 200;
     foreach ($arMenu as $key => $item) {
         $item["sort"] = $key + $startSortMenuPosition;
         CAdminMobileMenu::addItem($item);
     }
     return true;
 }
Exemplo n.º 17
0
 public static function getModules()
 {
     if (!($modules =& self::$modules)) {
         $default = array('ACTIVE' => !ModuleManager::isModuleInstalled('sale'));
         foreach (array(AttributeManager::getTypesInternal(), CounterManager::getTypesInternal(), RateManager::getTypesInternal()) as $types) {
             foreach ($types as $type) {
                 $modules[$type['MODULE']] = $default;
             }
         }
         if ($modules['sale']) {
             $modules['sale']['ACTIVE'] = true;
         }
         $modules = unserialize(Option::get('conversion', 'MODULES', 'a:0:{}')) + $modules;
         // TODO all modules with attributes must be active
         $modules['conversion'] = $modules['abtest'] = $modules['sender'] = $modules['seo'] = array('ACTIVE' => true);
         ksort($modules);
     }
     return $modules;
 }
Exemplo n.º 18
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$arTemplateParameters['LINE_ELEMENT_COUNT'] = array("PARENT" => "VISUAL", "NAME" => GetMessage("SRP_LINE_ELEMENT_COUNT"), "TYPE" => "STRING", "DEFAULT" => "3");
$arThemes = array();
if (\Bitrix\Main\ModuleManager::isModuleInstalled('bitrix.eshop')) {
    $arThemes['site'] = GetMessage('SRP_TPL_THEME_SITE');
}
$arThemesList = array('blue' => GetMessage('SRP_TPL_THEME_BLUE'), 'green' => GetMessage('SRP_TPL_THEME_GREEN'), 'red' => GetMessage('SRP_TPL_THEME_RED'), 'wood' => GetMessage('SRP_TPL_THEME_WOOD'), 'yellow' => GetMessage('SRP_TPL_THEME_YELLOW'), 'black' => GetMessage('SRP_TPL_THEME_BLACK'));
$dir = trim(preg_replace("'[\\\\/]+'", "/", dirname(__FILE__) . "/themes/"));
if (is_dir($dir)) {
    foreach ($arThemesList as $themeID => $themeName) {
        if (!is_file($dir . $themeID . '/style.css')) {
            continue;
        }
        $arThemes[$themeID] = $themeName;
    }
}
$arTemplateParameters['TEMPLATE_THEME'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage("SRP_TPL_TEMPLATE_THEME"), 'TYPE' => 'LIST', 'VALUES' => $arThemes, 'DEFAULT' => 'blue', 'ADDITIONAL_VALUES' => 'Y');
$message = null;

try
{
	$currentUser = $engine->getCurrentUser();
}
catch(Exception $e)
{
	$currentUser = null;
	$bNeedAuth = true;
}

$bReadOnly = $bNeedAuth;
$bAllowUpdate = !$bNeedAuth;
$bSale = Main\ModuleManager::isModuleInstalled('sale')
	&& Main\ModuleManager::isModuleInstalled('catalog')
	&& Main\Loader::includeModule('currency');

$request = Main\Context::getCurrent()->getRequest();

$back_url = isset($request["back_url"]) ? $request["back_url"] : '';

$campaignId = intval($request["campaign"]);
$elementId = intval($request["element"]);
$ID = intval($request["ID"]);

if($ID > 0)
{
	$dbRes = Adv\YandexBannerTable::getByPrimary($ID);
	$banner = $dbRes->fetch();
	if($banner)
Exemplo n.º 20
0
    if (ModuleManager::isModuleInstalled("blog")) {
        $arTemplateParameters['BLOG_USE'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_BLOG_USE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
        if (isset($arCurrentValues['BLOG_USE']) && $arCurrentValues['BLOG_USE'] == 'Y') {
            $arTemplateParameters['BLOG_URL'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_BLOG_URL'), 'TYPE' => 'STRING', 'DEFAULT' => 'catalog_comments');
            $arTemplateParameters['BLOG_EMAIL_NOTIFY'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_BLOG_EMAIL_NOTIFY'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N');
        }
    }
    $boolRus = false;
    $langBy = "id";
    $langOrder = "asc";
    $rsLangs = CLanguage::GetList($langBy, $langOrder, array('ID' => 'ru', "ACTIVE" => "Y"));
    if ($arLang = $rsLangs->Fetch()) {
        $boolRus = true;
    }
    if ($boolRus) {
        $arTemplateParameters['VK_USE'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_VK_USE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
        if (isset($arCurrentValues['VK_USE']) && 'Y' == $arCurrentValues['VK_USE']) {
            $arTemplateParameters['VK_API_ID'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_VK_API_ID'), 'TYPE' => 'STRING', 'DEFAULT' => 'API_ID');
        }
    }
    $arTemplateParameters['FB_USE'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_FB_USE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
    if (isset($arCurrentValues['FB_USE']) && 'Y' == $arCurrentValues['FB_USE']) {
        $arTemplateParameters['FB_APP_ID'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_FB_APP_ID'), 'TYPE' => 'STRING', 'DEFAULT' => '');
    }
}
if (ModuleManager::isModuleInstalled("highloadblock")) {
    $arTemplateParameters['BRAND_USE'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_BRAND_USE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
    if (isset($arCurrentValues['BRAND_USE']) && $arCurrentValues['BRAND_USE'] == 'Y') {
        $arTemplateParameters['BRAND_PROP_CODE'] = array('PARENT' => 'VISUAL', "NAME" => GetMessage("CP_BCE_TPL_BRAND_PROP_CODE"), "TYPE" => "LIST", "VALUES" => $arHighloadPropList, "MULTIPLE" => "Y", "ADDITIONAL_VALUES" => "Y");
    }
}
Exemplo n.º 21
0
					<span class="site-speed-stat-value" id="site-speed-composite"></span>
				</div>
			</div>

			<div class="site-speed-explanation">
				<b><?php 
echo Loc::getMessage("MAIN_SITE_SPEED_TITLE");
?>
</b> &mdash; <?php 
echo Loc::getMessage("MAIN_SITE_SPEED_TITLE_DESC");
?>
			</div>

			<div class="site-speed-perf" id="site-speed-perf">
				<?php 
if (\Bitrix\Main\ModuleManager::isModuleInstalled("perfmon")) {
    $mark = (double) COption::GetOptionString("perfmon", "mark_php_page_rate", "");
    ?>
					<a href="/bitrix/admin/perfmon_panel.php?lang=<?php 
    echo LANGUAGE_ID;
    ?>
" class="site-speed-perf-label"><?php 
    echo Loc::getMessage("MAIN_SITE_SPEED_PERF");
    ?>
</a>:<span class="site-speed-perf-value"><?php 
    if ($mark > 0) {
        echo $mark;
    } else {
        echo Loc::getMessage("MAIN_SITE_SPEED_PERF_NO_RES");
    }
    ?>
Exemplo n.º 22
0
if (isset($arParams['USE_COMMON_SETTINGS_BASKET_POPUP']) && $arParams['USE_COMMON_SETTINGS_BASKET_POPUP'] == 'Y') {
    $basketAction = isset($arParams['COMMON_ADD_TO_BASKET_ACTION']) ? $arParams['COMMON_ADD_TO_BASKET_ACTION'] : '';
} else {
    $basketAction = isset($arParams['SECTION_ADD_TO_BASKET_ACTION']) ? $arParams['SECTION_ADD_TO_BASKET_ACTION'] : '';
}
$intSectionID = 0;
$intSectionID = $APPLICATION->IncludeComponent("bitrix:catalog.section", "", array("IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"], "IBLOCK_ID" => $arParams["IBLOCK_ID"], "ELEMENT_SORT_FIELD" => $arParams["ELEMENT_SORT_FIELD"], "ELEMENT_SORT_ORDER" => $arParams["ELEMENT_SORT_ORDER"], "ELEMENT_SORT_FIELD2" => $arParams["ELEMENT_SORT_FIELD2"], "ELEMENT_SORT_ORDER2" => $arParams["ELEMENT_SORT_ORDER2"], "PROPERTY_CODE" => $arParams["LIST_PROPERTY_CODE"], "META_KEYWORDS" => $arParams["LIST_META_KEYWORDS"], "META_DESCRIPTION" => $arParams["LIST_META_DESCRIPTION"], "BROWSER_TITLE" => $arParams["LIST_BROWSER_TITLE"], "SET_LAST_MODIFIED" => $arParams["SET_LAST_MODIFIED"], "INCLUDE_SUBSECTIONS" => $arParams["INCLUDE_SUBSECTIONS"], "BASKET_URL" => $arParams["BASKET_URL"], "ACTION_VARIABLE" => $arParams["ACTION_VARIABLE"], "PRODUCT_ID_VARIABLE" => $arParams["PRODUCT_ID_VARIABLE"], "SECTION_ID_VARIABLE" => $arParams["SECTION_ID_VARIABLE"], "PRODUCT_QUANTITY_VARIABLE" => $arParams["PRODUCT_QUANTITY_VARIABLE"], "PRODUCT_PROPS_VARIABLE" => $arParams["PRODUCT_PROPS_VARIABLE"], "FILTER_NAME" => $arParams["FILTER_NAME"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "CACHE_FILTER" => $arParams["CACHE_FILTER"], "CACHE_GROUPS" => $arParams["CACHE_GROUPS"], "SET_TITLE" => $arParams["SET_TITLE"], "MESSAGE_404" => $arParams["MESSAGE_404"], "SET_STATUS_404" => $arParams["SET_STATUS_404"], "SHOW_404" => $arParams["SHOW_404"], "FILE_404" => $arParams["FILE_404"], "DISPLAY_COMPARE" => $arParams["USE_COMPARE"], "PAGE_ELEMENT_COUNT" => $arParams["PAGE_ELEMENT_COUNT"], "LINE_ELEMENT_COUNT" => $arParams["LINE_ELEMENT_COUNT"], "PRICE_CODE" => $arParams["PRICE_CODE"], "USE_PRICE_COUNT" => $arParams["USE_PRICE_COUNT"], "SHOW_PRICE_COUNT" => $arParams["SHOW_PRICE_COUNT"], "PRICE_VAT_INCLUDE" => $arParams["PRICE_VAT_INCLUDE"], "USE_PRODUCT_QUANTITY" => $arParams['USE_PRODUCT_QUANTITY'], "ADD_PROPERTIES_TO_BASKET" => isset($arParams["ADD_PROPERTIES_TO_BASKET"]) ? $arParams["ADD_PROPERTIES_TO_BASKET"] : '', "PARTIAL_PRODUCT_PROPERTIES" => isset($arParams["PARTIAL_PRODUCT_PROPERTIES"]) ? $arParams["PARTIAL_PRODUCT_PROPERTIES"] : '', "PRODUCT_PROPERTIES" => $arParams["PRODUCT_PROPERTIES"], "DISPLAY_TOP_PAGER" => $arParams["DISPLAY_TOP_PAGER"], "DISPLAY_BOTTOM_PAGER" => $arParams["DISPLAY_BOTTOM_PAGER"], "PAGER_TITLE" => $arParams["PAGER_TITLE"], "PAGER_SHOW_ALWAYS" => $arParams["PAGER_SHOW_ALWAYS"], "PAGER_TEMPLATE" => $arParams["PAGER_TEMPLATE"], "PAGER_DESC_NUMBERING" => $arParams["PAGER_DESC_NUMBERING"], "PAGER_DESC_NUMBERING_CACHE_TIME" => $arParams["PAGER_DESC_NUMBERING_CACHE_TIME"], "PAGER_SHOW_ALL" => $arParams["PAGER_SHOW_ALL"], "PAGER_BASE_LINK_ENABLE" => $arParams["PAGER_BASE_LINK_ENABLE"], "PAGER_BASE_LINK" => $arParams["PAGER_BASE_LINK"], "PAGER_PARAMS_NAME" => $arParams["PAGER_PARAMS_NAME"], "OFFERS_CART_PROPERTIES" => $arParams["OFFERS_CART_PROPERTIES"], "OFFERS_FIELD_CODE" => $arParams["LIST_OFFERS_FIELD_CODE"], "OFFERS_PROPERTY_CODE" => $arParams["LIST_OFFERS_PROPERTY_CODE"], "OFFERS_SORT_FIELD" => $arParams["OFFERS_SORT_FIELD"], "OFFERS_SORT_ORDER" => $arParams["OFFERS_SORT_ORDER"], "OFFERS_SORT_FIELD2" => $arParams["OFFERS_SORT_FIELD2"], "OFFERS_SORT_ORDER2" => $arParams["OFFERS_SORT_ORDER2"], "OFFERS_LIMIT" => $arParams["LIST_OFFERS_LIMIT"], "SECTION_ID" => $arResult["VARIABLES"]["SECTION_ID"], "SECTION_CODE" => $arResult["VARIABLES"]["SECTION_CODE"], "SECTION_URL" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["section"], "DETAIL_URL" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["element"], "USE_MAIN_ELEMENT_SECTION" => $arParams["USE_MAIN_ELEMENT_SECTION"], 'CONVERT_CURRENCY' => $arParams['CONVERT_CURRENCY'], 'CURRENCY_ID' => $arParams['CURRENCY_ID'], 'HIDE_NOT_AVAILABLE' => $arParams["HIDE_NOT_AVAILABLE"], 'LABEL_PROP' => $arParams['LABEL_PROP'], 'ADD_PICT_PROP' => $arParams['ADD_PICT_PROP'], 'PRODUCT_DISPLAY_MODE' => $arParams['PRODUCT_DISPLAY_MODE'], 'OFFER_ADD_PICT_PROP' => $arParams['OFFER_ADD_PICT_PROP'], 'OFFER_TREE_PROPS' => $arParams['OFFER_TREE_PROPS'], 'PRODUCT_SUBSCRIPTION' => $arParams['PRODUCT_SUBSCRIPTION'], 'SHOW_DISCOUNT_PERCENT' => $arParams['SHOW_DISCOUNT_PERCENT'], 'SHOW_OLD_PRICE' => $arParams['SHOW_OLD_PRICE'], 'MESS_BTN_BUY' => $arParams['MESS_BTN_BUY'], 'MESS_BTN_ADD_TO_BASKET' => $arParams['MESS_BTN_ADD_TO_BASKET'], 'MESS_BTN_SUBSCRIBE' => $arParams['MESS_BTN_SUBSCRIBE'], 'MESS_BTN_DETAIL' => $arParams['MESS_BTN_DETAIL'], 'MESS_NOT_AVAILABLE' => $arParams['MESS_NOT_AVAILABLE'], 'TEMPLATE_THEME' => isset($arParams['TEMPLATE_THEME']) ? $arParams['TEMPLATE_THEME'] : '', "ADD_SECTIONS_CHAIN" => "N", 'ADD_TO_BASKET_ACTION' => $basketAction, 'SHOW_CLOSE_POPUP' => isset($arParams['COMMON_SHOW_CLOSE_POPUP']) ? $arParams['COMMON_SHOW_CLOSE_POPUP'] : '', 'COMPARE_PATH' => $arResult['FOLDER'] . $arResult['URL_TEMPLATES']['compare']), $component);
$GLOBALS['CATALOG_CURRENT_SECTION_ID'] = $intSectionID;
unset($basketAction);
if ($verticalGrid) {
    ?>
</div>
	<div style="clear: both;"></div>
	</div><?php 
}
if (ModuleManager::isModuleInstalled("sale")) {
    $arRecomData = array();
    $recomCacheID = array('IBLOCK_ID' => $arParams['IBLOCK_ID']);
    $obCache = new CPHPCache();
    if ($obCache->InitCache(36000, serialize($recomCacheID), "/sale/bestsellers")) {
        $arRecomData = $obCache->GetVars();
    } elseif ($obCache->StartDataCache()) {
        if (Loader::includeModule("catalog")) {
            $arSKU = CCatalogSKU::GetInfoByProductIBlock($arParams['IBLOCK_ID']);
            $arRecomData['OFFER_IBLOCK_ID'] = !empty($arSKU) ? $arSKU['IBLOCK_ID'] : 0;
        }
        $obCache->EndDataCache($arRecomData);
    }
    if (!empty($arRecomData)) {
        if (!isset($arParams['USE_SALE_BESTSELLERS']) || $arParams['USE_SALE_BESTSELLERS'] != 'N') {
            $APPLICATION->IncludeComponent("bitrix:sale.bestsellers", "", array("HIDE_NOT_AVAILABLE" => $arParams["HIDE_NOT_AVAILABLE"], "PAGE_ELEMENT_COUNT" => "5", "SHOW_DISCOUNT_PERCENT" => $arParams['SHOW_DISCOUNT_PERCENT'], "PRODUCT_SUBSCRIPTION" => $arParams['PRODUCT_SUBSCRIPTION'], "SHOW_NAME" => "Y", "SHOW_IMAGE" => "Y", "MESS_BTN_BUY" => $arParams['MESS_BTN_BUY'], "MESS_BTN_DETAIL" => $arParams['MESS_BTN_DETAIL'], "MESS_NOT_AVAILABLE" => $arParams['MESS_NOT_AVAILABLE'], "MESS_BTN_SUBSCRIBE" => $arParams['MESS_BTN_SUBSCRIBE'], "LINE_ELEMENT_COUNT" => 5, "TEMPLATE_THEME" => isset($arParams['TEMPLATE_THEME']) ? $arParams['TEMPLATE_THEME'] : '', "DETAIL_URL" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["element"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "CACHE_GROUPS" => $arParams["CACHE_GROUPS"], "BY" => array(0 => "AMOUNT"), "PERIOD" => array(0 => "15"), "FILTER" => array(0 => "CANCELED", 1 => "ALLOW_DELIVERY", 2 => "PAYED", 3 => "DEDUCTED", 4 => "N", 5 => "P", 6 => "F"), "FILTER_NAME" => $arParams["FILTER_NAME"], "ORDER_FILTER_NAME" => "arOrderFilter", "DISPLAY_COMPARE" => $arParams["USE_COMPARE"], "SHOW_OLD_PRICE" => $arParams['SHOW_OLD_PRICE'], "PRICE_CODE" => $arParams["PRICE_CODE"], "SHOW_PRICE_COUNT" => $arParams["SHOW_PRICE_COUNT"], "PRICE_VAT_INCLUDE" => $arParams["PRICE_VAT_INCLUDE"], "CONVERT_CURRENCY" => $arParams["CONVERT_CURRENCY"], "CURRENCY_ID" => $arParams["CURRENCY_ID"], "BASKET_URL" => $arParams["BASKET_URL"], "ACTION_VARIABLE" => (!empty($arParams["ACTION_VARIABLE"]) ? $arParams["ACTION_VARIABLE"] : "action") . "_slb", "PRODUCT_ID_VARIABLE" => $arParams["PRODUCT_ID_VARIABLE"], "PRODUCT_QUANTITY_VARIABLE" => $arParams["PRODUCT_QUANTITY_VARIABLE"], "ADD_PROPERTIES_TO_BASKET" => isset($arParams["ADD_PROPERTIES_TO_BASKET"]) ? $arParams["ADD_PROPERTIES_TO_BASKET"] : '', "PRODUCT_PROPS_VARIABLE" => $arParams["PRODUCT_PROPS_VARIABLE"], "PARTIAL_PRODUCT_PROPERTIES" => isset($arParams["PARTIAL_PRODUCT_PROPERTIES"]) ? $arParams["PARTIAL_PRODUCT_PROPERTIES"] : '', "USE_PRODUCT_QUANTITY" => $arParams['USE_PRODUCT_QUANTITY'], "SHOW_PRODUCTS_" . $arParams["IBLOCK_ID"] => "Y", "OFFER_TREE_PROPS_" . $arRecomData['OFFER_IBLOCK_ID'] => $arParams["OFFER_TREE_PROPS"], "ADDITIONAL_PICT_PROP_" . $arParams['IBLOCK_ID'] => $arParams['ADD_PICT_PROP'], "ADDITIONAL_PICT_PROP_" . $arRecomData['OFFER_IBLOCK_ID'] => $arParams['OFFER_ADD_PICT_PROP']), $component, array("HIDE_ICONS" => "Y"));
Exemplo n.º 23
0
 function UnInstallDB($arParams = array())
 {
     global $DB, $DBType, $APPLICATION;
     $this->errors = false;
     if (array_key_exists("savedata", $arParams) && $arParams["savedata"] != "Y") {
         $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/install/db/" . $DBType . "/uninstall.sql");
         if ($this->errors !== false) {
             $APPLICATION->ThrowException(implode("", $this->errors));
             return false;
         }
     }
     UnRegisterModuleDependences("catalog", "OnSaleOrderSumm", "sale", "CSaleOrder", "__SaleOrderCount");
     UnRegisterModuleDependences("main", "OnBeforeProlog", "main", "", "", "/modules/sale/affiliate.php");
     UnRegisterModuleDependences("main", "OnUserLogin", "sale", "CSaleUser", "OnUserLogin");
     UnRegisterModuleDependences("main", "OnBeforeLangDelete", "sale", "CSalePersonType", "OnBeforeLangDelete");
     UnRegisterModuleDependences("main", "OnLanguageDelete", "sale", "CSaleLocation", "OnLangDelete");
     UnRegisterModuleDependences("main", "OnLanguageDelete", "sale", "CSaleLocationGroup", "OnLangDelete");
     UnRegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleOrderUserProps", "OnUserDelete");
     UnRegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUserAccount", "OnUserDelete");
     UnRegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleAuxiliary", "OnUserDelete");
     UnRegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUser", "OnUserDelete");
     UnRegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleRecurring", "OnUserDelete");
     UnRegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUserCards", "OnUserDelete");
     UnRegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleOrder", "OnBeforeUserDelete");
     UnRegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleAffiliate", "OnBeforeUserDelete");
     UnRegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleUserAccount", "OnBeforeUserDelete");
     UnRegisterModuleDependences("currency", "OnBeforeCurrencyDelete", "sale", "CSaleOrder", "OnBeforeCurrencyDelete");
     UnRegisterModuleDependences("currency", "OnBeforeCurrencyDelete", "sale", "CSaleLang", "OnBeforeCurrencyDelete");
     UnRegisterModuleDependences("currency", "OnModuleUnInstall", "sale", "", "CurrencyModuleUnInstallSale");
     UnRegisterModuleDependences("mobileapp", "OnBeforeAdminMobileMenuBuild", "sale", "CSaleMobileOrderUtils", "buildSaleAdminMobileMenu");
     UnRegisterModuleDependences("sender", "OnConnectorList", "sale", "\\Bitrix\\Sale\\SenderEventHandler", "onConnectorListBuyer");
     UnRegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlGroup", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketGroup", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketFields", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketProps", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlOrderFields", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlCommon", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlGroup", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlDelivery", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlBasketGroup", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlSubGroup", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCondCtrlBasketFields", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnOrderDelete", "sale", "CSaleMobileOrderPull", "onOrderDelete");
     UnRegisterModuleDependences("sale", "OnOrderAdd", "sale", "CSaleMobileOrderPull", "onOrderAdd");
     UnRegisterModuleDependences("sale", "OnOrderUpdate", "sale", "CSaleMobileOrderPull", "onOrderUpdate");
     UnRegisterModuleDependences("sale", "OnSaleStatusOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleStatusOrderHandler");
     UnRegisterModuleDependences("sale", "OnSaleDeliveryOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleDeliveryOrderHandler");
     UnRegisterModuleDependences("sale", "OnSaleDeductOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleDeductOrderHandler");
     UnRegisterModuleDependences("sale", "OnSaleCancelOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleCancelOrderHandler");
     UnRegisterModuleDependences("sale", "OnSalePayOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSalePayOrderHandler");
     UnRegisterModuleDependences("main", "OnEventLogGetAuditTypes", "sale", "CSaleYMHandler", 'OnEventLogGetAuditTypes');
     UnRegisterModuleDependences("main", "OnEventLogGetAuditTypes", "sale", "CSalePaySystemAction", 'OnEventLogGetAuditTypes');
     $eventManager = \Bitrix\Main\EventManager::getInstance();
     $eventManager->unRegisterEventHandler('main', 'OnUserLogout', 'sale', '\\Bitrix\\Sale\\DiscountCouponsManager', 'logout');
     CAgent::RemoveModuleAgents("sale");
     ModuleManager::unRegisterModule('sale');
     return true;
 }
Exemplo n.º 24
0
use Bitrix\Main\Loader;
use Bitrix\Main\ModuleManager;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\Config\Option;
use Bitrix\Currency\CurrencyTable;

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())
Exemplo n.º 25
0
 function UnInstallDB($arParams = array())
 {
     global $APPLICATION, $DB, $errors;
     if (!defined('BX_CATALOG_UNINSTALLED')) {
         define('BX_CATALOG_UNINSTALLED', true);
     }
     if (!isset($arParams["savedata"]) || $arParams["savedata"] != "Y") {
         $errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/catalog/install/db/" . strtolower($DB->type) . "/uninstall.sql");
         if (!empty($errors)) {
             $APPLICATION->ThrowException(implode("", $errors));
             return false;
         }
         $this->UnInstallTasks();
         COption::RemoveOption("catalog");
     }
     UnRegisterModuleDependences("iblock", "OnIBlockDelete", "catalog", "CCatalog", "OnIBlockDelete");
     UnRegisterModuleDependences("iblock", "OnIBlockElementDelete", "catalog", "CProduct", "OnIBlockElementDelete");
     UnRegisterModuleDependences("iblock", "OnIBlockElementDelete", "catalog", "CPrice", "OnIBlockElementDelete");
     UnRegisterModuleDependences("iblock", "OnIBlockElementDelete", "catalog", "CCatalogStoreProduct", "OnIBlockElementDelete");
     UnRegisterModuleDependences("iblock", "OnIBlockElementDelete", "catalog", "CCatalogDocs", "OnIBlockElementDelete");
     UnRegisterModuleDependences("iblock", "OnBeforeIBlockElementDelete", "catalog", "CCatalogDocs", "OnBeforeIBlockElementDelete");
     UnRegisterModuleDependences("currency", "OnCurrencyDelete", "catalog", "CPrice", "OnCurrencyDelete");
     UnRegisterModuleDependences("iblock", "OnAfterIBlockElementUpdate", "catalog", "CCatalogProduct", "OnAfterIBlockElementUpdate");
     UnRegisterModuleDependences("currency", "OnModuleUnInstall", "catalog", "", "CurrencyModuleUnInstallCatalog");
     UnRegisterModuleDependences("iblock", "OnBeforeIBlockDelete", "catalog", "CCatalog", "OnBeforeCatalogDelete");
     UnRegisterModuleDependences("iblock", "OnBeforeIBlockElementDelete", "catalog", "CCatalog", "OnBeforeIBlockElementDelete");
     UnRegisterModuleDependences("main", "OnEventLogGetAuditTypes", "catalog", "CCatalogEvent", "GetAuditTypes");
     UnRegisterModuleDependences('main', 'OnBuildGlobalMenu', 'catalog', 'CCatalogAdmin', 'OnBuildGlobalMenu');
     UnRegisterModuleDependences('main', 'OnAdminListDisplay', 'catalog', 'CCatalogAdmin', 'OnAdminListDisplay');
     UnRegisterModuleDependences('main', 'OnBuildGlobalMenu', 'catalog', 'CCatalogAdmin', 'OnBuildSaleMenu');
     UnRegisterModuleDependences("catalog", "OnCondCatControlBuildList", "catalog", "CCatalogCondCtrlGroup", "GetControlDescr");
     UnRegisterModuleDependences("catalog", "OnCondCatControlBuildList", "catalog", "CCatalogCondCtrlIBlockFields", "GetControlDescr");
     UnRegisterModuleDependences("catalog", "OnCondCatControlBuildList", "catalog", "CCatalogCondCtrlIBlockProps", "GetControlDescr");
     UnRegisterModuleDependences("catalog", "OnDocumentBarcodeDelete", "catalog", "CCatalogStoreDocsElement", "OnDocumentBarcodeDelete");
     UnRegisterModuleDependences("catalog", "OnBeforeDocumentDelete", "catalog", "CCatalogStoreDocsBarcode", "OnBeforeDocumentDelete");
     UnRegisterModuleDependences("catalog", "OnCatalogStoreDelete", "catalog", "CCatalogDocs", "OnCatalogStoreDelete");
     UnRegisterModuleDependences("iblock", "OnBeforeIBlockPropertyDelete", "catalog", "CCatalog", "OnBeforeIBlockPropertyDelete");
     UnRegisterModuleDependences("sale", "OnCondSaleControlBuildList", "catalog", "CCatalogCondCtrlBasketProductFields", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleControlBuildList", "catalog", "CCatalogCondCtrlBasketProductProps", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "catalog", "CCatalogActionCtrlBasketProductFields", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "catalog", "CCatalogActionCtrlBasketProductProps", "GetControlDescr");
     UnRegisterModuleDependences("sale", "OnExtendBasketItems", "catalog", "CCatalogDiscount", "ExtendBasketItems");
     UnRegisterModuleDependences('iblock', 'OnModuleUnInstall', 'catalog', 'CCatalog', 'OnIBlockModuleUnInstall');
     $eventManager = \Bitrix\Main\EventManager::getInstance();
     $eventManager->unRegisterEventHandler('sale', 'onBuildCouponProviders', 'catalog', '\\Bitrix\\Catalog\\DiscountCouponTable', 'couponManager');
     CAgent::RemoveModuleAgents('catalog');
     ModuleManager::unRegisterModule('catalog');
     return true;
 }
Exemplo n.º 26
0
                    if ($arRecomData['IBLOCK_LINK'] == '') {
                        $arRecomData['IBLOCK_LINK'] = $arProp['CODE'];
                        $found = true;
                    }
                } else {
                    if ($arRecomData['ALL_LINK'] == '') {
                        $arRecomData['ALL_LINK'] = $arProp['CODE'];
                    }
                }
            }
            if ($found) {
                if (defined("BX_COMP_MANAGED_CACHE")) {
                    global $CACHE_MANAGER;
                    $CACHE_MANAGER->StartTagCache("/catalog/recommended");
                    $CACHE_MANAGER->RegisterTag("iblock_id_" . $arParams["IBLOCK_ID"]);
                    $CACHE_MANAGER->EndTagCache();
                }
            }
        }
        $obCache->EndDataCache($arRecomData);
    }
    if (!empty($arRecomData) && ($arRecomData['IBLOCK_LINK'] != '' || $arRecomData['ALL_LINK'] != '')) {
        $APPLICATION->IncludeComponent("bitrix:catalog.recommended.products", "", array("LINE_ELEMENT_COUNT" => $arParams["ALSO_BUY_ELEMENT_COUNT"], "TEMPLATE_THEME" => isset($arParams['TEMPLATE_THEME']) ? $arParams['TEMPLATE_THEME'] : '', "ID" => $ElementID, "PROPERTY_LINK" => $arRecomData['IBLOCK_LINK'] != '' ? $arRecomData['IBLOCK_LINK'] : $arRecomData['ALL_LINK'], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "BASKET_URL" => $arParams["BASKET_URL"], "ACTION_VARIABLE" => $arParams["ACTION_VARIABLE"], "PRODUCT_ID_VARIABLE" => $arParams["PRODUCT_ID_VARIABLE"], "PRODUCT_QUANTITY_VARIABLE" => $arParams["PRODUCT_QUANTITY_VARIABLE"], "ADD_PROPERTIES_TO_BASKET" => isset($arParams["ADD_PROPERTIES_TO_BASKET"]) ? $arParams["ADD_PROPERTIES_TO_BASKET"] : '', "PRODUCT_PROPS_VARIABLE" => $arParams["PRODUCT_PROPS_VARIABLE"], "PARTIAL_PRODUCT_PROPERTIES" => isset($arParams["PARTIAL_PRODUCT_PROPERTIES"]) ? $arParams["PARTIAL_PRODUCT_PROPERTIES"] : '', "PAGE_ELEMENT_COUNT" => $arParams["ALSO_BUY_ELEMENT_COUNT"], "SHOW_OLD_PRICE" => $arParams['SHOW_OLD_PRICE'], "SHOW_DISCOUNT_PERCENT" => $arParams['SHOW_DISCOUNT_PERCENT'], "PRICE_CODE" => $arParams["PRICE_CODE"], "SHOW_PRICE_COUNT" => $arParams["SHOW_PRICE_COUNT"], "PRODUCT_SUBSCRIPTION" => 'N', "PRICE_VAT_INCLUDE" => $arParams["PRICE_VAT_INCLUDE"], "USE_PRODUCT_QUANTITY" => $arParams['USE_PRODUCT_QUANTITY'], "SHOW_NAME" => "Y", "SHOW_IMAGE" => "Y", "MESS_BTN_BUY" => $arParams['MESS_BTN_BUY'], "MESS_BTN_DETAIL" => $arParams["MESS_BTN_DETAIL"], "MESS_NOT_AVAILABLE" => $arParams['MESS_NOT_AVAILABLE'], "MESS_BTN_SUBSCRIBE" => $arParams['MESS_BTN_SUBSCRIBE'], "SHOW_PRODUCTS_" . $arParams["IBLOCK_ID"] => "Y", "HIDE_NOT_AVAILABLE" => $arParams["HIDE_NOT_AVAILABLE"], "OFFER_TREE_PROPS_" . $arRecomData['OFFER_IBLOCK_ID'] => $arParams["OFFER_TREE_PROPS"], "PROPERTY_CODE_" . $arRecomData['OFFER_IBLOCK_ID'] => array(), "CONVERT_CURRENCY" => $arParams['CONVERT_CURRENCY']), $component, array("HIDE_ICONS" => "Y"));
    }
    if ($arParams["USE_ALSO_BUY"] == "Y" && \Bitrix\Main\ModuleManager::isModuleInstalled("sale") && !empty($arRecomData)) {
        $APPLICATION->IncludeComponent("bitrix:sale.recommended.products", ".default", array("ID" => $ElementID, "TEMPLATE_THEME" => isset($arParams['TEMPLATE_THEME']) ? $arParams['TEMPLATE_THEME'] : '', "MIN_BUYES" => $arParams["ALSO_BUY_MIN_BUYES"], "ELEMENT_COUNT" => $arParams["ALSO_BUY_ELEMENT_COUNT"], "LINE_ELEMENT_COUNT" => $arParams["ALSO_BUY_ELEMENT_COUNT"], "DETAIL_URL" => $arParams["DETAIL_URL"], "BASKET_URL" => $arParams["BASKET_URL"], "ACTION_VARIABLE" => $arParams["ACTION_VARIABLE"], "PRODUCT_ID_VARIABLE" => $arParams["PRODUCT_ID_VARIABLE"], "SECTION_ID_VARIABLE" => $arParams["SECTION_ID_VARIABLE"], "PAGE_ELEMENT_COUNT" => $arParams["ALSO_BUY_ELEMENT_COUNT"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "PRICE_CODE" => $arParams["PRICE_CODE"], "USE_PRICE_COUNT" => $arParams["USE_PRICE_COUNT"], "SHOW_PRICE_COUNT" => $arParams["SHOW_PRICE_COUNT"], "PRICE_VAT_INCLUDE" => $arParams["PRICE_VAT_INCLUDE"], 'CONVERT_CURRENCY' => $arParams['CONVERT_CURRENCY'], 'CURRENCY_ID' => $arParams['CURRENCY_ID'], 'HIDE_NOT_AVAILABLE' => $arParams["HIDE_NOT_AVAILABLE"], "SHOW_PRODUCTS_" . $arParams["IBLOCK_ID"] => "Y", "PROPERTY_CODE_" . $arRecomData['OFFER_IBLOCK_ID'] => array(), "OFFER_TREE_PROPS_" . $arRecomData['OFFER_IBLOCK_ID'] => $arParams["OFFER_TREE_PROPS"]), $component);
    }
    if ($arParams["USE_STORE"] == "Y" && \Bitrix\Main\ModuleManager::isModuleInstalled("catalog")) {
        $APPLICATION->IncludeComponent("bitrix:catalog.store.amount", ".default", array("PER_PAGE" => "10", "USE_STORE_PHONE" => $arParams["USE_STORE_PHONE"], "SCHEDULE" => $arParams["USE_STORE_SCHEDULE"], "USE_MIN_AMOUNT" => $arParams["USE_MIN_AMOUNT"], "MIN_AMOUNT" => $arParams["MIN_AMOUNT"], "ELEMENT_ID" => $ElementID, "STORE_PATH" => $arParams["STORE_PATH"], "MAIN_TITLE" => $arParams["MAIN_TITLE"]), $component);
    }
}
Exemplo n.º 27
0
        if (is_array($item)) {
            $keys = array();
            foreach ($item as $fld => $value) {
                $keys[] = $fld;
            }
            foreach ($keys as $key) {
                if (!isset($item['~' . $key])) {
                    $item['~' . $key] = $item[$key];
                }
            }
            $item['IS_COMPLETE'] = $item['CHECKED'] == '1' ? 'Y' : 'N';
            if (!isset($item['ID'])) {
                $item['ID'] = 'task-detail-checklist-item-xxx_' . rand(0, 999999);
            }
            // newly created item, ID should be defined anyway
        }
    }
}
$arResult['RESPONSIBLE_NAME_FORMATTED'] = $arResult['DATA']["RESPONSIBLE_NAME"] || $arResult['DATA']["RESPONSIBLE_LAST_NAME"] || $arResult['DATA']["RESPONSIBLE_LOGIN"] ? CUser::FormatName($arParams["NAME_TEMPLATE"], array("NAME" => $arResult['DATA']["RESPONSIBLE_NAME"], "LAST_NAME" => $arResult['DATA']["RESPONSIBLE_LAST_NAME"], "LOGIN" => $arResult['DATA']["RESPONSIBLE_LOGIN"], "SECOND_NAME" => $arResult['DATA']["RESPONSIBLE_SECOND_NAME"]), true, false) : "";
$arResult['CREATED_BY_NAME_FORMATTED'] = $arResult['DATA']["CREATED_BY_NAME"] || $arResult['DATA']["CREATED_BY_LAST_NAME"] || $arResult['DATA']["CREATED_BY_LOGIN"] ? CUser::FormatName($arParams["NAME_TEMPLATE"], array("NAME" => $arResult['DATA']["CREATED_BY_NAME"], "LAST_NAME" => $arResult['DATA']["CREATED_BY_LAST_NAME"], "LOGIN" => $arResult['DATA']["CREATED_BY_LOGIN"], "SECOND_NAME" => $arResult['DATA']["CREATED_BY_SECOND_NAME"]), true, false) : "";
$arResult['USER_CREATE_TEMPLATE'] = $arResult['DATA']['TPARAM_TYPE'] == CTaskTemplates::TYPE_FOR_NEW_USER;
$arResult['CSS_MODES'] = array();
if (intval($arResult['DATA']['BASE_TEMPLATE_ID'])) {
    $arResult['CSS_MODES'][] = 'state-base-template-choosen';
}
if ($arResult['USER_CREATE_TEMPLATE']) {
    $arResult['CSS_MODES'][] = 'state-user-create-template';
}
$arResult['RESPONSIBLE_DISABLED'] = $arResult['DATA']["CREATED_BY"] != $USER->GetID() || $arResult['USER_CREATE_TEMPLATE'];
$arResult['BX24_MODE'] = \Bitrix\Main\ModuleManager::isModuleInstalled('bitrix24');
Exemplo n.º 28
0
<?php

use Bitrix\Main\ModuleManager;
if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
    die;
}
$arThemes = array();
if (ModuleManager::isModuleInstalled('bitrix.eshop')) {
    $arThemes['site'] = GetMessage('CP_BCC_TPL_THEME_SITE');
}
$arThemesList = array('blue' => GetMessage('CP_BCC_TPL_THEME_BLUE'), 'green' => GetMessage('CP_BCC_TPL_THEME_GREEN'), 'red' => GetMessage('CP_BCC_TPL_THEME_RED'), 'wood' => GetMessage('CP_BCC_TPL_THEME_WOOD'), 'yellow' => GetMessage('CP_BCC_TPL_THEME_YELLOW'), 'black' => GetMessage('CP_BCC_TPL_THEME_BLACK'));
$dir = trim(preg_replace("'[\\\\/]+'", "/", dirname(__FILE__) . "/themes/"));
if (is_dir($dir)) {
    foreach ($arThemesList as $themeID => $themeName) {
        if (!is_file($dir . $themeID . '/style.css')) {
            continue;
        }
        $arThemes[$themeID] = $themeName;
    }
}
$arTemplateParameters['TEMPLATE_THEME'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage("CP_BCC_TPL_TEMPLATE_THEME"), 'TYPE' => 'LIST', 'VALUES' => $arThemes, 'DEFAULT' => 'blue', 'ADDITIONAL_VALUES' => 'Y');
Exemplo n.º 29
0
 public function DoUninstall()
 {
     Loader::includeModule($this->MODULE_ID);
     $this->GetConnection()->dropTable(NewsTable::getTableName());
     ModuleManager::unRegisterModule($this->MODULE_ID);
 }
Exemplo n.º 30
0
 public function doUninstall()
 {
     $this->uninstallFiles();
     ModuleManager::unregisterModule($this->MODULE_ID);
 }