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: [PATCH] [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(+) 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; } }