Commit graph

210 commits

Author SHA1 Message Date
IAlex
408a3df1dc Merge "Remove unused variables." 2012-10-09 10:23:38 +00:00
Siebrand Mazeland
632ce2a8fd Remove unused variables.
Change-Id: I4b76cbbca22555eacb8ef4de58993b485f7cdd18
2012-10-09 09:43:14 +00:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Siebrand Mazeland
b345869770 Prevent Call to a member function msg() on a non-object
- Added HTMLFormField::msg() to check whether $this->mParent->msg()
  can be called and otherwise use wfMessage()
- Made Licenses::msg() inline to prevent conflict with HTMLFormField::msg()

Change-Id: I7fa95e1d61ac4128d1d4d5f091c39bcbc8ecc651
2012-08-24 11:47:25 +02:00
Alexandre Emsenhuber
6567a953c8 Use local context to get messages
Change-Id: Ia615d3cf07bafd324b09bc6c8b0614fadbdc06d4
2012-08-21 22:11:18 +02:00
Siebrand Mazeland
6fe1f0509b Replace deprecated wfMsg* calls with Message class calls.
Doing this in steps of roughly 100 changes per commit, so that it remains reviewable.

Change-Id: Ib15e670badd3f6aecae8b60e2f9129a31341ce16
2012-08-21 18:38:44 +02:00
Alexandre Emsenhuber
b34ac08369 Fix double escaping of fieldset's legend in HTMLForm.
The message is fetched using Message::escaped() but is
later passed to Xml::element() (from Xml::fieldset() call
HTMLForm::wrapForm()) which means it is double escaped.

Change-Id: I7154b3b26cc46759c184bdf9059d82470e2ab836
2012-08-20 16:54:11 +02:00
robin
e5abc04c03 Add 'list' to allowed input attributes in HTMLForm
Add 'list' (new in HTML5 as part of datalist) to the allowed input attributes in HTMLForm.
Also move maxlength into the general foreach.

Change-Id: I2ba61b0cc1b9f8b3db6c419efb5cbadfde594699
2012-08-18 03:32:51 +02:00
jeroendedauw
06db921d75 Improve handling of the required argument in HTMLForm field definitions
array( 'required' => false ) will now result in the field not being required rather then the unexpected opossite.

And this is now possible (without doing some extra if)

array( 'required' => getSomeBoolean() )

Change-Id: I1fc22b16ab1fa17111c48aa664aaf47de5f7075a
2012-08-12 00:26:17 +02:00
Antoine Musso
e684be51f4 link to HTMLForm doc on the wiki
URL provided by Clément Dietschy.

Change-Id: Ibea0266618c09b2dfbac5c356beba93dd8bebba2
2012-08-03 10:29:19 +00:00
Antoine Musso
5e8e2d76fe HTMLForm mutators can now be chained
This make HTMLForm mutator to return $this for easy method chaining such
as:

	form = new HTMLForm( $someFields );
	$form->setMethod( 'get' )
		 ->setWrapperLegendMsg( 'message-key' )
		 ->suppressReset()
		 ->prepareForm()
		 ->displayForm();

prepareForm()->displayForm(); should be at the very end apparently
though it is not enforced by the object.

Change-Id: Iebaa83a1da3c89e5ab729a889e54844535619d54
2012-08-02 19:15:42 +01:00
Antoine Musso
ef9534313e prevents some doxygen warnings
This patch fix misc issues reported by doxygen. Nothing fancy.

Change-Id: I98edc8c877019f1dc4a82a37bca518df2eb904fc
2012-07-15 22:32:48 +02:00
Antoine Musso
aab43dd495 escape tags and entity in doxygen comments
When inserting XML elements inline <such as this one>, doxygen chokes
about it not being known. Simply enclosing the tag in double quotes
prevents doxygen from emitting a warning.

Also enclosed a few invalid functions calls such as \. and double quoted
the HTML entities such as &foobar;

Change-Id: I4019637145e683c2bec3d17b2fd98b0c50a932f1
2012-07-10 17:08:32 +02:00
Reedy
0597984bd8 Fixup some wrong documentation
Don't try and return the result of void functions

Change-Id: I7a4db738b3e3052aebcf43742d31753f8cc1f47a
2012-06-15 15:05:49 +01:00
Werdna
ebf2912801 Merge "Adds support to HTMLForm for rendering form fields wrapped in divs or just plain old (mostly) raw form fields." 2012-06-06 05:30:28 +00:00
Max Semenik
4d3620a08d HTMLForm: throw a warning when no callback is set
Change-Id: Ied019afaf607c4b5967989fcb53945a116eeaed6
2012-05-22 19:11:13 +04:00
awjrichards
15599d3d39 Adds support to HTMLForm for rendering form fields wrapped in divs
or just plain old (mostly) raw form fields.

Also fixes minor code style issues

Change-Id: Ia9510d6960f2adb17c1bb19e378763a60169dee6
2012-05-19 07:06:15 -07:00
Alexandre Emsenhuber
15e9fcca01 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Iaebd4e253ff3b35b568e9b394231a5691445ac95
2012-05-14 19:59:58 +02:00
umherirrender
e51629e5de (bug 31757) Add a word-separator between help-messages in HTMLForm
Change-Id: Ie4dbfb16e195dabd6abf0634b21c7867ed584920
2012-04-21 11:55:40 +02:00
awjrichards
fb01ab5dcf Better fix for bug 36049, now using isset() rather than !empty()
for textarea placeholder attribute in case the attribute value
is '0'.

Change-Id: I139abff427d7342fc3283ed3428d0a538331d2b5
2012-04-20 16:18:50 -07:00
awjrichards
828247f2cd (bug 36049) placeholder attrib for HTMLForm Textarea
Change-Id: I671b4869ef30734c4bfb0c2beed3841f90ab5d16
2012-04-19 13:45:17 +02:00
Niklas Laxström
edfb4c738c Html::setSubmitTextMsg double escapes
On Dutch the button showed "Pagina&#039;s verwijderen"

Change-Id: I082e16e9320ba4aef1e2bf5f81cfe54fdf61b6c3
2012-04-11 11:23:08 +00:00
Daniel Friesen
9d83797631 Separate $wgArticlePath from $wgUsePathInfo.
- $wgUsePathInfo is now only used on servers not passing REQUEST_URI to determine if PATH_INFO should be used
- WebRequest now extracts information from REQUEST_URI even when $wgUsePathInfo is false
- HTMLForm bases it's decision on whether or not to include a hidden 'title' input on whether $wgArticlePath uses a query instead of assuming that $wgUsePathInfo was used to set the article path

Change-Id: I1b461fef88b26d045f4edd7553b59255c5e595d8
2012-03-24 03:44:08 -07:00
Amir E. Aharoni
90678f30b1 A little fix in whitespace and comment spelling.
Change-Id: I23887de1a5ee454037b6346c767e302f2e6f02f7
2012-03-22 01:07:06 +02:00
Jeroen De Dauw
1b0a666ed4 Follow up to r113142; fix incorrect conversion to array (value can be array already) 2012-03-07 19:07:40 +00:00
Jeroen De Dauw
ecb50ed3c9 follow up to r113113, get rid of code ducpliation and fix docs to reflect actual behaviour 2012-03-06 15:36:08 +00:00
Jeroen De Dauw
630ea0195f fix support for passing args to help-message(s), which was documented to be there but actually missing 2012-03-06 00:32:48 +00:00
Antoine Musso
5605cfbf1b TODO about 'class' throwing a fatal error 2012-03-05 12:05:13 +00:00
Niklas Laxström
9a23672385 Whitespace cleanup 2012-03-01 10:54:18 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
7b25f8231f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:30:01 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Sam Reed
138ddc452f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:42:35 +00:00
Aaron Schulz
1c48deee3b (bug 33992) - "Allow anon a formless purge with POST". Changed HTMLForm::tryAuthorizedSubmit() to (a) require post for forms that are supposed to be posted and (b) bypass the token check for anons as it doesn't really do much except be slightly annoying. The tokens are just User::EDIT_TOKEN_SUFFIX in that case. 2012-01-30 23:44:34 +00:00
Antoine Musso
96e0cbb9b6 comment mAction / whitespaces
ping r110245
2012-01-30 11:33:16 +00:00
Jeroen De Dauw
9175d8e37f allow people to actually specify post targets with a query 2012-01-29 15:23:23 +00:00
Aaron Schulz
ad71a02261 Reverted r109957 per slush (see CR comments) 2012-01-28 00:16:20 +00:00
John Du Hart
71c36e9046 Add HTMLFormFields for namespaces and restriction levels. This is not a 1.19 feature and should be reverted post-branch. 2012-01-24 21:34:26 +00:00
Sam Reed
29e672787c Documentation
Remove unused globals
2012-01-19 17:27:29 +00:00
mrbluesky
f38cb0feb0 Fixing comments
Using shell style comments here stops Doxygen from processing the rest of the comments.
See http://svn.wikimedia.org/doc/classHTMLForm.html
2012-01-13 22:19:01 +00:00
Sam Reed
51cf68ff28 A couple more for r108785
More doucmentations
2012-01-13 02:30:51 +00:00
Krinkle
be12ebf1ab [Core JS] More fixing of global config variable usage
* mw.config is the new way, and global config variable lookups are deprecated

* Based on two phase3-wide quick searches:
-- of " wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=321&hash=81700bf7486e4fee3b7bc1f83eb9eba6
-- of "!wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=327&hash=47c9d54a7a1d5d58a724dd834585f40d

Related changes:
* Changed some php comments mentioning "wg" variables to include the dollar sign, and a typo when the wf function prefix was meant.
* Removed TODO comment in wikibits.js and made it use the JS equivalent of wfUrlencode, which we have now, mw.util.wikiUrlencode 
* SpecialUpload.php: use OutputPage::addJsConfigVars instead of creating a new script tag through OutputPage::addScript(Skin::makeVariablesScript(..))
* Renamed wgUploadSetup in upload.js and made it local. Not used anywhere in ./trunk/phase3 and ./trunk/extensions
* Fix OutputPage::addJsConfigVars so that it can actually be called with an array instead of two arguments for key/value
* Some minor whitespace/convention stuff around the same line
2011-12-31 21:25:00 +00:00
John Du Hart
8005aed428 Moving the flatlist option to HTMLFormField to prevent code duplication per hashar on r100551 2011-12-23 20:35:57 +00:00
Jeroen De Dauw
515a86df65 actually use the flipping cssclass arg, so its possible to set a css class without creating your own input field type class 2011-12-21 01:10:51 +00:00
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