38 $this->vk = Vk\Vk::getInstance();
40 if (!$this->vk->isActive())
46 if (!Loader::includeModule(
'iblock'))
47 throw new SystemException(
"Can't include module \"IBlock\"! " . __METHOD__);
53 $preparedSections = $sectionsList->getSectionsToAlbumsExport();
54 $this->sectionsToExport = $preparedSections[
"SECTIONS"];
55 $this->sectionsAliases = $preparedSections[
"ALIASES"];
56 unset($preparedSections);
59 if (empty($this->sectionsToExport))
62 $logger->addError(
'EMPTY_SECTIONS_LIST');
74 private function createSectionsDbObject()
76 return \CIBlockSection::GetList(
78 array(
"ID" => $this->sectionsToExport,
"ACTIVE" =>
"Y",
"GLOBAL_ACTIVE" =>
"Y",
"CHECK_PERMISSIONS" =>
"N"),
80 array(
"ID",
"IBLOCK_ID",
"IBLOCK_SECTION_ID",
"NAME",
"PICTURE",
"DETAIL_PICTURE",
"LEFT_MARGIN",
"RIGHT_MARGIN",
"DESCRIPTION"),
99 foreach ($this->sectionsToExport as $key => $section)
102 unset($this->sectionsToExport[$key]);
131 $this->currentRecord = $this->nextItem();
139 private function nextItem()
143 if ($obCurrItem = $this->resSections->GetNextElement(
true,
false))
145 $currItem = $obCurrItem->GetFields();
146 if ($currItem[
"ELEMENT_CNT"] > 0)
148 $currItem[
"TO_ALBUM_ALIAS"] = isset($this->sectionsAliases[$currItem[
"ID"]]) ?
149 $this->sectionsAliases[$currItem[
"ID"]] :
false;
160 $this->currentKey = 0;
161 $this->resSections = $this->createSectionsDbObject();
162 $this->currentRecord = $this->nextItem();
171 return is_array($this->currentRecord);