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/highloadblock.view/ |
Upload File : |
<?php if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) { die(); } /** @var array $arParams */ /** @global CUser $USER */ use Bitrix\Highloadblock as HL; use Bitrix\Main\Entity; use Bitrix\Main\Loader; $requiredModules = array('highloadblock'); foreach ($requiredModules as $requiredModule) { if (!Loader::includeModule($requiredModule)) { ShowError(GetMessage('F_NO_MODULE')); return 0; } } global $USER_FIELD_MANAGER; $arResult['ERROR'] = ''; // hlblock info $hlblock_id = $arParams['BLOCK_ID']; $hlblock = null; if (empty($hlblock_id)) { $arResult['ERROR'] = GetMessage('HLBLOCK_VIEW_NO_ID'); } else { $hlblock = HL\HighloadBlockTable::getById($hlblock_id)->fetch(); if (empty($hlblock)) { $arResult['ERROR'] = GetMessage('HLBLOCK_VIEW_404'); } } // check rights if (isset($arParams['CHECK_PERMISSIONS']) && $arParams['CHECK_PERMISSIONS'] == 'Y' && !$USER->isAdmin()) { $operations = HL\HighloadBlockRightsTable::getOperationsName($hlblock_id); if (empty($operations)) { $arResult['ERROR'] = GetMessage('HLBLOCK_VIEW_404'); } } if ($arResult['ERROR'] == '') { $entity = HL\HighloadBlockTable::compileEntity($hlblock); if (!isset($arParams['ROW_KEY']) || trim($arParams['ROW_KEY']) == '') { $arParams['ROW_KEY'] = 'ID'; } // row data $main_query = new Entity\Query($entity); $main_query->setSelect(array('*')); $main_query->setFilter(array('='.trim($arParams['ROW_KEY']) => $arParams['ROW_ID'])); $result = $main_query->exec(); $result = new CDBResult($result); $row = $result->Fetch(); $fields = $USER_FIELD_MANAGER->getUserFieldsWithReadyData( 'HLBLOCK_'.$hlblock['ID'], $row, LANGUAGE_ID ); if (empty($row)) { $arResult['ERROR'] = GetMessage('HLBLOCK_VIEW_NO_ROW'); } $arResult['fields'] = $fields; $arResult['row'] = $row; } $this->IncludeComponentTemplate();