I needed a way to lock down sections of pages, once the collaborative editing resulted in a text everyone was happy with, and prevent us from going back to sections we already agreed on, rather than only focussing on yet-to-agree on text.
DokuWiki doesn't support this out of the box, but the code permits for adding soft locking: every open section gets a "Lock" button in addition to its "Edit" button, which users from the administrator group can click to effect a locked section. When a section is locked regular users will no longer get an "Edit" button, but the text "SECTION IS LOCKED" instead. Administrators see an "Unlock" button.
Also, to prevent lock circumvention, the default template has been extended so that the "Edit this page" button is not generated for pages with any locked sections.
The locking relies on a lock file in the data directory, which contains one section lock per line, in the form "path of the page with locked section" > "section name". This means there's no locking placeholders in the actual text itself, and it's easy to manually add or remove locks should you need to since it's all perfectly human-readable data.
I packed the locking changes I had to make into an archive that can be downloaded and examined in case you want to add this kind of functionality to your own dokuwiki (http://pomax.nihongoresources.com/downloads/lockable%20dokuwiki.zip
) but you'll have to adjust your template's main.php manually if you want to remove the "Edit this page" button when there are any locked sections on the page (if you don't, it means the section lock can be circumvented, so you probably want to =)
If you just want to see if it's what you need, set up a new dokuwiki, and then just copy-and-override the content of the archive into the wiki install. Set up a normal user and an admin user, tell the dokuwiki to use the 'lockable' template instead of the default template, and then make a page with a few sections and start locking (note that the design.css was modified so that it's a little easier to see which section an edit button belongs to, by giving edit buttons the same level indentation as the section text).
- Mike "Pomax" Kamermans