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