Two new hooks for pages loaded from database (custom pages)

HOOK_BEFORE_PAGE_CUSTOM,
HOOK_AFTER_PAGE_CUSTOM
This commit is contained in:
slawkens 2025-06-03 06:21:44 +02:00
parent 770ffcfc52
commit c961a1ebf8
2 changed files with 5 additions and 1 deletions

View File

@ -252,7 +252,7 @@ else {
$success = false;
$tmp_content = getCustomPage($pageName, $success);
if ($success) {
if ($success && $hooks->trigger(HOOK_BEFORE_PAGE_CUSTOM)) {
$content .= $tmp_content;
if (hasFlag(FLAG_CONTENT_PAGES) || superAdmin()) {
$pageInfo = getCustomPageInfo($pageName);
@ -260,6 +260,8 @@ else {
) . $content;
}
$hooks->trigger(HOOK_AFTER_PAGE_CUSTOM);
$page = $pageName;
$file = false;
}

View File

@ -8,7 +8,9 @@ $i = 0;
define('HOOK_INIT', ++$i);
define('HOOK_STARTUP', ++$i);
define('HOOK_BEFORE_PAGE', ++$i);
define('HOOK_BEFORE_PAGE_CUSTOM', ++$i);
define('HOOK_AFTER_PAGE', ++$i);
define('HOOK_AFTER_PAGE_CUSTOM', ++$i);
define('HOOK_FINISH', ++$i);
define('HOOK_TIBIACOM_ARTICLE', ++$i);
define('HOOK_TIBIACOM_BORDER_3', ++$i);