Table of Contents
nodisp Plugin
Installation
Install from the extension manager.
To install manually, refer to Plugins.
Examples/Usage
This plugin has two ways of concealing text from unauthorized users.
- In the first case, it conceals text from all viewers except users who are logged in and belong to either the admin or manager group. The text is still on the page, but not displayed. This means it can be viewed using the browser's view source facility.
- In the second case, an acl level is set and if the viewer does not have an acl level equal to or greater than the acl setting, the text is completely removed from the page. It is not output from the server to the browser. The same is true if the site allows viewers to view the page source using Dokuwiki's view source action.
Syntax
The syntax for the first case
<nodisp> your text here </nodisp> <nodisp> your text here etc </nodisp>
The syntax for the second case
<nodisp acl> your text here </nodisp> <nodisp acl> your text here etc </nodisp>
acl
is the numeric representation of the acl level which is required for the marked off text to be output to the browser. In other words the viewer must be logged in and have acl
rights for the page in order for the marked up text to be included in the page. So, for example, with <nodisp 8>
the viewer must have upload permission or greater for the namespace where the page appears; with <nodisp 2>
, the viewer must have edit permission or greater for the page, etc.
It's possible to have several nodisp
blocks on a page, each with a different acl
level, so that the current user might have access to one section of text and not another. For example, the user might have write permission 1) for a page but not create permission for its namespace. <nodisp 2>
would mark off a passage which this user could view, but <nodisp 4>
would mark off one which this user does not have access to. A user with create permission for page's namespace 2) would uhave access to both.
The ACL levels are described in the acl documentation.
Newline syntax
{nodisp} your text here {/nodisp} {nodisp} your text here etc {/nodisp} {nodisp acl} your text here {/nodisp} {nodisp acl} your text here etc {/nodisp}
The <nodisp. . . >
syntax sets off blocks of text. If you place two blocks, one after the other, there will be a paragraph break between the two. The newline syntax treats the enclosed text as a single line unless an extra newline (CR/LF) or the DokuWiki newline markup is inserted. This conforms to the practice of the DokuWiki editor. If you place one newline entry above another, they will continue on the same line unless a newline is inserted. See https://github.com/turnermm/nodisp/issues/3
If you are upgrading from an earlier version of nodisp, which does not support the newline syntax, you will have to remove the file syntax.php from the root directory of the plugin. This is now replaced by a new file called basic.php in the syntax directory.
Group Syntax
It is also possible to limit access to the hidden material by group. The syntax is the same as for the other cases, except that ACL numbers are replaced by a group names.
<nodisp group> Restricted Data </nodisp> {nodisp group}Restricted Data{/nodisp}
Notice: The group name does not use the at-sign; it is group
, not @group
.
Development
Change Log
- Updates version after merging group into master (2022-09-14 16:35)
- refactors the code for processing groups (2022-09-14 01:26)
- update_version (2022-09-12 04:51)
- Adds support for groups to action.php for removal of data in dokuwiki… (2022-09-11 17:52)
- Further refactoring. Simplificates assigning levels. (2022-09-07 18:08)
- 2016-01-16 by Michael Hamann
- Fix method signature compatibility for PHP 7.0
- 2013-02-14 by Michael Hamann
- Cache is automatically disabled now, no need for ~~NOCACHE~~ anymore
- The plugin uses a
<div>
-Element now as it had the paragraph typestack
anyway which meant that a new paragraph was opened inside the plugin and thus the plugin worked on block level and using a<span>
-element produced invalid HTML. - Allows more syntax (paragraphs, lists, tables, …) inside the plugin
Known Bugs and Issues
Can you add this warning in the description of your plugin? Thanks. The page source is always visibile clicking the “show pagesource” button. — anto1945 2013/07/22 07:25
This is true for all the plugins which “hide” material. The only way to get true hiding is to use the include plugin. See the forum for this thread: https://forum.dokuwiki.org/post/39559
The above limitations are no longer true of nodisp. See above: examples_usage — Myron Turner 2020-03-13 16:53