Wiki source code of InplaceEditing
Last modified by SuperNico Laub on 2025/09/18 17:55
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | {{velocity wiki="false"}} |
| 2 | #if ($request.action == 'lock') | ||
| 3 | ## This could be moved later to a Velocity template (e.g. lock.vm). | ||
| 4 | ## We set the editor variable to be able to detect the inplace editor within the edit confirmation checkers. | ||
| 5 | #set ($editor = 'inplace') | ||
| 6 | #template('edit_macros.vm') | ||
| 7 | #getEditConfirmation() | ||
| 8 | #if ($editConfirmation) | ||
| 9 | ## Ask for confirmation to force the lock. | ||
| 10 | #set ($discard = $response.setStatus(423)) | ||
| 11 | #jsonResponse($editConfirmation) | ||
| 12 | #else | ||
| 13 | ## Lock the document for editing. | ||
| 14 | #set ($lockParams = { | ||
| 15 | 'ajax': 1, | ||
| 16 | 'action': $request.lockAction, | ||
| 17 | 'language': $tdoc.realLocale | ||
| 18 | }) | ||
| 19 | #if ($request.force == 'true') | ||
| 20 | #set ($lockParams.force = 1) | ||
| 21 | #end | ||
| 22 | #set ($discard = $response.sendRedirect($tdoc.getURL('lock', $escapetool.url($lockParams)))) | ||
| 23 | #end | ||
| 24 | #end | ||
| 25 | {{/velocity}} |