8class Iblock extends IblockImplementer
12 $iblockId = parent::add($container, $fields);
16 $this->setUrlTemplate($container, $iblockId, $fields);
24 $this->copyLockFeature($iblockId, $copiedIblockId);
26 return parent::copyChildren($container, $iblockId, $copiedIblockId);
31 parent::cleanCache($iblockId);
33 if ($this->cacheManager)
35 $this->cacheManager->clearByTag(
"lists_list_".$iblockId);
36 $this->cacheManager->clearByTag(
"lists_list_any");
44 $socnetPerm = \CLists::getSocnetPermission($iblockId);
45 foreach ($socnetPerm as $role => $permission)
47 if ($permission >
"W")
56 $rights[
"n" . ($i++)] = [
57 "GROUP_CODE" =>
"SG" . $socnetGroupId .
"_" . $role,
58 "IS_INHERITED" =>
"N",
59 "TASK_ID" => \CIBlockRights::letterToTask($permission),
63 $rights[
"n" . ($i++)] = [
65 "IS_INHERITED" =>
"N",
66 "TASK_ID" => \CIBlockRights::letterToTask($permission),
70 $rights[
"n" . ($i++)] = [
72 "IS_INHERITED" =>
"N",
73 "TASK_ID" => \CIBlockRights::letterToTask($permission),
81 private function copyLockFeature(
int $iblockId,
int $copiedIblockId): void
83 $option = Option::get(
"lists",
"iblock_lock_feature");
84 $iblockIdsWithLockFeature = ($option !==
"" ? unserialize($option) : []);
85 if (isset($iblockIdsWithLockFeature[$iblockId]))
87 $iblockIdsWithLockFeature[$copiedIblockId] = $copiedIblockId;
88 Option::set(
"lists",
"iblock_lock_feature", serialize($iblockIdsWithLockFeature));
92 private function setUrlTemplate(Container $container,
int $iblockId, array $fields)
94 $list = new \CList($iblockId);
96 $dictionary = $container->getDictionary();
98 if (!empty($dictionary[
"LIST_ELEMENT_URL"]))
100 $listElementUrl = $dictionary[
"LIST_ELEMENT_URL"];
104 $listElementUrl = $list->getUrlByIblockId($container->getEntityId());
105 $listElementUrl = str_replace($container->getEntityId(), $iblockId, $listElementUrl);
108 $socnetGroupId = ($fields[
"SOCNET_GROUP_ID"] ? $fields[
"SOCNET_GROUP_ID"] : 0);
110 $list->actualizeDocumentAdminPage(str_replace(
111 [
"#list_id#",
"#group_id#"],
112 [$iblockId, $socnetGroupId],