- Модуль: iblock
- Путь к файлу: ~/bitrix/modules/iblock/lib/component/element.php
- Класс: BitrixIblockComponentElement
- Вызов: Element::initAdminIconsPanel
protected function initAdminIconsPanel()
{
global $APPLICATION, $USER;
if (!$USER->IsAuthorized())
return;
$arResult =& $this->arResult;
if (
$APPLICATION->GetShowIncludeAreas()
|| $this->arParams['SET_TITLE']
|| isset($arResult[$this->arParams['BROWSER_TITLE']])
)
{
if (Loader::includeModule('iblock'))
{
$returnUrl = array(
'add_element' => CIBlock::GetArrayByID($this->arParams['IBLOCK_ID'], 'DETAIL_PAGE_URL'),
'delete_element' =>
isset($arResult['SECTION'])
? $arResult['SECTION']['SECTION_PAGE_URL']
: $arResult['LIST_PAGE_URL'],
);
$buttonParams = array(
'RETURN_URL' => $returnUrl,
'CATALOG' => true
);
if (isset($arResult['USE_CATALOG_BUTTONS']))
{
$buttonParams['USE_CATALOG_BUTTONS'] = $arResult['USE_CATALOG_BUTTONS'];
if (!empty($buttonParams['USE_CATALOG_BUTTONS']))
{
$buttonParams['SHOW_CATALOG_BUTTONS'] = true;
}
}
$buttons = CIBlock::GetPanelButtons(
$arResult['IBLOCK_ID'],
$arResult['ID'],
$arResult['IBLOCK_SECTION_ID'],
$buttonParams
);
unset($buttonParams);
if ($APPLICATION->GetShowIncludeAreas())
{
$this->addIncludeAreaIcons(CIBlock::GetComponentMenu($APPLICATION->GetPublicShowMode(), $buttons));
}
if ($this->arParams['SET_TITLE'] || isset($arResult[$this->arParams['BROWSER_TITLE']]))
{
$this->storage['TITLE_OPTIONS'] = null;
if (isset($buttons['submenu']['edit_element']))
{
$this->storage['TITLE_OPTIONS'] = [
'ADMIN_EDIT_LINK' => $buttons['submenu']['edit_element']['ACTION'],
'PUBLIC_EDIT_LINK' => $buttons['edit']['edit_element']['ACTION'],
'COMPONENT_NAME' => $this->getName(),
];
}
}
}
}
}