From 3a3411c1175e1ba976597a732ed186d6f6e2d14e Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 7 Feb 2023 16:27:02 +0100 Subject: [PATCH] New hooks for admin page, for head, body, and before_page +move LOGIN_POST to correct place --- admin/index.php | 4 +++- admin/template/template.php | 4 ++++ system/hooks.php | 8 ++++++++ system/pages/account/login.php | 6 ++---- system/templates/admin.login.html.twig | 4 +++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/admin/index.php b/admin/index.php index b6cc401a..bb269f3d 100644 --- a/admin/index.php +++ b/admin/index.php @@ -70,7 +70,9 @@ if(!@file_exists($file)) { } ob_start(); -include($file); +if($hooks->trigger(HOOK_ADMIN_BEFORE_PAGE)) { + require $file; +} $content .= ob_get_contents(); ob_end_clean(); diff --git a/admin/template/template.php b/admin/template/template.php index 76f120c9..70ed5174 100644 --- a/admin/template/template.php +++ b/admin/template/template.php @@ -2,6 +2,7 @@ + trigger(HOOK_ADMIN_HEAD_START); ?> <?php echo (isset($title) ? $title . ' - ' : '') . $config['lua']['serverName'];?> @@ -16,8 +17,10 @@ + trigger(HOOK_ADMIN_HEAD_END); ?> +trigger(HOOK_ADMIN_BODY_START); ?>
- + {{ hook('HOOK_ADMIN_LOGIN_AFTER_ACCOUNT') }}
@@ -33,6 +33,7 @@
+ {{ hook('HOOK_ADMIN_LOGIN_AFTER_PASSWORD') }}
@@ -45,6 +46,7 @@
+ {{ hook('HOOK_ADMIN_LOGIN_AFTER_SIGN_IN') }}