DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:underconstruction

This is an old revision of the document!


UNDER CONSTRUCTION plugin

Compatible with DokuWiki

2009-02-13

plugin Marks a page to be UNDER CONSTRUCTION - no one else except you, the admins and persons with higher rights can see these pages.

Last updated on
2008-08-25
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 daftdrafts

Tagged with hide, maintenance, moderation

Description

You have your closed wiki, with read-only permissions to the rest of the world. You (and maybe some friends) are the only ones to edit pages. But DokuWiki does not offer a by-edit-option to mark a page as internal or draft or under construction to hide it away from everyone else.

This plugin fills this gap. You can enter a simple notice into the page and it will be set as inaccessible by authentication options. The only caveat is that users with higher rights than AUTH_NONE to the current namespace, e.g. the administrative group, will be able to see the page.

There is a Toolbar Button to enter the command at the current cursor position.

How does it work

Adding:
If the ~~UNDERCONSTRUCTION~~ is put on a page, the plugin adds two rules to the acl when saving.

  • It sets permissions for group @ALL for the page to AUTH_NONE.
  • At the same time it sets the permissions for the last editor to AUTH_WRITE.

In effect the page becomes invisible for everybody except the last editor. Admins will still be able to see the page. The rules are flagged with #UNDERCONSTRUCTION to distinguish them from other rules.

Deleting:
When ~~UNDERCONSTRUCTION~~ is deleted on the page the two ACL-rules are removed. Because the rules are flagged no other entries are affected.

Of course changes to the ACL through the interface will affect these permissions just normally; you have to be aware of this.

Syntax

Enter ~~UNDERCONSTRUCTION~~ anywhere in the page to hide it for others.

Download and Installation

Download and install the plugin using the Plugin Manager using the URL given above. Refer to Plugins on how to install plugins manually. For detailed information and download instructions see the home page.

Bugs

Rewrite saving acl.auth.php

It doesn't work properly with Adora Belle due to miswriting of acl.auth.php. A simple fix is substitute the row:

return io_saveFile(DOKU_CONF.'acl.auth.php', join(' ',$new_config));

with:

return io_saveFile(DOKU_CONF.'acl.auth.php', implode("\n",$new_config));

in the helper.php file in plugin folder.

I found this fix led to double returns in Angua. — Harald 2013/11/01 10:45

Edit Button Code does not work

  • Replace the complete function _moretoolbarbuttons in action.php with this code
	/**
	*  Add a Toolbar Button for The UNDERCONSTRUTION Construct
	*
	* @author  Gerry Weissbach <gweissbach@inetsoftware.de>
	*/
	function _moretoolbarbuttons(&$event, $args) {
		if ( $this->getConf('reviewmode') ) { return; }
		$event->data[] = array (
			'type' => 'insert',
			'title'  => $this->getLang('underconstruction'),
			'icon' => '../../plugins/underconstruction/images/underconstruction.gif',
			'insert' => '~~UNDERCONSTRUCTION~~',
		);
	}
  • Create lang.php yourself at ./lang/en/lang.php and add
 $lang['underconstruction'] = "Under Construction"; 

This should do it. Otherwise a really nice and simple idea. A little dangerous because people can easily hide pages from other readers (without even realizing possibly). An administrator may have to regularly scan for hidden pages. — Harald 2013/11/01 10:47

plugin/underconstruction.1383300249.txt.gz · Last modified: 2013-11-01 11:04 by harald

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki