New infrastructure for actions, as discussed on wikitech-l. Fairly huge commit.
authorHappy-melon <happy-melon@users.mediawiki.org>
Wed, 13 Apr 2011 23:04:07 +0000 (23:04 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Wed, 13 Apr 2011 23:04:07 +0000 (23:04 +0000)
commit6dc8136d12963d20ee9c72937dc269fbcfeb9b02
treefcfe015069a9012e1ee8db99f88d2b2fad6c285c
parent72feb394572fff7fbc26312dc07d13c247025d96
New infrastructure for actions, as discussed on wikitech-l.  Fairly huge commit.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc).  Create abstract base classes Action and FormlessAction to support these two cases.  HTMLForm is an integral part of the form-based structure.
* Look mum, no globals!  :D  Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept.  This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php.  This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible.  There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter.  On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way.  Update LiquidThreads to use these new hooks where appropriate.
19 files changed:
docs/hooks.txt
includes/Action.php [new file with mode: 0644]
includes/Article.php
includes/AutoLoader.php
includes/Credits.php [deleted file]
includes/DefaultSettings.php
includes/EditPage.php
includes/FileDeleteForm.php
includes/ProtectionForm.php
includes/Setup.php
includes/Wiki.php
includes/actions/CreditsAction.php [new file with mode: 0644]
includes/actions/DeleteAction.php [new file with mode: 0644]
includes/actions/WatchAction.php [new file with mode: 0644]
includes/api/ApiBase.php
includes/api/ApiDelete.php
includes/api/ApiWatch.php
includes/specials/SpecialMovepage.php
languages/messages/MessagesEn.php