Callback when someone changes a Group Name

Peter Lane Posted in Component Development 5 months ago

I am creating a component that uses a group name. Is it possible to create a callback that provides group details on the change of name, like the Group Added callback?

German Michael Zülsdorff Replied 5 months ago

Since there's no callback trigger available inside of the changeOwner() method
you may implement it inside of the change_owner action when the changeOwner() method returns with success.
That is:
1. If not already in place create a subdirectory named actions inside of your component
2. copy the original change_owner.php into this subdirectory
3. edit that duplicate and add your ossn_trigger_callback('plgroupextra', 'chgowner', array(of vars you need))
4. unregister the original action
5. register your replacement action
6. register the callback ossn_register_callback('plgroupextra', 'chgowner', 'your_chgowner_handler')

gb Peter Lane Replied 5 months ago

Is it possible to have a callback when the Group Owner is changed?

German Michael Zülsdorff Replied 5 months ago

it is possible to create (=register) any kind of callback.
But of course a callback needs to be triggered somewhere. ;)
Thus, browse the class file of OssnGroups and you will see which callback triggers are available.