Skip to content

Instantly share code, notes, and snippets.

@Ginnw2
Created April 8, 2021 07:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Ginnw2/d50bb5effb30d9012aa4ea695f3ae036 to your computer and use it in GitHub Desktop.
Save Ginnw2/d50bb5effb30d9012aa4ea695f3ae036 to your computer and use it in GitHub Desktop.
Для добавления пункта меню в раздел CRM Б24
<?/*в init.php событие OnAfterCrmControlPanelBuild*/
\Bitrix\Main\EventManager::getInstance()->addEventHandlerCompatible(
"crm",
"OnAfterCrmControlPanelBuild",
function( &$menuItems ){
// $menuItems - список элементов меню по ссылке. Можно даже удалить
$menuItems[] = [
/**
* ID пункт меню. Нужен для подсветки на странице
* @var string
*/
'ID' => 'CUSTOM_REPORTS',
/**
* ID js-пункта меню. Для счетчиков и action-комманд
* @var string
*/
'MENU_ID' => 'menu_crm_custom_reports',
/**
* Название и hover title
* @var string
*/
'NAME' => 'Пользовательские отчеты',
'TITLE' => 'Пользовательские отчеты',
/**
* Ссылка, куда вести по нажатию
* @var string
*/
'URL' => '/crm/_some_link_/',
];
}
);
/* на странице нужно вызвать доп.компонент:*/
$APPLICATION->IncludeComponent(
'bitrix:crm.control_panel',
'',
array(
'ID' => 'CUSTOM_REPORTS',
'ACTIVE_ITEM_ID' => 'CUSTOM_REPORTS',
)
);?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment