Skip to content

Commit a60a23b

Browse files
committed
(from 0.8) Patch missing change-comment hooks
1 parent f640ca6 commit a60a23b

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

system/pages/account/characters/change-comment.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
'description' => 'The character information has been changed.'
5252
));
5353
$show_form = false;
54+
55+
$hooks->trigger(HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_SUCCESS, ['player' => $player]);
5456
}
5557
}
5658
} else {
@@ -70,9 +72,11 @@
7072
}
7173

7274
if(isset($player) && $player) {
73-
$twig->display('account.characters.change-comment.html.twig', array(
74-
'player' => $player->toArray()
75-
));
75+
$_player = $player->toArray();
76+
$_player['id'] = $player->id; // Hack, as it's somehow missing in the toArray() function
77+
78+
$twig->display('account.characters.change-comment.html.twig', [
79+
'player' => $_player,
80+
]);
7681
}
7782
}
78-
?>

system/src/global.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
define('HOOK_LOGIN', ++$i);
2929
define('HOOK_LOGIN_ATTEMPT', ++$i);
3030
define('HOOK_LOGOUT', ++$i);
31+
define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_SUCCESS', ++$i);
32+
define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_NAME', ++$i);
33+
define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_HIDE_ACCOUNT', ++$i);
34+
define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_COMMENT', ++$i);
3135
define('HOOK_ACCOUNT_CHANGE_PASSWORD_AFTER_OLD_PASSWORD', ++$i);
3236
define('HOOK_ACCOUNT_CHANGE_PASSWORD_AFTER_NEW_PASSWORD', ++$i);
3337
define('HOOK_ACCOUNT_CHANGE_PASSWORD_POST', ++$i);

system/templates/account.characters.change-comment.html.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ If you do not want to specify a certain field, just leave it blank.<br/><br/>
3333
<td class="LabelV">Name:</td>
3434
<td style="width:80%;" >{{ player.name }}</td>
3535
</tr>
36+
{{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_NAME') }}
3637
<tr>
3738
<td class="LabelV" >Hide Account:</td>
3839
<td>
@@ -42,6 +43,7 @@ If you do not want to specify a certain field, just leave it blank.<br/><br/>
4243
{% if player.group_id > 1 %} (you will be also hidden on the Team page!){% endif %}
4344
</td>
4445
</tr>
46+
{{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_HIDE_ACCOUNT') }}
4547
</table>
4648
</div>
4749
</div>
@@ -65,6 +67,7 @@ If you do not want to specify a certain field, just leave it blank.<br/><br/>
6567
<td class="LabelV" ><span>Comment:</span></td>
6668
<td style="width:80%;"><textarea name="comment" rows="10" cols="50" wrap="virtual">{{ player.comment|raw }}</textarea><br>[max. length: 2000 chars, 50 lines (ENTERs)]</td>
6769
</tr>
70+
{{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_COMMENT') }}
6871
</table>
6972
</div>
7073
</div>

0 commit comments

Comments
 (0)