mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 09:49:22 +02:00
Add HOOK_TWIG. Also moved Hooks loading to init.php
For adding twig functions & filters by plugins
This commit is contained in:
parent
0ac0f4e7a8
commit
b3991a8e78
@ -30,11 +30,6 @@ if(!$db->hasTable('myaac_account_actions')) {
|
|||||||
throw new RuntimeException('Seems that the table <strong>myaac_account_actions</strong> of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting <a href="' . BASE_URL . 'install">this</a> url.');
|
throw new RuntimeException('Seems that the table <strong>myaac_account_actions</strong> of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting <a href="' . BASE_URL . 'install">this</a> url.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// event system
|
|
||||||
require_once SYSTEM . 'hooks.php';
|
|
||||||
$hooks = new Hooks();
|
|
||||||
$hooks->load();
|
|
||||||
|
|
||||||
require SYSTEM . 'status.php';
|
require SYSTEM . 'status.php';
|
||||||
require SYSTEM . 'login.php';
|
require SYSTEM . 'login.php';
|
||||||
require __DIR__ . '/includes/functions.php';
|
require __DIR__ . '/includes/functions.php';
|
||||||
|
@ -71,10 +71,6 @@ if(!$db->hasTable('myaac_account_actions')) {
|
|||||||
throw new RuntimeException('Seems that the table <strong>myaac_account_actions</strong> of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting <a href="' . BASE_URL . 'install">this</a> url.');
|
throw new RuntimeException('Seems that the table <strong>myaac_account_actions</strong> of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting <a href="' . BASE_URL . 'install">this</a> url.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// event system
|
|
||||||
require_once SYSTEM . 'hooks.php';
|
|
||||||
$hooks = new Hooks();
|
|
||||||
$hooks->load();
|
|
||||||
require_once SYSTEM . 'template.php';
|
require_once SYSTEM . 'template.php';
|
||||||
require_once SYSTEM . 'login.php';
|
require_once SYSTEM . 'login.php';
|
||||||
require_once SYSTEM . 'status.php';
|
require_once SYSTEM . 'status.php';
|
||||||
|
@ -76,6 +76,7 @@ define('HOOK_GUILDS_AFTER_GUILD_HEADER', ++$i);
|
|||||||
define('HOOK_GUILDS_AFTER_GUILD_INFORMATION', ++$i);
|
define('HOOK_GUILDS_AFTER_GUILD_INFORMATION', ++$i);
|
||||||
define('HOOK_GUILDS_AFTER_GUILD_MEMBERS', ++$i);
|
define('HOOK_GUILDS_AFTER_GUILD_MEMBERS', ++$i);
|
||||||
define('HOOK_GUILDS_AFTER_INVITED_CHARACTERS', ++$i);
|
define('HOOK_GUILDS_AFTER_INVITED_CHARACTERS', ++$i);
|
||||||
|
define('HOOK_TWIG', ++$i);
|
||||||
|
|
||||||
const HOOK_FIRST = HOOK_STARTUP;
|
const HOOK_FIRST = HOOK_STARTUP;
|
||||||
define('HOOK_LAST', $i);
|
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';
|
require_once SYSTEM . 'libs/cache.php';
|
||||||
$cache = Cache::getInstance();
|
$cache = Cache::getInstance();
|
||||||
|
|
||||||
|
// event system
|
||||||
|
require_once SYSTEM . 'hooks.php';
|
||||||
|
$hooks = new Hooks();
|
||||||
|
$hooks->load();
|
||||||
|
|
||||||
// twig
|
// twig
|
||||||
require_once SYSTEM . 'twig.php';
|
require_once SYSTEM . 'twig.php';
|
||||||
|
|
||||||
|
@ -124,3 +124,5 @@ $filter = new TwigFilter('urlencode', function ($s) {
|
|||||||
|
|
||||||
$twig->addFilter($filter);
|
$twig->addFilter($filter);
|
||||||
unset($function, $filter);
|
unset($function, $filter);
|
||||||
|
|
||||||
|
$hooks->trigger(HOOK_TWIG, ['twig' => $twig, 'twig_loader' => $twig_loader]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user