1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
iblock.php
См. документацию.
1<?
2namespace Bitrix\Lists\Controller;
3
4use Bitrix\Iblock\Copy\Manager;
5use Bitrix\Lists\Copy\Implement\Children\Field;
6use Bitrix\Lists\Copy\Implement\Iblock as IblockImplementer;
7use Bitrix\Lists\Security\IblockRight;
8use Bitrix\Lists\Security\Right;
9use Bitrix\Lists\Security\RightParam;
10use Bitrix\Lists\Service\Param;
11use Bitrix\Main\Type\Dictionary;
12
13class Iblock extends Entity
14{
15 public function copyAction()
16 {
17 $param = $this->getParamFromRequest();
18 $params = $param->getParams();
19
20 $this->checkPermission($param, IblockRight::EDIT);
21 if ($this->getErrors())
22 {
23 return null;
24 }
25
26 $manager = new Manager($params["IBLOCK_TYPE_ID"], [$params["IBLOCK_ID"]], $params["SOCNET_GROUP_ID"]);
27
28 $manager->setIblockImplementer(new IblockImplementer());
29 $manager->setFieldImplementer(new Field());
30
31 $dictionary = new Dictionary([
32 "LIST_ELEMENT_URL" => ($params["LIST_ELEMENT_URL"] ? $params["LIST_ELEMENT_URL"] : "")
33 ]);
34 $manager->setDictionary($dictionary);
35
36 $result = $manager->startCopy();
37
38 if ($result->getErrors())
39 {
40 $this->addErrors($result->getErrors());
41 return null;
42 }
43
44 $mapIdsCopiedIblock = $manager->getMapIdsCopiedEntity();
45
46 if (array_key_exists($params["IBLOCK_ID"], $mapIdsCopiedIblock))
47 {
48 return $mapIdsCopiedIblock[$params["IBLOCK_ID"]];
49 }
50 else
51 {
52 return null;
53 }
54 }
55
56 private function checkPermission(Param $param, $permission)
57 {
58 global $USER;
59 $rightParam = new RightParam($param);
60 $rightParam->setUser($USER);
61
62 $right = new Right($rightParam, new IblockRight($rightParam));
63 $right->checkPermission($permission);
64 if ($right->hasErrors())
65 {
66 $this->addErrors($right->getErrors());
67 }
68 }
69}
getParamFromRequest()
Определения entity.php:9
$right
Определения options.php:8
$result
Определения get_property_values.php:14
global $USER
Определения csv_new_run.php:40
getErrors()
Определения errorableimplementation.php:34
$manager
Определения office365push.php:39
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799