Answer the question
In order to leave comments, you need to log in
Subscribe your module to the Bitrix event?
Good afternoon.
Tell me, please, how to subscribe your module to the event?
Everything works if I directly write in /local/php_interface/init.php:
AddEventHandler("main", "OnAdminListDisplay", "MyOnAdminListDisplay");
function MyOnAdminListDisplay(&$list)
{
#Только для разделов инфоблока
if (strpos($list->table_id, 'tbl_iblock_section') !== false)
{
#Добавляем пункт в контекстное меню
foreach ($list->aRows as $row)
{
$row->aActions["archive"]["ICON"] = "";
$row->aActions["archive"]["TEXT"] = "Удалить весь сайт нахер";
$row->aActions["archive"]["ACTION"] = "javascript:archive(".$row->id.")";
}
}
}
function InstallEvents()
{
$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->registerEventHandler(
'main',
'OnAdminListDisplay',
self::MODULE_ID,
'CKrasovskyEvent',
'eventHandler'
);
return true;
}
class CKrasovskyEvent
{
function eventHandler(&$list)
{
#Только для разделов инфоблока
if (strpos($list->table_id, 'tbl_iblock_section') !== false)
{
#Добавляем пункт в контекстное меню
foreach ($list->aRows as $row)
{
$row->aActions["archive"]["ICON"] = "";
$row->aActions["archive"]["TEXT"] = "Удалить весь сайт нахер";
$row->aActions["archive"]["ACTION"] = "javascript:archive(".$row->id.")";
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question