- Модуль: fileman
- Путь к файлу: ~/bitrix/modules/fileman/lib/block/editor.php
- Класс: BitrixFilemanBlockEditor
- Вызов: Editor::setBlockList
public function setBlockList(array $blocks)
{
$this->blocks = $blocks;
if(!is_array($this->blocks))
{
$this->blocks = array();
}
foreach($this->blocks as $key => $block)
{
if(!isset($block['TYPE']))
{
$block['TYPE'] = $block['CODE'];
}
$block['IS_COMPONENT'] = false;
$block['CLASS'] = $block['CODE'];
$this->blocks[$key] = $block;
}
$componentsNotAsBlocks = array();
if (!$this->useLightTextEditor)
{
$componentList = $this->getComponentList();
foreach($componentList as $component)
{
if(!isset($this->componentsAsBlocks[$component['NAME']]))
{
$componentsNotAsBlocks[] = array(
'TYPE' => 'component',
'IS_COMPONENT' => true,
'CODE' => $component['NAME'],
'NAME' => $component['TITLE'],
'DESC' => $component['TITLE'] . ".n" . $component['DESCRIPTION'],
'HTML' => ''
);
}
else
{
$interfaceName = $this->componentsAsBlocks[$component['NAME']]['NAME'];
$this->blocks[] = array(
'TYPE' => 'component',
'IS_COMPONENT' => false,
'CODE' => $component['NAME'],
'NAME' => $interfaceName ? $interfaceName : $component['TITLE'],
'DESC' => $component['DESCRIPTION'],
'HTML' => ''
);
}
}
}
$this->blocks = array_merge($this->blocks, $componentsNotAsBlocks);
}