added hook for filters to have their own save config function if they want to

This commit is contained in:
mjollnir_
2006-01-23 20:37:44 +00:00
parent 4d69a487e4
commit e5b66e2cd4
+16 -4
View File
@@ -36,10 +36,22 @@
error( get_string('confirmsesskeybad', 'error' ) );
}
// run through submitted data
// reject if does not start with filter_
foreach ($config as $name => $value) {
set_config( $name,$value );
$configpath = $CFG->dataroot.'/filter/'.$param->filter.'/filterconfig.php';
if (file_exists($configpath)) {
require_once($configpath);
$functionname = $param->filter.'_process_config';
if (function_exists($functionname)) {
$functionname($config);
$saved = true;
}
}
if (empty($saved)) {
// run through submitted data
// reject if does not start with filter_
foreach ($config as $name => $value) {
set_config( $name,$value );
}
}
redirect( "$CFG->wwwroot/$CFG->admin/filters.php", get_string('changessaved'), 1);
exit;