Commit graph

166 commits

Author SHA1 Message Date
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Brion Vibber
1200ae7dae Revert r104353, r104354, r104356, r104358, r104383: changes to pagers breaking existing links as noted in CR. 2011-12-06 19:32:29 +00:00
John Du Hart
d8dd0c6507 Followup r104353, updating Special:ProtectedTitles
Adds HTML form fields for namespaces and restriction levels
Adds getVal() to HTMLForm
2011-11-28 00:31:05 +00:00
John Du Hart
54dd841a6f This is the rework I was talking about in r104318 for 1.19. Instead of having Pager subclasses build HTML forms by hand build HTMLForm into the Pager class. Much less painful, no?
This is simply a first pass, there's many more classes to convert.
2011-11-27 18:23:50 +00:00
John Du Hart
93e50f7eed Following r100264, update usages in core 2011-11-16 04:37:17 +00:00
Alexandre Emsenhuber
56508fdca6 Removed usage of $wgUser in block and unblock processing:
* Made HTMLFormField pass the HTMLForm object to the validation and filter callbacks (so that they can get a context)
* Added new parameter to SpecialBlock::checkUnblockSelf() to pass the user doing the request
* SpecialBlock::processForm() and SpecialUnblock::processUnblock() now require a context as second parameter; added SpecialBlock::processUIForm() and SpecialUnblock::processUIUnblock() as adaptators from HTMLForm as second parameter to context
2011-11-13 07:25:56 +00:00
Antoine Musso
1debab271e checkbox could not be checked through URL parameter
On [[Special:EmailUser]], someone ought to be able to pass the checkboxes
names to overrides the default. As an example from bug 31770, the email
user page has a checkbox wpCCMe which let the user as for a copy of the
email being send. This is a user preference.

One change that checkbox state by appending ?wpCCMe=<boolean> ie:
	Special:EmailUser/Hashar?wpCCMe=0
	Special:EmailUser/Hashar?wpCCMe=1

The logic added in r84814 could have allowed checkboxes to be overriden
for GET form. Unfortunately, HTMLForm is mostly with the default POST.
Hence, when appending the query parameter, we would never honor it!

The fix is to still unconditionally look at the value if the form was
correctly submitted (ie has wpEditToken) and additionaly whenever
there is a checkbox name appearing in the query (wherever it is false
or true, hence the use of getVal()).

This is a regression in REL1_18.  I dont think it deserves a release notes
since it is not fixing anything compared to 1.17.

Bug fixed:
==========
* (bug 31770) Allow URL parameter wpCCMe on Special:EmailUser
* (bug 30909) URL parameters for checkboxes in Special:Block no longer work
2011-11-01 09:28:51 +00:00
Roan Kattouw
386a2658fd On the preferences form, make preferences and other items at the top level of a section (e.g. with 'section' => 'foo') appear above rather than below subsections (e.g. stuff with 'section' => 'foo/bar'). This seems like natural behavior to me, but for some reason HTMLForm had it the other way around. I left the default behavior unchanged in HTMLForm and changed it only in PreferencesForm.
This change is needed for my work on the Gadgets extension in the RL2 branch (one example is adding text on top of a preferences section using a dummy type=>'info' preference, you want that to show up on top, not after all the subsections). The targeted use case (sections that contain both subsections and form elements) does not occur for core preferences, and is very uncommon in extensions. I managed to find such uses in only 3 of them: CreateAPage (in unreachable code), Tasks and EditSimilar add preferences to core sections that also contain subsections.
2011-10-31 14:41:02 +00:00
Roan Kattouw
435d5b8cba Make indentation consistent in HTMLForm doc comment 2011-10-26 20:58:29 +00:00
John Du Hart
86b9b0febd Adding functions to HTMLForm for explicitly setting the content of the header and footer.
Also adds a function for setting the intro, as a counterpart to addPreText
2011-10-23 18:38:22 +00:00
John Du Hart
04f7572ea1 HTMLForm is now a context source.
Replace wfMessage() calls with $this->msg()
2011-10-23 18:09:44 +00:00
John Du Hart
45763bd77d Adding flatlists to HTMLRadioField, sort of like HTMLMultiSelect 2011-10-23 16:57:53 +00:00
John Du Hart
028f06bc9c Follow up r100512, adding @since tags and using wfMessage 2011-10-23 01:10:23 +00:00
John Du Hart
525f1b0a9d Removing extra stuff that was committed in r100512 2011-10-22 20:10:41 +00:00
John Du Hart
fbc9f38fae Adding functions to HTMLForm for setting the submitText and WrapperLegend to messages instead of having to use wfMsg every single time 2011-10-22 20:03:40 +00:00
Happy-melon
a32ebf23fd (bug 31405) block reason preload. Patch by Brad Jorsch. 2011-10-17 16:16:26 +00:00
Happy-melon
cc311fa7dd Type hinting 2011-10-17 15:56:25 +00:00
Alexandre Emsenhuber
b6008e9086 * 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)
2011-10-09 11:43:06 +00:00
John Du Hart
2a6150cda4 Add a method to HTML for getting just the HTML (As opposed to passing it right to Output
Also, if a field is marked as required, it should still be checked to see if it's empty before going to the callback. Don't like that behavior? Don't mark it as required.
2011-10-08 19:13:35 +00:00
Brion Vibber
7faf8d357e * (bug 31089) Fix regression in Special:Block reasons list (MediaWiki:Ipbreason-dropdown parsing)
Followup to r83298: makes HTMLSelectAndOtherField backwards-compatible with Xml::listDropDown as it was apparently intended to be.

Also fixed double-escaping in the options for HTMLSelectAndOtherField.

Followup to r83795: fixes regression in Special:Block by fixing HTMLSelectAndOtherField which got used in place of Xml::listDropDown, but wasn't compatible.


Note that this removes the clever thing that lets you have separate values and texts in your dropdown; since Xml::listDropDown had no such feature and actual usage includes texts containing links and other stuch where the pipe character is a legit part of the content.
2011-09-22 22:10:41 +00:00
Daniel Friesen
391736c081 Use IContextSource instead of RequestContext inside type hints and instanceof checks. All we need is something that implements IContextSource and it's possible we may want to implement types of RequestContext that don't directly extend RequestContext but are perfectly valid to be passed to classes. 2011-09-15 15:19:49 +00:00
Roan Kattouw
b295b9e1e1 Followup r92155, move preferences-specific code introduced in HTMLForm to Preferences.php. Dropping $displayTitle and replacing it with something else is OK since $displayTitle was introduced as a hack for the preferences form anyway 2011-08-25 09:44:20 +00:00
Sam Reed
5e60c1af35 Revert r95408, breaks preferences 2011-08-24 19:48:59 +00:00
Sam Reed
860b602f5f Revert changes to HTMLForm from r92155 2011-08-24 18:11:55 +00:00
John Du Hart
d17077d6fc (bug 30335) Fix for HTMLForms using GET breaking when non-friendly URLs are used 2011-08-23 19:56:15 +00:00
Chad Horohoe
22749f36cd w/s fix for r92882 2011-08-02 23:16:44 +00:00
Aaron Schulz
cf93004435 Document parameter in loadInputFromParameters 2011-07-22 19:44:48 +00:00
Sam Reed
ead9055a62 Update code comments that point to 1.18 to point to 1.19 2011-07-18 23:01:08 +00:00
Leo Koppelkamm
0cfb2628da Restructure tab code of mediawiki.special.preferences.js . * 10 levels of indent, really? * Follow up r91869: Instead of setting the title, and later parsing it out and setting id from it, just set the id directly. * Hashes are now in the form #prefsection-personal. This means that they now work in browser with deactivated JS as well. 2011-07-14 12:49:39 +00:00
Leo Koppelkamm
0482a70d82 use tab name, not tab index for anchors on Special:Preferences. Bug 29672 . Patch by Jarry1250. Ping r91757 2011-07-11 09:54:40 +00:00
Robin Pepermans
3dbd62f290 Bug 29792: notice undefined index 'other' due to my commit r91803 2011-07-09 21:13:57 +00:00
Robin Pepermans
a3630dcbdd Allow the 'other' parameter for HTMLForm selectorother: it is used in SpecialBlock.php::getFormFields() (and maybe in more files) 2011-07-09 19:33:58 +00:00
Leo Koppelkamm
42d5c3f64d HTMLForm: Add option to output a title for a fieldset & activate it for Special:Pref. Preliminary work for Bug 29672 2011-07-08 21:12:10 +00:00
Alexandre Emsenhuber
8635d5cb65 Changed calls to Linker::tooltipAndAccesskeyAttribs() to be static and fixed casing in method's name 2011-07-04 08:28:27 +00:00
Bryan Tong Minh
707a2fa8fe Follow-up r80988: fix function documentation 2011-06-30 17:35:37 +00:00
Happy-melon
d16f4b8850 (bug 29511) block dropdown reasons should be in wiki content language. 2011-06-27 18:05:09 +00:00
Sam Reed
fc35a42ffd Fix more __get() calls on RequestContext 2011-06-17 13:27:39 +00:00
Sam Reed
4c29198850 And some more.... 2011-05-28 17:51:33 +00:00
Mark A. Hershberger
0a49fd69b0 Misc EOL w/s and spaces-instead-of-tabs fixes. One day I'll get around to nagging people for this stuff, but for now, I'll JFDI myself. 2011-05-25 15:39:47 +00:00
Alexandre Emsenhuber
92dfa87364 Simplify message existence checks by using wfMessage() instead of wfEmptyMsg() 2011-05-24 17:28:21 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Sam Reed
5db2450c55 Documentation
Remove unused variables
2011-05-04 21:23:25 +00:00
Siebrand Mazeland
02e44a71b0 Revert r86872: Breaks LiquidThreads page moves with the below failure. Threads are lost and nowhere to be found any more.
[25-Apr-2011 18:12:45] /wiki/Special:MoveThread/Thread:User_talk:Siebrand/test/One_new_message: Exception: MWNamespace::getTalk does not make any sense for given namespace -1
#0 /www/w/includes/Namespace.php(81): MWNamespace::isMethodValidFor(-1, 'MWNamespace::ge...')
#1 /www/w/includes/WatchedItem.php(73): MWNamespace::getTalk(-1)
#2 /www/w/includes/User.php(2304): WatchedItem->addWatch()
#3 /www/w/includes/actions/WatchAction.php(53): User->addWatch(Object(Title))
#4 /www/w/includes/Action.php(376): WatchAction->onView()
#5 /www/w/extensions/LiquidThreads/classes/Thread.php(115): FormlessAction->execute()
#6 /www/w/extensions/LiquidThreads/classes/Thread.php(435): Thread::create(Object(Article), Object(Article), NULL, 1, 'One new message')
#7 /www/w/extensions/LiquidThreads/classes/Thread.php(414): Thread->leaveTrace('move test', Object(Title), Object(Title))
#8 /www/w/extensions/LiquidThreads/pages/SpecialMoveThread.php(107): Thread->moveToPage(Object(Title), 'move test', true)
#9 [internal function]: SpecialMoveThread->trySubmit(Array)
#10 /www/w/includes/HTMLForm.php(279): call_user_func(Array, Array)
#11 /www/w/includes/HTMLForm.php(228): HTMLForm->trySubmit()
#12 /www/w/includes/HTMLForm.php(242): HTMLForm->tryAuthorizedSubmit()
#13 /www/w/extensions/LiquidThreads/pages/ThreadActionPage.php(37): HTMLForm->show()
#14 /www/w/includes/SpecialPageFactory.php(459): ThreadActionPage->execute('Thread:User_tal...')
#15 /www/w/includes/Wiki.php(252): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#16 /www/w/includes/Wiki.php(98): MediaWiki->handleSpecialCases()
#17 /www/w/index.php(145): MediaWiki->performRequestForTitle(NULL)
#18 {main}
2011-04-25 18:20:53 +00:00
Happy-melon
70bdc008c4 Implement an interface and abstract class to hold the widely-reused get(Request|User|Title|Lang|Skin|Output) accessors for objects acting as a context source. Article is rather messier because both getTitle() and getUser() are in use for other things, and Article::$mTitle is in extremely wide use both within Article.php and outside. 2011-04-25 17:37:43 +00:00
Happy-melon
d166859bc4 Some type-hinting and documentation in HTMLForm.php 2011-04-23 21:27:24 +00:00
Happy-melon
58caa451fa Look mum, no globals! Implement a RequestContext for HTMLForm, passed in the constructor. Currently this is optional with B/C; at a later date it should be made compulsory. Doing this removes the need to call $form->setTitle() on every single use; only when you want to set the title to something other than the page context title. Implemented the new syntax in a sample of forms. Also fix a few minor errors in HTMLForm.php that my IDE complained about. 2011-04-13 16:51:22 +00:00
Happy-melon
ff194ef5b4 Follow-up r85025: fix the you're-trying-to-block-yourself-you-twit warning, and make it an actual checkbox confirmation. Also use said confirmation for reblocks, and HideUser (bug 18678). Mark a static function from HTMLForm which is called from SpecialBlock as explicitly public. 2011-04-01 23:13:15 +00:00
Happy-melon
1f874c59d2 Follow-up r83907: abstract the flatlist mode into a descriptor option, and make it so the label does not linewrap away from the checkbox. 2011-03-27 22:45:32 +00:00
Happy-melon
03cdc155b7 Topple the last bastion of global-function-based special pages. Also fix HTMLCheckField to work with GET forms. 2011-03-26 19:18:39 +00:00
Happy-melon
b1dd860b95 Refactor the get-legend-for-section-fieldset logic out into its own function so it can be overridden. 2011-03-24 22:46:07 +00:00