Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/components/bitrix/subscribe.news/ |
Upload File : |
<?php if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) { die(); } /* @var array $arCurrentValues */ if (!IsModuleInstalled('iblock') || !CModule::IncludeModule('iblock')) { return; } $arSites = []; $defSite = ''; $rsSite = CSite::GetList(); while ($arSite = $rsSite->Fetch()) { $arSites[$arSite['ID']] = $arSite['NAME']; if ($arSite['DEF'] == 'Y') { $defSite = $arSite['ID']; } } $arIBlockTypes = []; $defIBlockType = 'news'; $rsIBlockType = CIBlockType::GetList(['SORT' => 'ASC']); while ($arIBlockType = $rsIBlockType->Fetch()) { if ($arIBlockType = CIBlockType::GetByIDLang($arIBlockType['ID'], LANGUAGE_ID)) { $arIBlockTypes[$arIBlockType['ID']] = $arIBlockType['NAME']; } } $arIBlocks = ['-' => GetMessage('MAIN_ALL')]; $rsIBlock = CIBlock::GetList( ['SORT' => 'ASC'], [ 'SITE_ID' => $arCurrentValues['SITE_ID'], 'TYPE' => ($arCurrentValues['IBLOCK_TYPE'] != '-' ? $arCurrentValues['IBLOCK_TYPE'] : ''), ] ); while ($arIBlock = $rsIBlock->Fetch()) { $arIBlocks[$arIBlock['ID']] = $arIBlock['NAME']; } $arSorts = [ 'ASC' => GetMessage('CP_BSN_ORDER_ASC'), 'DESC' => GetMessage('CP_BSN_ORDER_DESC'), ]; $arSortFields = [ 'ACTIVE_FROM' => GetMessage('CP_BSN_ACTIVE_FROM'), 'SORT' => GetMessage('CP_BSN_SORT'), ]; $arComponentParameters = [ 'GROUPS' => [ ], 'PARAMETERS' => [ 'SITE_ID' => [ 'NAME' => GetMessage('CP_BSN_SITE_ID'), 'TYPE' => 'LIST', 'VALUES' => $arSites, 'DEFAULT' => $defSite, 'REFRESH' => 'Y', ], 'IBLOCK_TYPE' => [ 'NAME' => GetMessage('CP_BSN_IBLOCK_TYPE'), 'TYPE' => 'LIST', 'VALUES' => $arIBlockTypes, 'DEFAULT' => $defIBlockType, 'REFRESH' => 'Y', ], 'ID' => [ 'NAME' => GetMessage('CP_BSN_ID'), 'TYPE' => 'LIST', 'VALUES' => $arIBlocks, ], 'SORT_BY' => [ 'NAME' => GetMessage('CP_BSN_SORT_BY'), 'TYPE' => 'LIST', 'DEFAULT' => 'ACTIVE_FROM', 'VALUES' => $arSortFields, ], 'SORT_ORDER' => [ 'NAME' => GetMessage('CP_BSN_SORT_ORDER'), 'TYPE' => 'LIST', 'DEFAULT' => 'DESC', 'VALUES' => $arSorts, ], ], ];