10
Hi, you can add preload triggers in system module. I'm following some conventions so the hook name reflects the path to the file + a short description: For your image manager you would likely use this code:
$xoopsPreload =& XoopsPreload::getInstance();
$xoopsPreload->triggerEvent('system.admin.images.main.start');
You can pass an array with triggerEvent $xoopsPreload->triggerEvent('hookname', $args);
Then you create in your preloads folder a system.php file with the following code (minimal)
class ImagemanagerSystemPreload extends XoopsPreloadItem
{
function eventSystemAdminImagesMainStart($args)
{
// any code goes here
}
}
?>
Creating extra system.php preload file is not really needed, it could go on the core.php you already have. It just help to make things clear.
What is really necessary for the trigger to work is that:
- you have a file in preloads folder with a class that extends
XoopsPreloadItem and follows ModuledirnameFilenamePreload convention
- class has a method that begins with 'event' followed by the hook name without '.'. Does not have to be Camel Case but it should!
After you have things working you can ask the Core Team to add the preload trigger in core.