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/modules/ui/install/initialdata/ |
Upload File : |
<?php use Bitrix\Main; use Bitrix\UI; use Bitrix\Main\Localization\Loc; Loc::loadMessages(__FILE__); $fillMasks = function($path, ?int $groupId) use (&$fillMasks) { foreach ((new Main\IO\Directory($path))->getChildren() as $mask) { if ($mask instanceof Main\IO\Directory) { if (strlen($mask->getName()) > 2) { $directory = UI\Avatar\Mask\Helper::setSystemGroup( Loc::getMessage('UI_INSTALL_MASK_TITLE_' . strtoupper($mask->getName())), Loc::getMessage('UI_INSTALL_MASK_DESCRIPTION_' . strtoupper($mask->getName())) ); if ($directory instanceof UI\Avatar\Mask\Group) { $fillMasks($mask->getPhysicalPath(), $directory->getId()); } } else { $region = \Bitrix\Main\Application::getInstance()->getLicense()->getRegion(); if ( $mask->getName() === $region || !(new Main\IO\Directory(Main\IO\Path::combine($path, $region)))->isExists() && ( $mask->getName() === 'ru' && in_array($region, ['ru', 'kz', 'by']) || $mask->getName() === 'en' && !in_array($region, ['ru', 'kz', 'by']) ) ) { $fillMasks($mask->getPhysicalPath(), $groupId); } } continue; } /** * @var Main\IO\File $mask */ if (Loc::getMessage('UI_INSTALL_MASK_TITLE_' . strtoupper($mask->getName())) !== null) { UI\Avatar\Mask\Helper::addSystemMask([ 'name' => $mask->getName(), 'tmp_name' => $mask->getPhysicalPath(), 'size' => $mask->getSize(), 'type' => $mask->getContentType() ], [ 'GROUP_ID' => $groupId, 'TITLE' => Loc::getMessage('UI_INSTALL_MASK_TITLE_' . strtoupper($mask->getName())), 'DESCRIPTION' => Loc::getMessage('UI_INSTALL_MASK_DESCRIPTION_' . strtoupper($mask->getName())), ]); } } }; $fillMasks(__DIR__ . '/masks/', 0);