DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:nodisp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:nodisp [2019-03-01 17:14] – [nodisp Plugin] turnermmplugin:nodisp [2023-10-30 23:24] (current) Klap-in
Line 2: Line 2:
  
 ---- plugin ---- ---- plugin ----
-description: Remove text from output to browser based on acl or hide text except from admin or manager+description: Prevents selected text from being sent from server to browser based on aclor hides display of text in browser, except from admin or manager
 author     : Myron Turner  author     : Myron Turner 
 email      : turnermm02@shaw.ca  email      : turnermm02@shaw.ca 
 type       : syntax type       : syntax
-lastupdate : 2018-03-01 +lastupdate : 2022-09-14 
-compatible : 2009-02-14,lemming,anteater,rincewind,angua,adora belle,hrun,detritus+compatible : Lemming, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder StibbonsHrunDetritusElenor of TsortFrusterick MannersGreeboHogfatherIgor
 depends    :  depends    : 
 conflicts  conflicts 
-similar    : ifauth+similar    : ifauth, showif, condition, isauth, ifauthex
 tags       : hide, comment, acl, conceal tags       : hide, comment, acl, conceal
  
Line 19: Line 19:
  
 ---- ----
 +   
 ===== Installation ===== ===== Installation =====
  
-Download [[#development|syntax.php]] from the source code below and install it in the folder''plugins/nodisp''+Install from the extension manager. 
 + 
 +To install manually, refer to [[:Plugins]]. 
  
-Refer to [[:Plugins]] on how to install plugins manually. 
  
 ===== Examples/Usage ===== ===== Examples/Usage =====
  
 This plugin has two ways of concealing text from unauthorized users.   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.   +  - 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 acl setting, the text is completely removed from the page.  It is not output from the server to the browser. +  - 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 ===== ===== Syntax =====
  
 ==== The syntax for the first case ==== ==== The syntax for the first case ====
 +
 <code> <code>
-  <nodisp> your text here </nodisp>+<nodisp> your text here </nodisp>
  
-  <nodisp> +<nodisp> 
-  your text here +your text here 
-  etc +etc 
-  </nodisp>+</nodisp>
 </code> </code>
 +
 ==== The syntax for the second case ==== ==== The syntax for the second case ====
 +
 <code> <code>
-  <nodisp acl> your text here </nodisp> +<nodisp acl> your text here </nodisp> 
-   + 
-  <nodisp acl> +<nodisp acl> 
-  your text here +your text here 
-  etc +etc 
-  </nodisp>+</nodisp>
 </code> </code>
-''acl'' is the numeric representation of the acl level which is required if the marked off text will by output to the page.  These levels are described in the [[acl#background_info|acl documentation]].  So, for example, with ''<nodisp 8>'' the viewer must have upload permission or greaterwith ''<nodisp 2>'' edit permission or greater, etc.+ 
 +''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 ((acl 2)) 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 ((acl 4)) would uhave access to both.   
 +The ACL levels are described in the [[:acl#background_info|acl documentation]].  
 + 
 +==== Newline syntax ==== 
 +<code> 
 +{nodisp} your text here {/nodisp} 
 + 
 +{nodisp} 
 +your text here 
 +etc 
 +{/nodisp} 
 + 
 +{nodisp acl} your text here {/nodisp} 
 + 
 +{nodisp acl} 
 +your text here 
 +etc 
 +{/nodisp} 
 +</code> 
 +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/
 + 
 +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.  
 + 
 +<code> 
 +<nodisp group> 
 +Restricted Data 
 +</nodisp> 
 + 
 +{nodisp group}Restricted Data{/nodisp}  
 +</code>  
 + 
 +**Notice:** The group name does not use the at-sign; it is ''group'', not ''@group''.  
 ===== Development ===== ===== Development =====
 +
 === Change Log === === Change Log ===
 +
 {{rss>https://github.com/turnermm/nodisp/commits/master.atom date count=5}} {{rss>https://github.com/turnermm/nodisp/commits/master.atom date count=5}}
 +
   * 2016-01-16 by [[user>michitux|Michael Hamann]]   * 2016-01-16 by [[user>michitux|Michael Hamann]]
     * Fix method signature compatibility for PHP 7.0     * Fix method signature compatibility for PHP 7.0
Line 68: Line 112:
 > 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 > 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 [[plugin:nodisp]].  See above: [[#examples_usage]] 
 +--- [[user>turnermm|Myron Turner]] //2020-03-13 16:53//
plugin/nodisp.1551456884.txt.gz · Last modified: 2019-03-01 17:14 by turnermm

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