A
A
Alexander2020-04-27 15:20:52
1C-Bitrix
Alexander, 2020-04-27 15:20:52

How to launch an event handler in Bitrix when changing the settings of your module in the form?

I am writing a module that should have the functionality of logging the events of elements of highload blocks, it should fix the number of added/changed/deleted elements.

Tell me how, when changing the settings in the module, launch the event handler in Bitrix. In the settings form, I specify the highload block for which it is necessary to track events (to change / delete / edit). And then, when saving, Bitrix needs to install the event handler only on the highload block selected in the form.

5ea6cdb4db760261071028.jpeg

I assumed that in the install/index.php file, in the InstallEvents method, you need to access the module settings, take the ID of the selected highload block, but this will probably work only when installing the module when the default highload block is specified? What to do if the module settings are changed, in which file should such a handler be located?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2020-04-27
@rpsv

Add the event handler to module/include.php, and connect the module itself tophp_interface/init.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question