Bitrix API

SectionsList

Class SectionsList Work with iblock sections - get export settings, get list of saving sections, formatted settings to save etc

Table of Contents

Constants

CACHE_DIR  = '/sale/vkexport/'
CACHE_ID_MAPPED_SECTIONS  = "mapped_sections"
CACHE_ID_MAPPED_SECTIONS_LIST  = "mapped_sections_list"
CACHE_ID_PREFIX  = "vk_sectionslist_cache"
CACHE_ID_SECTIONS  = "iblock_sections"
CACHE_TTL  = 86400
VK_ICON  = '<img src="/bitrix/images/sale/vk/vk_icon.png" style="height:16px; width:16px; margin-right: 1em;" />'
VK_ICON_EMPTY  = '<span style="width:16px; margin-right: 1em; display:inline-block;"></span>'

Methods

__construct()  : mixed
SectionsList constructor.
clearCaches()  : mixed
Clean all caches for class. Run in moment of changed sections settings
createCacheIdMappedSections()  : string
Create cache ID for mapped sections list
createCacheIdMappedSectionsList()  : string
Create cache ID for mapped sections list
createCacheIdSections()  : string
Create cache ID for iblock sections
getMappedIblocks()  : array<string|int, mixed>
Collect IBLOCK for all mapped sections. Need at creation FEEDs for product export
getMultiSectionsToProduct()  : mixed
getSectionMapToPrint()  : mixed
Prepare mapped sections to print export map
getSections()  : array<string|int, mixed>
Return list of iblock sections. At the first run saving list in cache.
getSectionsSelector()  : string
Create selector for HTML. Not create <select> tag, only inner <options>
getSectionsToAlbumsExport()  : array<string|int, mixed>
Find and converted all section to albums export.
getSectionsToMap()  : array<string|int, mixed>
Get extend sections array - group sections by VK-album, add URL to VK album, add URL to section edit page, add count of element
getSectionsToProductExport()  : array<string|int, mixed>
Find and converted all section to product export.
getToAlbumBySection()  : int
Find parameter TO_ALBUM to section. Check INHERING and parent settings
getVkCategory()  : int
Return vk default category from settings.
prepareChildsToSave()  : array<string|int, mixed>
Create settings for childs.
prepareSectionToSave()  : array<string|int, mixed>
Validate settings before saving Check settings dependence, adjust them if neede or set default values.
prepareSectionToShow()  : array<string|int, mixed>
Get saved values for selected section and export ID and format them.
prepareSettingsVisibility()  : mixed
Set visibility for controls according by settings. Return settings array
setCurrSectionSettings()  : mixed

Constants

CACHE_ID_MAPPED_SECTIONS

public mixed CACHE_ID_MAPPED_SECTIONS = "mapped_sections"

CACHE_ID_MAPPED_SECTIONS_LIST

public mixed CACHE_ID_MAPPED_SECTIONS_LIST = "mapped_sections_list"

CACHE_ID_PREFIX

public mixed CACHE_ID_PREFIX = "vk_sectionslist_cache"

CACHE_ID_SECTIONS

public mixed CACHE_ID_SECTIONS = "iblock_sections"

VK_ICON

public mixed VK_ICON = '<img src="/bitrix/images/sale/vk/vk_icon.png" style="height:16px; width:16px; margin-right: 1em;" />'

VK_ICON_EMPTY

public mixed VK_ICON_EMPTY = '<span style="width:16px; margin-right: 1em; display:inline-block;"></span>'

Methods

__construct()

SectionsList constructor.

public __construct(mixed $exportId) : mixed
Parameters
$exportId : mixed

clearCaches()

Clean all caches for class. Run in moment of changed sections settings

public clearCaches() : mixed

createCacheIdMappedSections()

Create cache ID for mapped sections list

public createCacheIdMappedSections() : string
Return values
string

createCacheIdMappedSectionsList()

Create cache ID for mapped sections list

public createCacheIdMappedSectionsList() : string
Return values
string

createCacheIdSections()

Create cache ID for iblock sections

public createCacheIdSections([mixed $onlyMapped = true ]) : string
Parameters
$onlyMapped : mixed = true
Return values
string

getMappedIblocks()

Collect IBLOCK for all mapped sections. Need at creation FEEDs for product export

public getMappedIblocks() : array<string|int, mixed>
Return values
array<string|int, mixed>

of iblocks IDs

getMultiSectionsToProduct()

public getMultiSectionsToProduct(mixed $pdoructsIds) : mixed
Parameters
$pdoructsIds : mixed

getSectionMapToPrint()

Prepare mapped sections to print export map

public getSectionMapToPrint() : mixed

getSections()

Return list of iblock sections. At the first run saving list in cache.

public getSections([bool $tree = false ][, mixed $onlyMapped = true ]) : array<string|int, mixed>
Parameters
$tree : bool = false
  • is true - list will be converted to tree
$onlyMapped : mixed = true
Tags
throws
SystemException
Return values
array<string|int, mixed>

getSectionsSelector()

Create selector for HTML. Not create <select> tag, only inner <options>

public getSectionsSelector([null $checkedSection = null ][, mixed $onlyMapped = true ]) : string
Parameters
$checkedSection : null = null
  • ID of section. If not NULL - this option will be checked
$onlyMapped : mixed = true
Tags
throws
SystemException
Return values
string

getSectionsToAlbumsExport()

Find and converted all section to albums export.

public getSectionsToAlbumsExport() : array<string|int, mixed>

Check inhering of parameters and define which sections will be exported

Return values
array<string|int, mixed>
  • in field "SECTIONS" - array of sections ID. In field "ALIASES" - aliases for sections.

getSectionsToMap()

Get extend sections array - group sections by VK-album, add URL to VK album, add URL to section edit page, add count of element

public getSectionsToMap() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSectionsToProductExport()

Find and converted all section to product export.

public getSectionsToProductExport() : array<string|int, mixed>

Check inhering of parameters and define which sections will be exported

Return values
array<string|int, mixed>
  • array of sections ID

getToAlbumBySection()

Find parameter TO_ALBUM to section. Check INHERING and parent settings

public getToAlbumBySection(mixed $sectionId) : int
Parameters
$sectionId : mixed
Return values
int

ID of section to adding

getVkCategory()

Return vk default category from settings.

public getVkCategory(mixed $sectionId) : int
Parameters
$sectionId : mixed
Return values
int

prepareChildsToSave()

Create settings for childs.

public prepareChildsToSave(mixed $sectionId) : array<string|int, mixed>

For childs set only INHERIT option and VK CATEGORY. Other settings will be getting in export

Parameters
$sectionId : mixed
Return values
array<string|int, mixed>

prepareSectionToSave()

Validate settings before saving Check settings dependence, adjust them if neede or set default values.

public prepareSectionToSave(mixed $sectionId) : array<string|int, mixed>

Return array to mappng

Parameters
$sectionId : mixed
Return values
array<string|int, mixed>

prepareSectionToShow()

Get saved values for selected section and export ID and format them.

public prepareSectionToShow(mixed $sectionId) : array<string|int, mixed>

Check settings dependence, adjust them if needed or set default values. Set visibility for controls according by settings

Parameters
$sectionId : mixed
Return values
array<string|int, mixed>

prepareSettingsVisibility()

Set visibility for controls according by settings. Return settings array

public prepareSettingsVisibility(mixed $params, mixed $sectionId) : mixed
Parameters
$params : mixed
$sectionId : mixed

setCurrSectionSettings()

public setCurrSectionSettings(mixed $settings) : mixed
Parameters
$settings : mixed

array


        
On this page

Search results