Create annotations below the regular wiki text. Each user creates his own annotation and can decide for himself if other users can read them or not.
Compatible with DokuWiki
2007-06-26b
Create annotations below the regular wiki text. Each user creates his own annotation and can decide for himself if other users can read them or not.
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 note
This plugin enables users to create annotations and comments for each wiki page. The annotations reside in a special namespace that mirrors the regular namespace structure.
Warning: This plugin uses the DirectoryIterator from the SPL library (included in PHP 5) and is not compatible with PHP 4.
Annotations for the page wiki:formatting_syntax
are stored in annotations:user1:wiki:formatting_syntax
for user1 and annotations:user2:wiki:formatting_syntax
for user2. The contents of the annotation pages are displayed below the text of wiki:formatting_syntax
- together with an “edit” link and a comment on whom they belong. Visibility of the annotations can be influenced with the regular ACLs inside the annotations namespace.
The annotations can be styled on a general or on a per-user basis.
Fatal error: Uncaught exception 'RuntimeException' with message 'DirectoryIterator::__construct(/home/zfbiz1/docs.fmlymap/data/pages/annotations) [<a href='directoryiterator.--construct'>directoryiterator.--construct</a>]: failed to open dir: No such file or directory' in /home/zfbiz1/public_html/subdomains/docs.fmlymap/lib/plugins/userannotations/action.php
This is using the plugin straight out of the box on a PHP5.3.1 base.
This exception is because/home/zfbiz1/docs.fmlymap/data/pages/annotations
cannot be opened. Of course it doesn't exist the first time. It is enough to addtry{
…}catch (Exception $e) { }
around the foreach code block in../lib/plugins/userannotations/action.php
(~line 72).
Example:
try{ foreach (new DirectoryIterator(preg_replace('/\.txt$/', '', wikiFN($privatepath))) as $item ) { if($item->isDir() && !$item->isDot()) { $user = $item->getBasename(); if($user != $current) $annotation_ns[] = $user; } } }catch (Exception $e){ }
— joakinen 2013/11/25 14:09
As I found annoying the link to make annotations inside annotations, I developed a patch for this plugin so that you can control if recursion of annotations is allowed or not with a new entry in the config file.
Original lines 98 to 103 in action.php
// The currently logged in user can create his own annotation elseif($user == $current && auth_quickaclcheck($privatepath.':'.$user) >= AUTH_CREATE) { echo '<div class="annotation"><p class="editannotation createannotation"><a href="'.DOKU_SCRIPT; echo '?id='.$annotation_id.'&do=edit" class="editlink">'.sprintf($this->getLang('create_annotation'), $current).'</a></p></div>'; }
Change those lines into this:
// The currently logged in user can create his own annotation elseif($user == $current && auth_quickaclcheck($privatepath.':'.$user) >= AUTH_CREATE) { // Check recursion allowance if( ($this->getConf('allow_recursion')) || (!$this->getConf('allow_recursion') && strpos($ID, $privatepath) === false)) { echo '<div class="annotation"><p class="editannotation createannotation"><a href="'.DOKU_SCRIPT; echo '?id='.$annotation_id.'&do=edit" class="editlink">'.sprintf($this->getLang('create_annotation'), $current).'</a></p></div>'; } }
This patch needs a new entry in conf/default.php file:
// Allow annotations in annotations $conf['allow_recursion'] = false;
Changing the value of this entry to 'true' you get the original behaviour of the plugin.