Commit graph

11 commits

Author SHA1 Message Date
This, that and the other
44141e3a72 Convert various FormActions to OOUI
Support for OOUI is added to FormAction, and subclasses can enable it as
required.

PurgeAction, RevertAction, WatchAction and UnwatchAction are converted
to OOUI, with minor changes to the forms to give them a neater appearance.

Bug: T160236
Change-Id: I5294e5d886e8641e9b63eabc9d7fa8ea93e0df96
2017-03-11 16:48:17 +11:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Aaron Schulz
543b063773 Distinguish read vs write mode Action classes
Bug: T123589
Change-Id: I3c8fab646d3bb8cd468e5b60c27f3c5d43f9f97c
2016-01-15 01:13:38 +00:00
Timo Tijhof
27a8bad9b0 WatchAction: Clean up redundant getFormFields() and show()
* Make FormAction::getFormFields not abstract. In most cases this will just
  be an empty array. This is in prep for RollbackAction as well.

* Remove redundant show() in WatchAction. This used to do custom stuff,
  but after 77cdf1919 it does exactly the same as the parent FormAction::show.

* Don't add 'redirectparams' hidden field if there were no custom query parameters
  (e.g. plain index.php?title=..&action=..)

Change-Id: Ia7f9bb0367c49a23179e9fefa9f529fa8aef8f52
2015-09-28 18:46:45 -07:00
Timo Tijhof
77cdf1919a WatchAction: Require POST for index.php action=watch
The GET variant was already rarely used because our frontend enchances these links
with a click handler that uses AJAX to make a POST request to the API.
The index.php url, nor its token, were used for the majority of users.

Simplify this by stripping the 'token' query from these urls and requiring a POST
request for index.php?action=watch and unwatch.

* FormAction: Actually set a proper '<form action>' instead of letting HTMLForm
  default to a confusing title path (e.g. /wiki/Pagename). Article path should
  not be used for POST requests.

* WatchAction: Group all FormAction-related methods together.

* WatchAction: Make token consistent with other actions now that it is POST-only
  (no "stronger" salt containing the page title).

* Remove ununsed mediawiki.page.startup dependency from mediawiki.page.watch.ajax.

* WatchAction: If accessed over GET directly (e.g. for users without javascript)
  display a confirmation form that submits the token. Similar to PurgeAction.

Change-Id: I504f457e68a133bcfc418cff13b838080fec1008
2015-09-28 15:21:12 -07:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
withoutaname
b8654eb75a Documentation: put FormAction and FormlessAction into "Actions" group
Change-Id: Iac8a203426897446b8c9f3fbaaa9d608c419bce6
2014-08-02 08:11:26 +00:00
withoutaname
a4aaac4f80 Remove execute() from Action and subclasses
Since show() is always the preferred entry point, this is never used
nor implemented properly.

Change-Id: I5fde4bbd420a6695b01fb9220542fd3b49060675
2014-07-16 14:03:43 -07:00
umherirrender
829886b10a Fixed some @params documentation
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: I64e8cfe478cb0ba438f40b0631d6e9049cdab567
2014-04-14 12:59:19 +00:00
umherirrender
23fab68274 Fix spacing after @param and friends in comments
Searched for:
\@(param|return|throws|since|deprecated|access|todo|var)[ \t]{2,}

Change-Id: Icce22ba9fe0635455691ca58d9872d618151f346
2014-04-05 20:02:29 +00:00
addshore
58884580eb Split the rest of Action.php into /actions/
Change-Id: I071ac5778af63a5cffffd59d804c99b2c799d4e5
2014-03-03 12:31:57 +00:00