From 56c6476233646e7c735aa4e3b98c4a6b62df5c7d Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sun, 25 Sep 2011 15:12:56 -0700 Subject: [ticket/10390] Allow option for jQuery to be hosted by a remote CDN Add an option to the ACP so admins can choose to host jQuery from the local version shipped with phpBB, or via a popular CDN. PHPBB3-10390 --- phpBB/includes/functions_acp.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index c3806dc786..4f9fa0db5e 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -126,6 +126,8 @@ function adm_page_footer($copyright_html = true) 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', 'S_COPYRIGHT_HTML' => $copyright_html, + 'T_JQUERY_LINK' => (!empty($config['load_jquery_host']) && $config['load_jquery_host'] != 'localhost') ? remote_jquery_url($config['load_jquery_host']) : "{$phpbb_root_path}assets/javascript/jquery.js", + 'S_JQUERY_FALLBACK' => (!empty($config['load_jquery_host']) && $config['load_jquery_host'] != 'localhost') ? true : false, 'VERSION' => $config['version']) ); -- cgit v1.2.1 From 2dca3c3c278e99cfd6cdbea7149063d160e4cc11 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 26 Sep 2011 20:26:32 -0700 Subject: [ticket/10390] Serve jQuery from Google CDN Yes/No button in ACP jQuery will now be available via remote CDN from Google. Microsoft and jQuery CDNs have been removed, so we can simplify this option for the user. Default mode is NO so the copy of jQuery included with phpBB is served by default. PHPBB3-10390 --- phpBB/includes/functions_acp.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 4f9fa0db5e..142be083a7 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -126,8 +126,8 @@ function adm_page_footer($copyright_html = true) 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', 'S_COPYRIGHT_HTML' => $copyright_html, - 'T_JQUERY_LINK' => (!empty($config['load_jquery_host']) && $config['load_jquery_host'] != 'localhost') ? remote_jquery_url($config['load_jquery_host']) : "{$phpbb_root_path}assets/javascript/jquery.js", - 'S_JQUERY_FALLBACK' => (!empty($config['load_jquery_host']) && $config['load_jquery_host'] != 'localhost') ? true : false, + 'T_JQUERY_LINK' => ($config['load_jquery_cdn'] && !empty($config['load_jquery_url'])) ? $config['load_jquery_url'] : "{$phpbb_root_path}assets/javascript/jquery.js", + 'S_JQUERY_FALLBACK' => ($config['load_jquery_cdn']) ? true : false, 'VERSION' => $config['version']) ); -- cgit v1.2.1 From bb616b4135fba145c961f26a4ff612d6579b6b17 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 14 Oct 2011 02:02:17 +0200 Subject: [ticket/10412] Replace memory_get_usage with memory_get_peak_usage PHPBB3-10412 --- phpBB/includes/functions_acp.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index c3806dc786..36e22e069f 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -106,15 +106,13 @@ function adm_page_footer($copyright_html = true) if ($auth->acl_get('a_') && defined('DEBUG_EXTRA')) { - if (function_exists('memory_get_usage')) + if (function_exists('memory_get_peak_usage')) { - if ($memory_usage = memory_get_usage()) + if ($memory_usage = memory_get_peak_usage()) { - global $base_memory_usage; - $memory_usage -= $base_memory_usage; $memory_usage = get_formatted_filesize($memory_usage); - $debug_output .= ' | Memory Usage: ' . $memory_usage; + $debug_output .= ' | Peak Memory Usage: ' . $memory_usage; } } -- cgit v1.2.1 From 2b88114365470c545ccf4aa5a83eeae607d72d3d Mon Sep 17 00:00:00 2001 From: David King Date: Wed, 28 Dec 2011 18:52:33 +0000 Subject: [ticket/10557] Added IN_PHPBB check to functions_acp.php PHPBB3-10557 --- phpBB/includes/functions_acp.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 4702f9939d..b65d6e6b5f 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -8,6 +8,14 @@ * */ +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + /** * Header for acp pages */ -- cgit v1.2.1 From 7a04c9048c110f0bd21ea3e9e869e17b408d640e Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 31 Dec 2011 13:32:52 +0000 Subject: [ticket/9916] Updating header license and removing Version $Id$ PHPBB3-9916 --- phpBB/includes/functions_acp.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 4702f9939d..ffa3fd32eb 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -2,9 +2,8 @@ /** * * @package acp -* @version $Id$ * @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ -- cgit v1.2.1 From c7b84eb32935ad78ae56fbf6382f95e8df11cdfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=A8rejean?= Date: Tue, 10 Apr 2012 20:29:40 +0200 Subject: [feature/events] Adding core.build_cfg_template event See: http://area51.phpbb.com/phpBB/viewtopic.php?f=111&t=42801 for referance. PHPBB3-9550 --- phpBB/includes/functions_acp.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index dc61859363..47caecef02 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -194,6 +194,7 @@ function h_radio($name, $input_ary, $input_default = false, $id = false, $key = function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) { global $user, $module; + global $phpbb_dispatcher; $tpl = ''; $name = 'config[' . $config_key . ']'; @@ -305,6 +306,9 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $tpl .= $vars['append']; } + $vars = array('tpl_type', 'key', 'new', 'config_key', 'vars', 'tpl'); + extract($phpbb_dispatcher->trigger_event('core.build_cfg_template', compact($vars))); + return $tpl; } -- cgit v1.2.1 From 95e81fb402c1eccf2c7772914ef301fd4043d9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=A8rejean?= Date: Tue, 10 Apr 2012 20:18:05 +0200 Subject: [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 --- phpBB/includes/functions_acp.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 47caecef02..c2ed623ece 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -22,6 +22,7 @@ function adm_page_header($page_title) { global $config, $db, $user, $template; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; + global $phpbb_dispatcher; if (defined('HEADER_INC')) { @@ -30,6 +31,16 @@ function adm_page_header($page_title) 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 if ($config['gzip_compress']) { -- cgit v1.2.1 From 586912882833707a51edc44a810c5f174bdce72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=A8rejean?= Date: Tue, 10 Apr 2012 20:21:45 +0200 Subject: [feature/events] Adding adm_page_footer_override event Add an event that adds the possibility to override the phpBB `adm_page_footer` function. PHPBB3-9550 --- phpBB/includes/functions_acp.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index c2ed623ece..c8dc68fea1 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -108,6 +108,18 @@ function adm_page_footer($copyright_html = true) global $db, $config, $template, $user, $auth, $cache; global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $request; + global $phpbb_dispatcher; + + // A listener can set this variable to `true` when it overrides this function + $adm_page_footer_override = false; + + $vars = array('copyright_html', 'adm_page_footer_override'); + extract($phpbb_dispatcher->trigger_event('core.adm_page_footer_override', compact($vars))); + + if ($adm_page_footer_override) + { + return; + } // Output page creation time if (defined('DEBUG')) -- cgit v1.2.1 From 57617b048f7ab1deb2a7019be29a24d782a00fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=A8rejean?= Date: Tue, 10 Apr 2012 22:56:45 +0200 Subject: [feature/events] Adding core.validate_config_vars event Allows a MOD author to define additional "configuration types" and add the logic to validate these option types as well. PHPBB3-9550 --- phpBB/includes/functions_acp.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index c8dc68fea1..4ff126260f 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -342,6 +342,8 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) function validate_config_vars($config_vars, &$cfg_array, &$error) { global $phpbb_root_path, $user; + global $phpbb_dispatcher; + $type = 0; $min = 1; $max = 2; @@ -516,6 +518,11 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) } break; + + default: + $vars = array('cfg_array', 'config_name', 'config_definition', 'error'); + extract($phpbb_dispatcher->trigger_event('core.validate_config_vars', compact($vars))); + break; } } -- cgit v1.2.1 From e126c37ea8a0c47ce8a78959a71ca8f9da8340ea Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 20 Jun 2012 15:49:41 +0200 Subject: [feature/php-events] Remove _override from event name PHPBB3-9550 --- phpBB/includes/functions_acp.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 4ff126260f..f59c8cd4c6 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -35,7 +35,7 @@ function adm_page_header($page_title) $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))); + extract($phpbb_dispatcher->trigger_event('core.adm_page_header', compact($vars))); if ($adm_page_header_override) { return; @@ -114,7 +114,7 @@ function adm_page_footer($copyright_html = true) $adm_page_footer_override = false; $vars = array('copyright_html', 'adm_page_footer_override'); - extract($phpbb_dispatcher->trigger_event('core.adm_page_footer_override', compact($vars))); + extract($phpbb_dispatcher->trigger_event('core.adm_page_footer', compact($vars))); if ($adm_page_footer_override) { -- cgit v1.2.1 From 296ab5c168dfb324821c0ba965028be690745eb3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 5 Aug 2012 21:17:29 +0200 Subject: [feature/php-events] Add docs for core.adm_page_header PHPBB3-9550 --- phpBB/includes/functions_acp.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index f59c8cd4c6..19f2873208 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -34,8 +34,18 @@ function adm_page_header($page_title) // A listener can set this variable to `true` when it overrides this function $adm_page_header_override = false; + /** + * Execute code and/or overwrite adm_page_header() + * + * @event core.adm_page_header + * @var string page_title Page title + * @var bool adm_page_header_override Shall we return instead of + * running the rest of adm_page_header() + * @since 3.1-A1 + */ $vars = array('page_title', 'adm_page_header_override'); extract($phpbb_dispatcher->trigger_event('core.adm_page_header', compact($vars))); + if ($adm_page_header_override) { return; -- cgit v1.2.1 From a326dc10cf2aa6f0ec631cbb23625831002da2ff Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 5 Aug 2012 21:24:33 +0200 Subject: [feature/php-events] Add docs for core.adm_page_footer PHPBB3-9550 --- phpBB/includes/functions_acp.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 19f2873208..8ee506377d 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -117,12 +117,20 @@ function adm_page_footer($copyright_html = true) { global $db, $config, $template, $user, $auth, $cache; global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; - global $request; - global $phpbb_dispatcher; + global $request, $phpbb_dispatcher; // A listener can set this variable to `true` when it overrides this function $adm_page_footer_override = false; + /** + * Execute code and/or overwrite adm_page_footer() + * + * @event core.adm_page_footer + * @var bool copyright_html Shall we display the copyright? + * @var bool adm_page_footer_override Shall we return instead of + * running the rest of adm_page_footer() + * @since 3.1-A1 + */ $vars = array('copyright_html', 'adm_page_footer_override'); extract($phpbb_dispatcher->trigger_event('core.adm_page_footer', compact($vars))); -- cgit v1.2.1 From 48a8482d23d7ab6fb0ef4c14f3d8464a78c14477 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 5 Aug 2012 22:24:15 +0200 Subject: [feature/php-events] Fix docs and naming of core.build_config_template PHPBB3-9550 --- phpBB/includes/functions_acp.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 8ee506377d..23517f23aa 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -234,8 +234,7 @@ function h_radio($name, $input_ary, $input_default = false, $id = false, $key = */ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) { - global $user, $module; - global $phpbb_dispatcher; + global $user, $module, $phpbb_dispatcher; $tpl = ''; $name = 'config[' . $config_key . ']'; @@ -347,8 +346,23 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $tpl .= $vars['append']; } - $vars = array('tpl_type', 'key', 'new', 'config_key', 'vars', 'tpl'); - extract($phpbb_dispatcher->trigger_event('core.build_cfg_template', compact($vars))); + /** + * Overwrite the html code we display for the config value + * + * @event core.build_config_template + * @var array tpl_type Config type array: + * 0 => data type + * 1 [optional] => string: size, int: minimum + * 2 [optional] => string: max. length, int: maximum + * @var string key Should be used for the id attribute in html + * @var array new Array with the config values we display + * @var string name Should be used for the name attribute + * @var array vars Array with the options for the config + * @var string tpl The resulting html code we display + * @since 3.1-A1 + */ + $vars = array('tpl_type', 'key', 'new', 'name', 'vars', 'tpl'); + extract($phpbb_dispatcher->trigger_event('core.build_config_template', compact($vars))); return $tpl; } -- cgit v1.2.1 From c28bd7cc609fecd6750ae0e7b4f1b4256f660818 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 5 Aug 2012 23:09:44 +0200 Subject: [feature/php-events] Fix docs and naming of core.validate_config_variable PHPBB3-9550 --- phpBB/includes/functions_acp.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 23517f23aa..2f0188289b 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -373,8 +373,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) */ function validate_config_vars($config_vars, &$cfg_array, &$error) { - global $phpbb_root_path, $user; - global $phpbb_dispatcher; + global $phpbb_root_path, $user, $phpbb_dispatcher; $type = 0; $min = 1; @@ -552,8 +551,21 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) break; default: + /** + * Validate a config value + * + * @event core.validate_config_variable + * @var array cfg_array Array with config values + * @var string config_name Name of the config we validate + * @var array config_definition Array with the options for + * this config + * @var array error Array of errors, the errors should + * be strings only, language keys are + * not replaced afterwards + * @since 3.1-A1 + */ $vars = array('cfg_array', 'config_name', 'config_definition', 'error'); - extract($phpbb_dispatcher->trigger_event('core.validate_config_vars', compact($vars))); + extract($phpbb_dispatcher->trigger_event('core.validate_config_variable', compact($vars))); break; } } -- cgit v1.2.1