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/ilovecveti.ru/bitrix/modules/mcart.xls/lib/handler/url/ |
Upload File : |
<?php namespace Mcart\Xls\Handler\Url; use Bitrix\Main\Entity; use Bitrix\Main\Localization\Loc; use Mcart\Xls\Handler\Base; use Mcart\Xls\Spreadsheet\Import; use PhpOffice\PhpSpreadsheet\Cell\Cell; Loc::loadMessages(__FILE__); class Handler extends Base{ /** * @return string */ public static function getCode(){ return 'Url'; } protected function getCustomFieldsMap() { global $USER; $ar = []; /*if(!$USER->IsAdmin()){ return $ar; } $ar[] = new Entity\StringField(($code = 'TEST_REQUIRED'), [ 'required' => true, 'title' => Loc::getMessage($this->locKey.'__'.$code) ]); $ar[] = new Entity\StringField(($code = 'TEST'), [ 'required' => false, 'title' => Loc::getMessage($this->locKey.'__'.$code) ]); $ar[] = new Entity\EnumField(($code = 'TEST_LIST_REQUIRED'), [ 'required' => true, 'title' => Loc::getMessage($this->locKey.'__'.$code), 'values' => [ 'k1' => 'v1', 'k2' => 'v2', 'k3' => 'v3', ], ]); $ar[] = new Entity\EnumField(($code = 'TEST_LIST'), [ 'required' => false, 'title' => Loc::getMessage($this->locKey.'__'.$code), 'values' => [ 'k1' => 'v1', 'k2' => 'v2', 'k3' => 'v3', ], ]);*/ return $ar; } public function importCell(Import $obImport, Cell $obCell, array $arCell, array $arItem){ $arCell['isHyperlink'] = $obCell->hasHyperlink(); if ($arCell['isHyperlink']) { $arCell['value_format'] = $obCell->getHyperlink()->getUrl(); } return $arCell; } }