DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:daftdrafts

DaftDrafts Plugin

Compatible with DokuWiki

Angua, 2012-01-25; 2011-05-25 "Rincewind"

plugin Can mark pages as drafts, thus hiding them completely from unregistered users.

Last updated on
2011-11-06
Provides
Syntax, Action

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to publish, underconstruction

Tagged with hide, moderation

Installation

Automatic installation

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin.

Manual installation

In case you need to install this plugin manually, be aware that you have to deactivate it and activate it again after uploading it in order for the plugin to work 100% correctly. Refer to Plugins on how to install plugins manually.

Compatibility

This plugin is compatible with Rincewind (2011-05-25), but it could very well be compatible with older versions. You'll just have to try it.

Examples/Usage

Usage

  • To hide a page, simply add ~~DRAFT~~ anywhere in the text.
    • In case you are using German language, the code is ~~ENTWURF~~.
    • In case you are using Norwegian language, the code is ~~KLADD~~.
  • The plugin also adds a button to the far right of the editing buttons that looks like a forbidden sign. Clicking it will add the correct code.

Effect

If you are an unregistered user, the page will not show up. If you are registered, you can see the page, as well as a red warning on the top of the page, which reminds you that the following page is a draft; hidden from the view of unregistered users.

What does the plugin do to achieve this?

Technically, the plugin adds two ACL-entries that sets @ALL to have the permission AUTH_NONE, and @user to have the permission AUTH_EDIT. When the code is removed from the page's text, the ACL-entries are also removed.

Syntax

~~DRAFT~~(English language)
~~ENTWURF~~(German language)
~~KLADD~~(Norwegian language)

Development

This plugin is built upon the Underconstruction plugin, however I was very dissatisfied with how that plugin worked, and so I had to create a new one. The Underconstruction plugin was flawed in that the draft-system would break whenever any ACL was deleted from the ACL management plugin that comes with DokuWiki Rincewind. This plugin does not suffer from that flaw. Several other improvements makes this a much easier code to work with, in case I find out that I want to add more functionality to the plugin.

I was also inspired by the Publish plugin, but found that it didn't work how I expected. I wanted to hide pages completely from unregistered users so they didn't even know that the pages existed, but the Publish plugin couldn't do that.

Change Log

  • 2011-11-06
    • Initial release

Known Bugs and Issues

  • The message about the current page being a draft will follow you through the admin menus in case you enter them from a page that is marked as a draft. This is a minor inconvenience, but maybe I will fix it some day.
  • Angua “release candidate” (2011-11-10) compatibility
    • The plugin does not appear to be compatible with the Angua “release candidate” (2011-11-10), but I currently (2011-11-17) do not know why. The following bugs apply:
    • The toolbar button does nothing on Angua “RC” (2011-11-10)
    • The syntax does nothing when included on a page on Angua “RC” (2011-11-10)

ToDo/Wish List

To Do
  • Add syntax, admin backend or whatever to get a list of all the pages that are marked as drafts. This way you can't lose track of your drafted pages, in case you have a lot of them (in the mean time, you can check out the ACL-settings in the admin menus, and see which pages are marked with no permissions for @ALL).
Wish list
  • To be able to update my Dokuwiki installation, I wish that this plugin was compatible with Weatherwax.

FAQ

  • Q: What if I change the language of my DokuWiki after having marked hundreds of pages as drafts?
    • A: Tough luck, the plugin only works with the code that is specified in the language files for the language you are currently using. For example, if you enter a page that is marked with ~~ENTWURF~~ and your language isn't German, that text will become visible, and the page will have its ACL-settings removed by the plugin1). FIRST select the language of your DokuWiki, then stick with that choice.

Discussion

1) but only if the ACL-settings were once added by this plugin, so your other ACL-settings should be safe
plugin/daftdrafts.txt · Last modified: 2015-08-11 17:42 by 162.93.65.1