mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 17:54:55 +02:00
Two new hooks for pages loaded from database (custom pages)
HOOK_BEFORE_PAGE_CUSTOM, HOOK_AFTER_PAGE_CUSTOM
This commit is contained in:
@@ -334,7 +334,7 @@ if($load_it)
|
|||||||
|
|
||||||
$success = false;
|
$success = false;
|
||||||
$tmp_content = getCustomPage($page, $success);
|
$tmp_content = getCustomPage($page, $success);
|
||||||
if($success) {
|
if($success && $hooks->trigger(HOOK_BEFORE_PAGE_CUSTOM)) {
|
||||||
$content .= $tmp_content;
|
$content .= $tmp_content;
|
||||||
if(hasFlag(FLAG_CONTENT_PAGES) || superAdmin()) {
|
if(hasFlag(FLAG_CONTENT_PAGES) || superAdmin()) {
|
||||||
$pageInfo = getCustomPageInfo($page);
|
$pageInfo = getCustomPageInfo($page);
|
||||||
@@ -342,6 +342,8 @@ if($load_it)
|
|||||||
'page' => array('id' => $pageInfo !== null ? $pageInfo['id'] : 0, 'hidden' => $pageInfo !== null ? $pageInfo['hidden'] : '0')
|
'page' => array('id' => $pageInfo !== null ? $pageInfo['id'] : 0, 'hidden' => $pageInfo !== null ? $pageInfo['hidden'] : '0')
|
||||||
)) . $content;
|
)) . $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hooks->trigger(HOOK_AFTER_PAGE_CUSTOM);
|
||||||
} else {
|
} else {
|
||||||
$file = TEMPLATES . "$template_name/pages/$page.php";
|
$file = TEMPLATES . "$template_name/pages/$page.php";
|
||||||
if(!@file_exists($file) || preg_match('/[^A-z0-9_\-]/', $page)) {
|
if(!@file_exists($file) || preg_match('/[^A-z0-9_\-]/', $page)) {
|
||||||
|
@@ -13,7 +13,9 @@ $i = 0;
|
|||||||
define('HOOK_INIT', ++$i);
|
define('HOOK_INIT', ++$i);
|
||||||
define('HOOK_STARTUP', ++$i);
|
define('HOOK_STARTUP', ++$i);
|
||||||
define('HOOK_BEFORE_PAGE', ++$i);
|
define('HOOK_BEFORE_PAGE', ++$i);
|
||||||
|
define('HOOK_BEFORE_PAGE_CUSTOM', ++$i);
|
||||||
define('HOOK_AFTER_PAGE', ++$i);
|
define('HOOK_AFTER_PAGE', ++$i);
|
||||||
|
define('HOOK_AFTER_PAGE_CUSTOM', ++$i);
|
||||||
define('HOOK_FINISH', ++$i);
|
define('HOOK_FINISH', ++$i);
|
||||||
define('HOOK_TIBIACOM_ARTICLE', ++$i);
|
define('HOOK_TIBIACOM_ARTICLE', ++$i);
|
||||||
define('HOOK_TIBIACOM_BORDER_3', ++$i);
|
define('HOOK_TIBIACOM_BORDER_3', ++$i);
|
||||||
|
Reference in New Issue
Block a user