[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
This commit is contained in:
Erik Frèrejean 2012-04-10 22:56:45 +02:00 committed by Joas Schilling
parent 05c0d1ad17
commit 57617b048f

View file

@ -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;
}
}