41 $sectionId = $arArgs[
"ID"];
43 $exportProfiles = $vk->getExportProfilesList();
45 foreach ($exportProfiles as $export)
47 $dataToMapping = array();
48 $dataToDelete = array();
52 $sectionsList->clearCaches();
53 $sectionsList->setCurrSectionSettings($_POST[
'VK_EXPORT'][$export[
"ID"]]);
56 $preparedSection = $sectionsList->prepareSectionToSave($sectionId);
57 $dataToMapping += $preparedSection[
'TO_SAVE'] ? $preparedSection[
'TO_SAVE'] : array();
58 $dataToDelete += $preparedSection[
'TO_DELETE'] ? $preparedSection[
'TO_DELETE'] : array();
61 $preparedChilds = $sectionsList->prepareChildsToSave($sectionId);
62 $dataToMapping += $preparedChilds[
'TO_SAVE'] ? $preparedChilds[
'TO_SAVE'] : array();
63 $dataToDelete += $preparedChilds[
'TO_DELETE'] ? $preparedChilds[
'TO_DELETE'] : array();
65 if (!empty($dataToMapping))
70 if (!empty($dataToDelete))
150 if (defined(
'LANG') && LANG !=
'ru')
152 $resultHtml =
'<tr><td colspan="2">';
153 $resultHtml .= BeginNote();
154 $resultHtml .=
'<p>' .
Loc::getMessage(
"SALE_VK_ONLY_RUSSIAN") .
'</p>';
155 $resultHtml .=
'<p>' .
Loc::getMessage(
"SALE_VK_ONLY_RUSSIAN_2") .
'</p>';
156 $resultHtml .=
'<img src="/bitrix/images/sale/vk/vk_only_russian.png" alt="">';
157 $resultHtml .= EndNote();
158 $resultHtml .=
'</td></tr>';
165 $iblockId = $arArgs[
"IBLOCK"][
"ID"];
166 $sectionId = $arArgs[
"ID"];
170 return '<tr><td colspan="2">' .
Loc::getMessage(
"SALE_VK_NEED_SAVE_SECTION") .
'</td></tr>';
174 $exports = $vk->getExportProfilesList();
178 '<tr><td colspan="2">' .
179 Loc::getMessage(
"SALE_VK_NEED_EXPORT_PROFILE", array(
'#A1' =>
'/bitrix/admin/sale_vk_export_list.php')) .
186 $resultHtml .=
'<tr><td colspan="2">';
188 <table class="internal" id="table_EXPORT_PROFILES"
189 style="border-left: none !important; border-right: none !important; width: 100%;">';
200 <td align="left" class="internal-left">' .
Loc::getMessage(
"SALE_VK_EXPORT_SETTINGS__EXPORT_ID") .
'</td>
201 <td style="width: 220px">' .
Loc::getMessage(
"SALE_VK_EXPORT_SETTINGS__INHERIT") .
'</td>
202 <td style="width: 100px">' .
Loc::getMessage(
"SALE_VK_EXPORT_SETTINGS__ENABLE") .
'</td>
205 ShowJSHint(
Loc::getMessage(
"SALE_VK_EXPORT_SETTINGS__TO_ALBUM_HELP"), array(
'return'=>
true)) .
'
207 '<td style="width: 220px">' .
209 ShowJSHint(
Loc::getMessage(
"SALE_VK_EXPORT_SETTINGS__INCLUDE_CHILDS_HELP"), array(
'return'=>
true)) .
'
211 <td align="left" class="internal-right">' .
213 ShowJSHint(
Loc::getMessage(
"SALE_VK_CATEGORY_SELECTOR_HELP"), array(
'return'=>
true)) .
'
217 foreach ($exports as $export)
222 $currSettings = $sectionsList->prepareSectionToShow($sectionId);
224 $currSettings = $this->compareSettingsWithPost($currSettings, $export[
"ID"]);
225 $currSettings = $sectionsList->prepareSettingsVisibility($currSettings, $sectionId);
228 $vkCategorySelector = $categoriesVk->getVkCategorySelector(
229 $currSettings[
"VK_CATEGORY"],
236 self::setUnactiveExport($export[
'ID']);
240 $resultHtml .=
'<tr id="tr_EXPORT__' . $export[
"ID"] .
' class="vk_export_row" mode="both" left_margin="124" >';
244 <td class="internal-left">
247 class="vk_export__profile_id"
249 name="VK_EXPORT[' . $export[
"ID"] .
'][ID]"
250 value ="' . $export[
"ID"] .
'" />
256 <input ' . $currSettings[
"INHERIT"] .
' ' . $currSettings[
'INHERIT__DISPLAY'] .
'
257 id="vk_export_inherit_' . $export[
"ID"] .
'"
259 name="VK_EXPORT[' . $export[
"ID"] .
'][INHERIT]"
266 <input ' . $currSettings[
"ENABLE"] .
' ' . $currSettings[
"ENABLE__DISPLAY"] .
'
267 id="vk_export_enable_' . $export[
"ID"] .
'"
269 name="VK_EXPORT[' . $export[
"ID"] .
'][ENABLE]"
271 <input type="hidden" name="VK_EXPORT[' . $export[
"ID"] .
'][IBLOCK]" value="' . $iblockId .
'">
274 id="vk_export_enable_parent_' . $export[
"ID"] .
'"
275 value="' . $currSettings[
"ENABLE__PARENT"] .
'">
279 $sectionsSelector = $sectionsList->getSectionsSelector($currSettings[
"TO_ALBUM"],
false);
284 id="vk_export_to_album_current_' . $export[
"ID"] .
'"
285 name="VK_EXPORT[' . $export[
"ID"] .
'][TO_ALBUM_CURRENT]"
286 value="' . $sectionId .
'">
289 id="vk_export_to_album_parent_' . $export[
"ID"] .
'"
290 value="' . $currSettings[
"TO_ALBUM__PARENT"] .
'">
292 <select ' . $currSettings[
"TO_ALBUM__DISPLAY"] .
'
294 id="vk_export_to_album_' . $export[
"ID"] .
'"
295 class="vk_sale_export_category_to_album"
296 name="VK_EXPORT[' . $export[
"ID"] .
'][TO_ALBUM]">' .
297 $sectionsSelector .
'
301 '<div id="vk_export_to_album_alias_container_'. $export[
"ID"] .
'"
302 style="margin-top: 6px; '. $currSettings[
"TO_ALBUM_ALIAS__DISPLAY"] .
'">' .
303 '<i>'.Loc::getMessage(
"SALE_VK_EXPORT_SETTINGS__TO_ALBUM_ALIAS").
': </i>'.
305 'id="vk_export_to_album_alias_' . $export[
"ID"] .
'"' .
307 'name="VK_EXPORT[' . $export[
"ID"] .
'][TO_ALBUM_ALIAS]"'.
308 'size="25" maxlength="255"' .
309 'value="' . $currSettings[
"TO_ALBUM_ALIAS"] .
'"'.
313 'id="vk_export_to_album_alias_parent_' . $export[
"ID"] .
'"'.
314 'value="' . $currSettings[
"TO_ALBUM_ALIAS__PARENT"] .
'"'.
322 <input ' . $currSettings[
"INCLUDE_CHILDS__DISPLAY"] .
' ' . $currSettings[
"INCLUDE_CHILDS"] .
'
323 id="vk_export_include_childs_' . $export[
"ID"] .
'"
325 name="VK_EXPORT[' . $export[
"ID"] .
'][INCLUDE_CHILDS]"
330 id="vk_export_include_childs_parent_' . $export[
"ID"] .
'"
331 value="' . $currSettings[
"INCLUDE_CHILDS__PARENT"] .
'">
337 <td class="internal - right">
338 <select ' . $currSettings[
"VK_CATEGORY__DISPLAY"] .
'
339 id="vk_export_vk_category_' . $export[
"ID"] .
'"
340 name="VK_EXPORT[' . $export[
"ID"] .
'][VK_CATEGORY]">' .
341 $vkCategorySelector .
'
345 id="vk_export_vk_category_parent_' . $export[
"ID"] .
'"
346 value="' . $currSettings[
"VK_CATEGORY__PARENT"] .
'">
349 $resultHtml .=
'</tr>';
352 $resultHtml .=
'</table>';
353 $resultHtml .= BeginNote() .
Loc::getMessage(
"SALE_VK_CATEGORY_INTRO") . EndNote();
354 $resultHtml .=
'</td></tr>';
358 \Bitrix\Main\Page\Asset::getInstance()->addJs(
"/bitrix/js/sale/vk_section_edit.js",
true);