From b6008e9086ee790dc3456bece511e95b112d37a0 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 9 Oct 2011 11:43:06 +0000 Subject: * Use the context when building the preferences form descriptor * Pass the HTMLForm object to the submit callback so that it can have a context and also access to the form itself (see below). This makes Preferences::tryUISubmit() and Prefrences::tryFormSubmit() signatures incompatible. The only extension calling these is EditUser and I will fix in my next commit. * Added two extension possibilites (for EditUser): PreferencesForm::getExtraSuccessRedirectParameters() to modify the URL parameters when redirecting after successful save and the fourthparameter to Prefrences::getFormObject() to be able to remove some items from the descriptor * Pass the user being modified to the HTMLForm to use it to save the preferences instead of doing this unconditionally on $wgUser (to remove one hack in EditUser preferences) --- includes/HTMLForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'includes/HTMLForm.php') diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 63a5d5966e2f..c30a77b3b11f 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -277,7 +277,7 @@ class HTMLForm { $data = $this->filterDataForSubmit( $this->mFieldData ); - $res = call_user_func( $callback, $data ); + $res = call_user_func( $callback, $data, $this ); return $res; } -- cgit v1.2.3