mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-17 11:13:27 +02:00
Add HOOK_TWIG. Also moved Hooks loading to init.php
For adding twig functions & filters by plugins
This commit is contained in:
@@ -76,6 +76,7 @@ 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);
|
||||
define('HOOK_TWIG', ++$i);
|
||||
|
||||
const HOOK_FIRST = HOOK_STARTUP;
|
||||
define('HOOK_LAST', $i);
|
||||
|
@@ -33,6 +33,11 @@ if(isset($config['gzip_output']) && $config['gzip_output'] && isset($_SERVER['HT
|
||||
require_once SYSTEM . 'libs/cache.php';
|
||||
$cache = Cache::getInstance();
|
||||
|
||||
// event system
|
||||
require_once SYSTEM . 'hooks.php';
|
||||
$hooks = new Hooks();
|
||||
$hooks->load();
|
||||
|
||||
// twig
|
||||
require_once SYSTEM . 'twig.php';
|
||||
|
||||
|
@@ -124,3 +124,5 @@ $filter = new TwigFilter('urlencode', function ($s) {
|
||||
|
||||
$twig->addFilter($filter);
|
||||
unset($function, $filter);
|
||||
|
||||
$hooks->trigger(HOOK_TWIG, ['twig' => $twig, 'twig_loader' => $twig_loader]);
|
||||
|
Reference in New Issue
Block a user