From: Stephan G. <f....@gm...> - 2011-02-20 01:57:38
|
Hi, I build an extension that allows making adjustments to articles without having to go to the "edit with form" page. E.g. I have an "Action" form here. With this extension I can now set an action to "Finished" by just clicking on a link instead of having to go and edit the form. I just include something like the following on my action page: {{#directedit:link text=Finish this action. |target=myAction |form=Action |link type=link |query string=Action[State]=Finished }} This shows a link that, when clicked, modifies the target and shows a result message. The query string works as for formlink. Link type can be link or button. What else? You can set "ok text", "error text" and "warning text" as parameters. I usually do something like "ok text=[[File:Happy.gif|link=]]". Since it is really nearly the same functionality, the second thing I put in is the parser function {{#saveandcontinue:}}. You can include it in any form. It shows up there as a button much like the "Save page" button. It saves the article, but does not leave the form, so you can continue editing. Finally the extension overrides the normal "Save page" action with the in-build mechanism. The advantage is, that there is only one page load instead of two. This means, the back-button of the browser works now as expected, i.e. it takes you back to the form. You can download the extension at http://code.google.com/p/semanticformsinputs/downloads or get it via Subversion using svn export http://semanticformsinputs.googlecode.com/svn/trunk/DirectEdit Installation as usual: Extract to the extensions directory of your wiki and require_once in LocalSettings.php. You can tweak the appearance of links and buttons via the included CSS files. I tried this on FF, Google Chrome, IE8 and it seemed to work alright. But there are loads of bugs left for sure, so any bug reports are very much welcome. Cheers, Stephan |