You need to add a button to the discount change form. Having rummaged in the code, I found the OnAdminContextMenuShow handler. How can I subscribe to it from my module? I found only one way in the documentation: register the listener in the /bitrix/php_interface/init.php listener using the AddEventHandler function. How to automate it?
|
1 answer
To register an event in its module, RegisterModuleDependences used.
example:RegisterModuleDependences( "iblock", // ΠΌΠΎΠ΄ΡΠ»Ρ Π² ΠΊΠΎΡΠΎΡΠΎΠΌ ΠΏΡΠΎΠΈΡΡ
ΠΎΠ΄ΠΈΡ ΡΠΎΠ±ΡΡΠΈΠ΅ "OnBeforeIBlockElementUpdate", // Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΡΠΎΠ±ΡΡΠΈΡ "mymodule", // Π½Π°Π·Π²Π°Π½ΠΈΠ΅ Π²Π°ΡΠ΅Π³ΠΎ ΠΌΠΎΠ΄ΡΠ»Ρ "cMainRPJ",// ΠΈΠΌΡ Π²Π°ΡΠ΅Π³ΠΎ ΠΊΠ»Π°ΡΡΠ° ΠΎΠ±ΡΠ°Π±ΠΎΡΡΠΈΠΊΠ° "onBeforeElementUpdateHandler" // ΠΈΠΌΡ Π²Π°ΡΠ΅Π³ΠΎ ΠΌΠ΅ΡΠΎΠ΄Π° ΠΎΠ±ΡΠ°Π±ΠΎΡΡΠΈΠΊΠ° );
All this should be in the method when installing the DoInstall module DoInstall
|