I'm creating a new module (xHacks) to implement XOOPS hacks from within the administration area. And to do this i use preloads, but i couldn't find a list of all available preloads so i created one.
These are all the preloads i could find in XOOPS 2.4.2
CORE:class\database\databasefactory.php :$xoopsPreload->triggerEvent('core.class.database.databasefactory.connection', array(&$class));Before database connection
class\smarty\xoops_plugins\function.xoInboxCount.php$xoopsPreload->triggerEvent('core.class.smarty.xoops_plugins.xoinboxcount', array($pm_handler));Before counting the number of new pm's
class\theme_blocks.php$xoopsPreload->triggerEvent('core.class.theme_blocks.retrieveBlocks', array(&$this, &$template, &$block_arr));Before retrieving the blocks
class\xoopsform\formdhtmltextarea.php$xoopsPreload->triggerEvent('core.class.xoopsform.formdhtmltextarea.codeicon', array(&$code));After setting the button toolbar of the DTHML text area
edituser.php$xoopsPreload->triggerEvent('core.edituser.start');At the beginning of edituser.php
footer.php$xoopsPreload->triggerEvent('core.footer.start');At the beginning of footer.php
$xoopsPreload->triggerEvent('core.footer.end');At the end of footer.php
header.php$xoopsPreload->triggerEvent('core.header.start');At the beginning of header.php
$xoopsPreload->triggerEvent('core.header.addmeta');At the loading of the META data
$xoopsPreload->triggerEvent('core.header.end');At the end of header.php
include\common.php$xoopsPreload->triggerEvent('core.include.common.start');At the beginning of common.php
$xoopsPreload->triggerEvent('core.include.common.language');Before loading the language files
$xoopsPreload->triggerEvent('core.include.common.end');At the end of common.php
include\functions.php$xoopsPreload->triggerEvent('core.include.functions.redirectheader', array($url, $time, $message, $addredirect, $allowExternalLink));At the beginning of the redirectheader() function.
index.php$xoopsPreload->triggerEvent('core.index.start');At the beginning of index.php.
lostpass.php$xoopsPreload->triggerEvent('core.lostpass.start');At the beginning of lostpass.php.
pmlite.php$xoopsPreload->triggerEvent('core.pmlite.start');At the beginning of pmlite.php
readpmsg.php$xoopsPreload->triggerEvent('core.readpmsg.start');At the beginning of readpmsg.php
register.php$xoopsPreload->triggerEvent('core.register.start');At the beginning of register.php
user.php$xoopsPreload->triggerEvent('core.user.start');At the beginning of user.php
userinfo.php$xoopsPreload->triggerEvent('core.userinfo.start');At the beginning of userinfo.php
viewpmsg.php$xoopsPreload->triggerEvent('core.viewpmsg.start');At the beginning of viewpmsg.php
SYSTEM MODULE:modules\system\admin\users\main.php$xoopsPreload->triggerEvent('system.admin.users.main.start');At the beginning of main.php.
modules\system\blocks\system_blocks.php$xoopsPreload->triggerEvent('system.blocks.system_blocks.usershow', array(&$pm_handler));At the loading of the XOOPS "User Menu" block.
modules\system\class\gui.php$xoopsPreload->triggerEvent('system.class.gui.header');At the end of the header() function.
But i don't know if these are all available preloads in XOOPS 2.4.2 so if you know some more please post.
After i created this list i started working out the actual preload files.
So for all module developers that want to use preloads but don't know how to use them... This could come in handy:
modules/YourModule/preloads/core.php: (All core preloads)
###############################################################################
## Copyright (C) 2009 Dylian Melgert ##
## ##
## This program is free software: you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation, either version 3 of the License, or ##
## (at your option) any later version. ##
## ##
## This program is distributed in the hope that it will be useful, ##
## but WITHOUT ANY WARRANTY; without even the implied warranty of ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ##
## GNU General Public License for more details. ##
## ##
## You should have received a copy of the GNU General Public License ##
## along with this program. If not, see .##
###############################################################################
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class YourModuleCorePreload extends XoopsPreloadItem{
function eventCoreClassDatabaseDatabasefactoryConnection($args){
// $args[0] Contains the classname of the Database connection class
// Something to do at the event...
}
function eventCoreClassSmartyXoops_pluginsXoinboxcount($args){
// $args[0] Contains the pm handler
// Something to do at the event...
}
function eventCoreClassTheme_blocksRetrieveBlocks($args){
// $args[0] Contains the current object
// $args[1] Contains XoopsTpl() object
// $args[2] Contains an array of XoopsBlock() objects
// Something to do at the event...
}
function eventCoreClassXoopsformFormdhtmltextareaCodeicon($args){
// $args[0] Contains the code variable (DHTML icon bar)
// Something to do at the event...
}
function eventCoreEdituserStart(){
// Something to do at the event...
}
function eventCoreFooterStart(){
// Something to do at the event...
}
function eventCoreFooterEnd(){
// Something to do at the event...
}
function eventCoreHeaderStart(){
// Something to do at the event...
}
function eventCoreHeaderAddmeta(){
// Something to do at the event...
}
function eventCoreHeaderEnd(){
// Something to do at the event...
}
function eventCoreIncludeCommonStart(){
// Something to do at the event...
}
function eventCoreIncludeCommonLanguage(){
// Something to do at the event...
}
function eventCoreIncludeCommonEnd(){
// Something to do at the event...
}
function eventCoreIncludeFunctionsRedirectheader($args){
// $args[0] Contains the url variable (The URL to redirect to)
// $args[1] Contains the time variable (How long to wait before redirecting)
// $args[2] Contains the addredirect variable (If you want to add [[?/&]]xoops_redirect=[[current_url]] to the redirect url.)
// $args[3] Contains the message variable (The message to show to the user)
// $args[4] Contains the allowExternalLink variable (If you want to allow redirects to external url's)
// Something to do at the event...
}
function eventCoreIndexStart(){
// Something to do at the event...
}
function eventCoreLostpassStart(){
// Something to do at the event...
}
function eventCorePmliteStart(){
// Something to do at the event...
}
function eventCoreReadpmsgStart(){
// Something to do at the event...
}
function eventCoreRegisterStart(){
// Something to do at the event...
}
function eventCoreUserStart(){
// Something to do at the event...
}
function eventCoreUserinfoStart(){
// Something to do at the event...
}
function eventCoreViewpmsgStart(){
// Something to do at the event...
}
}
?>
modules/YourModule/preloads/systemModule.php: (All sytem module preloads)
###############################################################################
## Copyright (C) 2009 Dylian Melgert ##
## ##
## This program is free software: you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation, either version 3 of the License, or ##
## (at your option) any later version. ##
## ##
## This program is distributed in the hope that it will be useful, ##
## but WITHOUT ANY WARRANTY; without even the implied warranty of ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ##
## GNU General Public License for more details. ##
## ##
## You should have received a copy of the GNU General Public License ##
## along with this program. If not, see .##
###############################################################################
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class YourModuleSystemModulePreload extends XoopsPreloadItem{
function eventSystemAdminUsersMainStart(){
// Something to do at the event...
}
function eventSystemBlocksSystem_blocksUsershow($args){
// $args[0] Contains the pm handler
// Something to do at the event...
}
function eventSystemClassGuiHeader(){
// Something to do at the event...
}
}
?>
I hope this helped and that someone will check whether the information is correct.
Greets Dylian.