data/TWiki/PreferencesPlugin.txt,v
author Colas Nahaboo <colas@nahaboo.net>
Mon, 11 Aug 2008 20:33:37 +0200
changeset 2 7bc60a767fa4
parent 1 e2915a7cbdfa
permissions -rw-r--r--
TWiki-4.2.2 Release
     1 head	1.6;
     2 access;
     3 symbols;
     4 locks; strict;
     5 comment	@# @;
     6 
     7 
     8 1.6
     9 date	2008.08.10.15.02.41;	author TWikiContributor;	state Exp;
    10 branches;
    11 next	1.5;
    12 
    13 1.5
    14 date	2008.08.03.22.17.48;	author TWikiContributor;	state Exp;
    15 branches;
    16 next	1.4;
    17 
    18 1.4
    19 date	2008.01.22.03.21.31;	author TWikiContributor;	state Exp;
    20 branches;
    21 next	1.3;
    22 
    23 1.3
    24 date	2007.01.16.04.11.59;	author TWikiContributor;	state Exp;
    25 branches;
    26 next	1.2;
    27 
    28 1.2
    29 date	2006.04.01.05.55.33;	author TWikiContributor;	state Exp;
    30 branches;
    31 next	1.1;
    32 
    33 1.1
    34 date	2006.02.01.12.01.23;	author TWikiContributor;	state Exp;
    35 branches;
    36 next	;
    37 
    38 
    39 desc
    40 @new-topic
    41 @
    42 
    43 
    44 1.6
    45 log
    46 @buildrelease
    47 @
    48 text
    49 @%META:TOPICINFO{author="TWikiContributor" date="1115527529" format="1.0" version="6"}%
    50 ---+!! <nop>%TOPIC%
    51 
    52 Allows editing of preferences using fields predefined in a %SYSTEMWEB%.TWikiForms. However, the edit fields are inlined in the text, similar to how tables are edited in TWiki:Plugins/EditTablePlugin.
    53 
    54 %TOC%
    55 
    56 Insert the =%<nop>EDITPREFERENCES%= variable (see below) anywhere in your topic. It will be replaced by a button that allows editing each preference in its predefined input format (or a text box, when no format is defined for this preference).
    57 
    58 In edit mode, the edit button is replaced by Save and Cancel buttons, with their obvious meanings.
    59 
    60 ---++ Syntax Rules
    61 
    62 	* =%<nop>EDITPREFERENCES{ "= _topic_ =" }%=
    63 		* _topic_ references a [[%SYSTEMWEB%.TWikiForms][TWikiForm]] defining the format of the edit fields for preferences. It may be prefixed by a web.
    64 		* If a preference setting is not mentioned in the form referenced by _topic_, a text input box of the specified length is provided.
    65 		* Otherwise, the input can be through textareas, select, radio, checkbox, date, or text, as provided by %SYSTEMWEB%.TWikiForms.
    66    * =%<nop>EDITPREFERENCES%=
    67       * Edit existing preferences in the topic using a simple text field.
    68 ---++ Examples
    69 	* =%<nop>EDITPREFERENCES%= 
    70 	* =%<nop>EDITPREFERENCES{ "%<nop>SYSTEMWEB%.TWikiPreferencesForm" }%= 
    71 
    72 ---++ Plugin Settings
    73 	* One line description, shown in the %SYSTEMWEB%.TextFormattingRules topic:
    74 		* Set SHORTDESCRIPTION = Allows editing of preferences using fields predefined in a form
    75 
    76 ---++ Plugin Installation Instructions
    77 You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running.
    78 
    79 Like many other TWiki extensions, this module is shipped with a fully
    80 automatic installer script written using the Build<nop>Contrib.
    81    * If you have TWiki 4.2 or later, you can install from the =configure= interface (Go to Plugins->Find More Extensions)
    82       * See the [[http://twiki.org/cgi-bin/view/Plugins/BuildContribInstallationSupplement][installation supplement]] on TWiki.org for more information.
    83    * If you have any problems, then you can still install manually from the command-line:
    84       1 Download one of the =.zip= or =.tgz= archives
    85       1 Unpack the archive in the root directory of your TWiki installation.
    86       1 Run the installer script ( =perl &lt;module&gt;_installer= )
    87       1 Run =configure= and enable the module, if it is a plugin.
    88       1 Repeat for any missing dependencies.
    89    * If you are *still* having problems, then instead of running the installer script:
    90       1 Make sure that the file permissions allow the webserver user to access all files.
    91       1 Check in any installed files that have existing =,v= files in your existing install (take care *not* to lock the files when you check in)
    92       1 Manually edit !LocalSite.cfg to set any configuration variables.
    93 
    94 %IF{"defined 'SYSTEMWEB'" else="<div class='twikiAlert'>%X% WARNING: SYSTEMWEB is not defined in this TWiki. Please add these definitions to your %MAINWEB%.TWikiPreferences, if they are not already there:<br><pre>   * <nop>Set SYSTEMWEB = %<nop>TWIKIWEB%<br>   * <nop>Set USERSWEB = %<nop>MAINWEB%</pre></div>"}%
    95 
    96 	* If the installation was successful, an edit button should appear below:
    97 %EDITPREFERENCES%
    98 
    99 ---++ Plugin Info
   100 
   101 |  Plugin Author: | TWiki:Main.ThomasWeigert |
   102 |  Plugin Version: | 15487 (11 Aug 2008) |
   103 |  Change History: | <!-- versions below in reverse order -->&nbsp; |
   104 |  05 Nov 2007: | Kenneth Lavrsen fixed problem when settings are hidden in html comments. These settings are now ignored. |
   105 |  23 Jun 2007: | Crawford Currie added testcases, recoded to work without a form definition, fixed for TWiki 4.2 |
   106 |  08 Feb 2007: | Arthur Clemens added access keys for Save and Cancel, bold style for editable preference names, and a descriptive Save button label. |
   107 |  15 Apr 2006: | Adding css classes to buttons. Removed debug print statement causing 500s on !SunOne. Prevent extra space in settings on saves. Switched to earlier handler. Converted all SCRIPTURL to SCRIPTURLPATH, and added support. The only SCRIPTURLs should be the one in the BASE tag and those in mail notification templates. Because the forms package was throwing an exception when it failed to create a form, the edit preferences plugin was aborting the whole of the session whenever the form specified in EDITPREFERENCES didn't exist. Changed it so that the Form constructor does not throw, but returns undef on a non-existant form, and changed preferences plugin to be tolerant of missing forms (ie defaults all fields to text if the form is missing, of is a Set exists which is not in the form). | 
   108 |  26 May 2005: | Crawford Currie recoded to use code from Form.pm to render form fields. |
   109 |  08 May 2005: | Add plugin preference to define default input length  |
   110 |  07 May 2005: | Initial version |
   111 |  TWiki Dependency: | $TWiki::Plugins::VERSION 1.026 |
   112 |  CPAN Dependencies: | none |
   113 |  Other Dependencies: | none |
   114 |  Perl Version: | 5.005 |
   115 |  License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
   116 |  TWiki:Plugins/Benchmark: | %SYSTEMWEB%.GoodStyle nn%, %SYSTEMWEB%.FormattedSearch nn%, %TOPIC% nn% |
   117 |  Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
   118 |  Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |
   119 |  Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal |
   120 
   121 __Related Topics:__ %SYSTEMWEB%.TWikiPreferences, %SYSTEMWEB%.TWikiForms
   122 
   123 
   124 @
   125 
   126 
   127 1.5
   128 log
   129 @buildrelease
   130 @
   131 text
   132 @d1 1
   133 a1 1
   134 %META:TOPICINFO{author="TWikiContributor" date="1115527529" format="1.0" version="5"}%
   135 d54 1
   136 a54 1
   137 |  Plugin Version: | 15487 (04 Aug 2008) |
   138 @
   139 
   140 
   141 1.4
   142 log
   143 @buildrelease
   144 @
   145 text
   146 @d1 1
   147 a1 1
   148 %META:TOPICINFO{author="TWikiContributor" date="1115527529" format="1.0" version="4"}%
   149 d54 1
   150 a54 1
   151 |  Plugin Version: | 15487 (22 Jan 2008) |
   152 @
   153 
   154 
   155 1.3
   156 log
   157 @buildrelease
   158 @
   159 text
   160 @d1 1
   161 a1 1
   162 %META:TOPICINFO{author="TWikiContributor" date="1115527529" format="1.0" version="3"}%
   163 d4 1
   164 a4 1
   165 Allows editing of preferences using fields predefined in a %TWIKIWEB%.TWikiForms. However, the edit fields are inlined in the text, similar to how tables are edited in TWiki:Plugins/EditTablePlugin.
   166 d10 1
   167 a10 1
   168 In edit mode, the edit button is replaced by save and cancel buttons, with their obvious meanings.
   169 d15 1
   170 a15 1
   171 		* _topic_ references a %TWIKIWEB%.TWikiForms defining the format of the edit fields for preferences. It may be prefixed by a web.
   172 d17 3
   173 a19 2
   174 		* Otherwise, the input can be through textareas, select, radio, checkbox, date, or text, as provided by %TWIKIWEB%.TWikiForms.
   175 
   176 d21 2
   177 a22 2
   178 
   179 	* =%<nop>EDITPREFERENCES{ "%<nop>TWIKIWEB%.TWikiPreferencesForm" }%= 
   180 d25 1
   181 a25 4
   182 
   183 Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, i.e. ==%<nop>PREFERENCESPLUGIN_SHORTDESCRIPTION%==
   184 
   185 	* One line description, is shown in the %TWIKIWEB%.TextFormattingRules topic:
   186 d29 16
   187 d46 1
   188 a46 1
   189 __Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running. 
   190 d48 2
   191 a49 9
   192 	* Download the ZIP file from the Plugin web (see below)
   193 	* Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
   194 	  | *File:* | *Description:* |
   195 	  | ==data/TWiki/%TOPIC%.txt== | Plugin topic |
   196 	  | ==data/TWiki/%TOPIC%.txt,v== | Plugin topic repository |
   197 	  | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
   198 	  | ==data/TWiki/TWikiPreferencesForm.txt== | Example form |
   199 	* (Dakar) Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section.
   200 	* If the installation was successful, an edit button should appear below: %EDITPREFERENCES{ "%TWIKIWEB%.TWikiPreferencesForm" }%
   201 d54 1
   202 a54 1
   203 |  Plugin Version: | 15 Apr 2006 |
   204 d56 3
   205 d68 1
   206 a68 1
   207 |  TWiki:Plugins/Benchmark: | %TWIKIWEB%.GoodStyle nn%, %TWIKIWEB%.FormattedSearch nn%, %TOPIC% nn% |
   208 d73 1
   209 a73 1
   210 __Related Topics:__ %TWIKIWEB%.TWikiPreferences, %TWIKIWEB%.TWikiForms
   211 a74 1
   212 -- TWiki:Main.ThomasWeigert - 08 May 2005
   213 @
   214 
   215 
   216 1.2
   217 log
   218 @buildrelease
   219 @
   220 text
   221 @d1 1
   222 a1 1
   223 %META:TOPICINFO{author="TWikiContributor" date="1115527529" format="1.0" version="2"}%
   224 d47 1
   225 a47 1
   226 |  Plugin Version: | 08 May 2005 |
   227 d49 1
   228 @
   229 
   230 
   231 1.1
   232 log
   233 @buildrelease
   234 @
   235 text
   236 @d1 1
   237 a1 1
   238 %META:TOPICINFO{author="guest" date="1115527529" format="1.0" version="1"}%
   239 @