13 if (!Loader::includeModule(
'iblock'))
18 $iblockIdList =
array();
19 $res = \CIBlock::getList(
array(),
array(
"ACTIVE" =>
"Y",
"CODE"=>
"group_photogallery%"));
22 $iblockIdList[] =
$iblock[
"ID"];
25 if (empty($iblockIdList))
30 $res = \CIBlockSection::getList(
33 "IBLOCK_ID" => $iblockIdList,
34 "SOCNET_GROUP_ID" => $groupId
37 array(
'ID',
'LEFT_MARGIN',
'RIGHT_MARGIN')
39 while ($section =
$res->fetch())
41 @set_time_limit(1000);
43 $treeSectionIdList = $treeElementIdList =
array();
45 $pseudoComponentParams =
array(
47 'USER_ALIAS' =>
'group_'.$groupId
50 $pseudoComponentResult =
array(
54 foreach(getModuleEvents(
"photogallery",
"OnBeforeSectionDrop",
true) as
$event)
56 executeModuleEventEx(
$event,
array($section[
'ID'], $pseudoComponentParams, $pseudoComponentResult, &$treeSectionIdList, &$treeElementIdList));
59 if (\CIBlockSection::delete($section[
'ID'],
false))
62 "ID" => $section[
'ID'],
63 "SECTIONS_IN_TREE" => $treeSectionIdList,
64 "ELEMENTS_IN_TREE" => $treeElementIdList
66 foreach(getModuleEvents(
"photogallery",
"OnAfterSectionDrop",
true) as
$event)
68 executeModuleEventEx(
$event,
array($section[
'ID'], $eventFields, $pseudoComponentParams, $pseudoComponentResult));