From 76440a37d009b845db9157312f2807774e15de14 Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 15 May 2025 20:22:36 +0200 Subject: [PATCH] New hooks for account characters change-comment page --- system/hooks.php | 4 ++++ system/pages/account/change_comment.php | 2 ++ system/templates/account.change_comment.html.twig | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/system/hooks.php b/system/hooks.php index 93c7b945..c0bf5a5b 100644 --- a/system/hooks.php +++ b/system/hooks.php @@ -30,6 +30,10 @@ define('HOOK_CHARACTERS_AFTER_CHARACTERS', ++$i); define('HOOK_LOGIN', ++$i); define('HOOK_LOGIN_ATTEMPT', ++$i); define('HOOK_LOGOUT', ++$i); +define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_SUCCESS', ++$i); +define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_NAME', ++$i); +define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_HIDE_ACCOUNT', ++$i); +define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_COMMENT', ++$i); define('HOOK_ACCOUNT_CREATE_BEFORE_FORM', ++$i); define('HOOK_ACCOUNT_CREATE_BEFORE_BOXES', ++$i); define('HOOK_ACCOUNT_CREATE_BETWEEN_BOXES_1', ++$i); diff --git a/system/pages/account/change_comment.php b/system/pages/account/change_comment.php index f5b8f733..19c622ae 100644 --- a/system/pages/account/change_comment.php +++ b/system/pages/account/change_comment.php @@ -36,6 +36,8 @@ if($player_name != null) { 'description' => 'The character information has been changed.' )); $show_form = false; + + $hooks->trigger(HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_SUCCESS, ['player' => $player]); } } } else { diff --git a/system/templates/account.change_comment.html.twig b/system/templates/account.change_comment.html.twig index 15ac2208..fdcc770c 100644 --- a/system/templates/account.change_comment.html.twig +++ b/system/templates/account.change_comment.html.twig @@ -32,6 +32,7 @@ If you do not want to specify a certain field, just leave it blank.

Name: {{ player.getName() }} + {{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_NAME') }} Hide Account: @@ -41,6 +42,7 @@ If you do not want to specify a certain field, just leave it blank.

{% if player.getCustomField('group_id') > 1 %} (you will be also hidden on the Team page!){% endif %} + {{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_HIDE_ACCOUNT') }} @@ -64,6 +66,7 @@ If you do not want to specify a certain field, just leave it blank.

Comment:
[max. length: 2000 chars, 50 lines (ENTERs)] + {{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_COMMENT') }} @@ -108,4 +111,4 @@ If you do not want to specify a certain field, just leave it blank.

- \ No newline at end of file +