%META:TOPICINFO{author="MeredithLesly" date="1141068861" format="1.1" version="1.7"}%
---+ !HideInEditModePlugin

This is a plugin that you can use to hide one or two blocsk of text in the edit page, so that the text cannot be edited or changed unless the user has the access permission. The text is still rendered in the view page.

---++ Syntax Rules

   * =%<nop>STARTHIDDEN% ... %<nop>ENDHIDDEN%=, which is the equivalent of
   * =%<nop>STARTHIDDEN{"top"}% ... %<nop>ENDHIDDEN%=
   * =%<nop>STARTHIDDEN{"bottom"}% ... %<nop>ENDHIDDEN%=
   * Text outside the =%<nop>STARTHIDDEN% ... %<nop>ENDHIDDEN%= is not hidden in the edit page, thus it can be edited like the normal way.
   * The access permission is controlled by the =ALLOWTOPICHIDDEN= preference variable. Only people listed in the =ALLOWTOPICHIDDEN= variable that can edit the hidden text. Obviously, the ALLOWTOPICHIDDEN variable must be set inside the %<nop>STARTHIDDEN% ... %<nop>ENDHIDDEN% so that a user who has write access (but not listed in the ALLOWTOPICHIDDEN) cannot change the variable.

---++ Examples
<verbatim>
%<nop>STARTHIDDEN%

<!--
   * Restrict who can see/edit the hidden text
      * Set ALLOWTOPICHIDDEN = Main.JoeSomebody
-->

Hello World

%ENDHIDDEN%
</verbatim>


---++ <nop>%TOPIC% Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, for example, ==%<nop>HIDDENTEXTPLUGIN_SHORTDESCRIPTION%==

   * One line description, shown in the %TWIKIWEB%.TextFormattingRules topic:
      * Set SHORTDESCRIPTION = Hide a block of text in the edit page

   * Debug plugin: (See output in =data/debug.txt=)
      * Set DEBUG = 0

---++ Known Problems

Currently everything is visible in raw view. This is clearly not the right thing. Help?

---++ Plugin Installation Instructions

__Note:__ The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

   * Download the ZIP file from the Plugin web (see below)
   * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
     | *File:* | *Description:* |
     | ==data/TWiki/%TOPIC%.txt== | Plugin topic |
     | ==data/TWiki/%TOPIC%.txt,v== | Plugin topic repository |
     | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
     | ==data/Sandbox/HiddenTextTest.txt== | Text page |

---++ Plugin Info

|  Plugin Author: | TWiki:Main/MeredithLesly |
|  Plugin Version: | 27 Feb 2006 |
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
|  06 Feb 2006: | Added tags to allow hidden text above and below the rest of the text |
|  04 Oct 2003: | Change the syntax so that the hidden block can include '}%' |
|  03 Oct 2003: | Initial version |
|  CPAN Dependencies: | none |
|  Other Dependencies: | none |
|  Perl Version: | 5.005 |
|  Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
|  Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |

__Related Topics:__ %TWIKIWEB%.TWikiPreferences, %TWIKIWEB%.TWikiPlugins
 
-- TWiki:Main.MeredithLesly - 25 Feb 2006
%META:TOPICMOVED{by="MeredithLesly" date="1141059508" from="TWiki.HiddenInEditPlugin" to="TWiki.HideInEditModePlugin"}%
