Merge branch 'develop' into feature/settings

This commit is contained in:
slawkens 2023-07-20 14:24:46 +02:00
commit a7b8ccaee2
5 changed files with 20 additions and 9 deletions

View File

@ -69,6 +69,10 @@ define('HOOK_ADMIN_LOGIN_AFTER_PASSWORD', ++$i);
define('HOOK_ADMIN_LOGIN_AFTER_SIGN_IN', ++$i);
define('HOOK_ADMIN_ACCOUNTS_SAVE_POST', ++$i);
define('HOOK_EMAIL_CONFIRMED', ++$i);
define('HOOK_GUILDS_BEFORE_GUILD_HEADER', ++$i);
define('HOOK_GUILDS_AFTER_GUILD_HEADER', ++$i);
define('HOOK_GUILDS_AFTER_GUILD_INFORMATION', ++$i);
define('HOOK_GUILDS_AFTER_GUILD_MEMBERS', ++$i);
define('HOOK_GUILDS_AFTER_INVITED_CHARACTERS', ++$i);
const HOOK_FIRST = HOOK_STARTUP;

View File

@ -311,7 +311,6 @@ if(config('highscores_balance'))
/** @var Twig\Environment $twig */
$twig->display('highscores.html.twig', [
'highscores' => $highscores,
'totalRows' => $i - 1,
'list' => $list,
'skill' => $skill,
'skillName' => ($skill == SKILL_FRAGS ? 'Frags' : ($skill == SKILL_BALANCE ? 'Balance' : getSkillName($skill))),

View File

@ -1,6 +1,7 @@
<div class="Border_2">
<div class="Border_3">
<div class="BoxContent">
{{ hook('HOOK_GUILDS_BEFORE_GUILD_HEADER') }}
<table border="0" width="100%">
<tbody>
<tr>
@ -16,7 +17,9 @@
</tr>
</tbody>
</table>
<br>
<br/>
{{ hook('HOOK_GUILDS_AFTER_GUILD_HEADER') }}
<table width="100%">
<tbody>
@ -83,8 +86,10 @@
</tr>
</tbody>
</table>
<br/>
{{ hook('HOOK_GUILDS_AFTER_GUILD_INFORMATION') }}
<br>
<div class="TableContainer">
<div class="TableContainer">
<div class="CaptionContainer">
@ -193,7 +198,9 @@
</tbody>
</table>
</div>
<br>
<br/>
{{ hook('HOOK_GUILDS_AFTER_GUILD_MEMBERS') }}
<div class="TableContainer">
<div class="CaptionContainer">
@ -263,9 +270,9 @@
</tbody>
</table>
</div>
<br>
<br/>
{{ hook(constant('HOOK_GUILDS_AFTER_INVITED_CHARACTERS'), { 'guild': guild, 'isLeader': isLeader }) }}
{{ hook('HOOK_GUILDS_AFTER_INVITED_CHARACTERS', { 'guild': guild, 'isLeader': isLeader }) }}
<div class="TableContainer">
<table class="Table3" cellpadding="0" cellspacing="0">

View File

@ -48,7 +48,7 @@
{% endif %}
</tr>
{% if totalRows < 1 %}
{% if highscores|length < 1 %}
<tr bgcolor="{{ config('darkborder') }}"><td colspan="100%">No records yet.</td></tr>
{% else %}
{% set row = 0 %}

View File

@ -90,15 +90,16 @@ $function = new TwigFunction('truncate', function ($s, $n) {
});
$twig->addFunction($function);
$function = new TwigFunction('hook', function ($hook, array $params = []) {
$function = new TwigFunction('hook', function ($context, $hook, array $params = []) {
global $hooks;
if(is_string($hook)) {
$hook = constant($hook);
}
$params['context'] = $context;
$hooks->trigger($hook, $params);
});
}, ['needs_context' => true]);
$twig->addFunction($function);
$function = new TwigFunction('config', function ($key) {