mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[feature/events] Adding core.adm_page_header_override event
Add an event that adds the possibility to override the phpBB `adm_page_header` function. PHPBB3-9550
This commit is contained in:
parent
c7b84eb329
commit
95e81fb402
1 changed files with 11 additions and 0 deletions
|
@ -22,6 +22,7 @@ function adm_page_header($page_title)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $template;
|
global $config, $db, $user, $template;
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
|
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
|
||||||
|
global $phpbb_dispatcher;
|
||||||
|
|
||||||
if (defined('HEADER_INC'))
|
if (defined('HEADER_INC'))
|
||||||
{
|
{
|
||||||
|
@ -30,6 +31,16 @@ function adm_page_header($page_title)
|
||||||
|
|
||||||
define('HEADER_INC', true);
|
define('HEADER_INC', true);
|
||||||
|
|
||||||
|
// A listener can set this variable to `true` when it overrides this function
|
||||||
|
$adm_page_header_override = false;
|
||||||
|
|
||||||
|
$vars = array('page_title', 'adm_page_header_override');
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.adm_page_header_override', compact($vars)));
|
||||||
|
if ($adm_page_header_override)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// gzip_compression
|
// gzip_compression
|
||||||
if ($config['gzip_compress'])
|
if ($config['gzip_compress'])
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue