data/TWiki/EditTablePlugin.txt,v
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
child 1 e2915a7cbdfa
permissions -rw-r--r--
RELEASE 4.2.0 freetown
colas@0
     1
head	1.14;
colas@0
     2
access;
colas@0
     3
symbols;
colas@0
     4
locks; strict;
colas@0
     5
comment	@# @;
colas@0
     6
colas@0
     7
colas@0
     8
1.14
colas@0
     9
date	2008.01.22.03.21.31;	author TWikiContributor;	state Exp;
colas@0
    10
branches;
colas@0
    11
next	1.13;
colas@0
    12
colas@0
    13
1.13
colas@0
    14
date	2007.01.16.04.11.56;	author TWikiContributor;	state Exp;
colas@0
    15
branches;
colas@0
    16
next	1.12;
colas@0
    17
colas@0
    18
1.12
colas@0
    19
date	2006.10.25.00.21.55;	author TWikiContributor;	state Exp;
colas@0
    20
branches;
colas@0
    21
next	1.11;
colas@0
    22
colas@0
    23
1.11
colas@0
    24
date	2006.04.01.05.55.29;	author TWikiContributor;	state Exp;
colas@0
    25
branches;
colas@0
    26
next	1.10;
colas@0
    27
colas@0
    28
1.10
colas@0
    29
date	2006.02.01.12.01.22;	author TWikiContributor;	state Exp;
colas@0
    30
branches;
colas@0
    31
next	1.9;
colas@0
    32
colas@0
    33
1.9
colas@0
    34
date	2004.08.02.05.45.34;	author PeterThoeny;	state Exp;
colas@0
    35
branches;
colas@0
    36
next	1.8;
colas@0
    37
colas@0
    38
1.8
colas@0
    39
date	2004.05.09.07.21.28;	author PeterThoeny;	state Exp;
colas@0
    40
branches;
colas@0
    41
next	1.7;
colas@0
    42
colas@0
    43
1.7
colas@0
    44
date	2004.03.21.08.21.54;	author PeterThoeny;	state Exp;
colas@0
    45
branches;
colas@0
    46
next	1.6;
colas@0
    47
colas@0
    48
1.6
colas@0
    49
date	2004.02.28.21.51.00;	author PeterThoeny;	state Exp;
colas@0
    50
branches;
colas@0
    51
next	1.5;
colas@0
    52
colas@0
    53
1.5
colas@0
    54
date	2004.02.19.05.48.00;	author PeterThoeny;	state Exp;
colas@0
    55
branches;
colas@0
    56
next	1.4;
colas@0
    57
colas@0
    58
1.4
colas@0
    59
date	2004.02.17.11.20.39;	author PeterThoeny;	state Exp;
colas@0
    60
branches;
colas@0
    61
next	1.3;
colas@0
    62
colas@0
    63
1.3
colas@0
    64
date	2003.12.20.07.47.00;	author PeterThoeny;	state Exp;
colas@0
    65
branches;
colas@0
    66
next	1.2;
colas@0
    67
colas@0
    68
1.2
colas@0
    69
date	2003.12.14.00.53.00;	author PeterThoeny;	state Exp;
colas@0
    70
branches;
colas@0
    71
next	1.1;
colas@0
    72
colas@0
    73
1.1
colas@0
    74
date	2003.12.12.08.31.00;	author PeterThoeny;	state Exp;
colas@0
    75
branches;
colas@0
    76
next	;
colas@0
    77
colas@0
    78
colas@0
    79
desc
colas@0
    80
@none
colas@0
    81
@
colas@0
    82
colas@0
    83
colas@0
    84
1.14
colas@0
    85
log
colas@0
    86
@buildrelease
colas@0
    87
@
colas@0
    88
text
colas@0
    89
@%META:TOPICINFO{author="TWikiContributor" date="1191744279" format="1.1" version="14"}%
colas@0
    90
---+!! Edit Table Plugin
colas@0
    91
colas@0
    92
Edit TWiki tables in place, using edit fields and drop down boxes, without having to edit the complete topic. 
colas@0
    93
colas@0
    94
Simply add an *[&nbsp;Edit&nbsp;table&nbsp;]* button to an existing table by writing =%<nop>EDITTABLE{}%= directly above the table. This can be added to tables that are formatted with TablePlugin: add the =EDITTABLE= variable just above or below the =TABLE= tag. It can also be used without any =TABLE= tag.
colas@0
    95
colas@0
    96
Customize entry fields by specifying the format: use a text field, a drop down box, a date field, radio buttons or checkboxes.
colas@0
    97
colas@0
    98
Multiple tables per topic are editable, but only one at a time can be edited.
colas@0
    99
colas@0
   100
%TOC%
colas@0
   101
colas@0
   102
---++ Per Table Settings
colas@0
   103
colas@0
   104
Add a =%<nop>EDITTABLE{...}%= variable just before an existing table to make it editable, or add the variable anywhere in a topic to start a new table.
colas@0
   105
%INCLUDE{"%TWIKIWEB%.VarEDITTABLE" section="edittable_attributes"}%
colas@0
   106
colas@0
   107
---+++ Using TWiki Variables in the Format Parameter
colas@0
   108
colas@0
   109
TWiki variables like =%<nop>Y%= in =&lt;initial value&gt;= (of text input field) and =&lt;label text&gt;= (of fixed label) will get expanded when a new row is added.
colas@0
   110
colas@0
   111
This is useful to write variables like dates into the table.
colas@0
   112
<blockquote>
colas@0
   113
For example:
colas@0
   114
<verbatim>
colas@0
   115
%EDITTABLE{ format="| label, 0, %SERVERTIME{"$day $mon $year $hour:$min"}% |" }%
colas@0
   116
</verbatim>
colas@0
   117
... will get expanded to =%SERVERTIME{"$day $mon $year $hour:$min"}%= when the new row is created.
colas@0
   118
</blockquote>
colas@0
   119
colas@0
   120
To prevent variable expansion: escape the format variable with [[%TWIKIWEB%.FormatTokens][formatting tokens]] (particularly =$percnt=).
colas@0
   121
<blockquote>
colas@0
   122
For example:
colas@0
   123
<verbatim>
colas@0
   124
%EDITTABLE{ format="| text, 20, $percntY$percnt |" }%
colas@0
   125
</verbatim>
colas@0
   126
... will create a new row with =$percntY$percnt=. In view mode this is temporarily translated to =%<nop>Y%= and subsequent rendered as %Y%.
colas@0
   127
</blockquote>
colas@0
   128
colas@0
   129
colas@0
   130
colas@0
   131
#DateField
colas@0
   132
---+++ Date Field Type
colas@0
   133
colas@0
   134
<img src="%ATTACHURLPATH%/EditTablePluginCalendarExample.gif" alt="Edit Table Calendar Example" width="638" height="250" />
colas@0
   135
colas@0
   136
The =date= field type allows one to choose a date with a popup calendar. Popup calendar works with all modern browsers. The date picker button is inactive if the browser cannot support the popup calendar or if javascript is disabled. 
colas@0
   137
colas@0
   138
colas@0
   139
---++ Per Cell Settings
colas@0
   140
colas@0
   141
An individual edit field type can be defined for each table cell. Place an =%<nop>EDITCELL{ "type, ..." }%= variable at the end of the cell content. This is useful to override the per column =%<nop>EDITTABLE{ format="..." }%= settings, or to create tables with key/value rows. All edit field types of the =format="..."= parameter are supported. For example, to define a text field, type: =| cell content %<nop>EDITCELL{ "text, 20" }% |=
colas@0
   142
colas@0
   143
It is also possible to place the edit button inside a cell instead of default location below the table. Type =| %<nop>EDITCELL{ "editbutton, 1, Edit this table" }% |= to show a button, or =| %<nop>EDITCELL{ "editbutton, 1, Edit table, Image-URL" }% |= to show a button image with alternate text.
colas@0
   144
colas@0
   145
__Note:__ The =%<nop>EDITCELL{ }%=variable cannot be used by itself; place an =%<nop>EDITTABLE{ }%=variable at the beginning of a table where you want to use =%<nop>EDITCELL{ }%= variables.
colas@0
   146
colas@0
   147
---++ Table Buttons
colas@0
   148
colas@0
   149
<form>
colas@0
   150
   * In page view mode:
colas@0
   151
      * <input type="submit" class="twikiSubmit" name="et"   value="Edit table" onclick="return(false);" /> - turn the table into edit mode
colas@0
   152
   * In edit mode:
colas@0
   153
      * <input type="submit" class="twikiButton" name="etsave"   value="Save table"  onclick="return(false);" /> - save your changes
colas@0
   154
      * <input type="submit" class="twikiButton" name="etqsave"   value="Quiet save"  onclick="return(false);" /> - save your changes without alerting subscribed WebNotify users
colas@0
   155
      * <input type="submit" class="twikiButton" name="etaddrow" value="Add row" onclick="return(false);" /> - add row to the table (if enabled)
colas@0
   156
      * <input type="submit" class="twikiButton" name="etdelrow" value="Delete last row" onclick="return(false);" /> - remove last row from the table (if enabled)
colas@0
   157
      * <input type="submit" class="twikiButtonCancel" name="etcancel" value="Cancel" onclick="return(false);" /> - cancel without saving and release edit lock
colas@0
   158
      * <img src="%ATTACHURLPATH%/btn_move.gif"> - Move a row by clicking this button next to the row to
colas@0
   159
         be moved, then at a destination.
colas@0
   160
      * <img src="%ATTACHURLPATH%/btn_delete.gif"> - Deletes the row next to this button.
colas@0
   161
</form>
colas@0
   162
colas@0
   163
---++ Examples
colas@0
   164
colas@0
   165
Line before table: =%<nop>EDITTABLE{ format="| row, -1 | text, 20, init | select, 1, one, two, three, four | radio, 3,:-),:-I,:-( | label, 0, %<nop>SERVERTIME{"$day $mon $year $hour:$min"}% |" changerows="on" }%=
colas@0
   166
%EDITTABLE{ format="| row, -1 | text, 20, init | select, 1, one, two, three, four | radio, 3,:-),:-I,:-( | label, 0, %SERVERTIME{"$day $mon $year $hour:$min"}% |" changerows="on" }%
colas@0
   167
|*Nr*|*Text field*|*Drop down*|*Mood*|*Timestamp*|
colas@0
   168
| 1 | hello table | one | :-) | 26 Jun 2002 12:30 |
colas@0
   169
| 2 |  | two | :-( | 27 Jun 2002 12:40 |
colas@0
   170
colas@0
   171
%RED% __Note:__ Please do not save this example table! Use TWiki:Sandbox.EditTablePluginTesting if you want to try out this Plugin %ENDCOLOR%
colas@0
   172
colas@0
   173
If this plugin is installed you will see an *[&nbsp;Edit&nbsp;table&nbsp;]* button above; if you were to click on it (please don't, use TWiki:Sandbox.EditTablePluginTesting for testing) you get this form:
colas@0
   174
colas@0
   175
<a name="edittable1"></a>
colas@0
   176
<div class="editTable editTableEdit">
colas@0
   177
<input type="hidden" name="ettablenr" value="1" />
colas@0
   178
<table cellspacing="0" id="default" cellpadding="0" class="twikiTable" rules="rows" border="1">
colas@0
   179
	<thead>
colas@0
   180
	<tr class="twikiTableEven twikiTableRowdataBgSorted0 twikiTableRowdataBg0">
colas@0
   181
		<th bgcolor="#6b7f93" valign="top" class="twikiTableCol0 twikiFirstCol"> <a rel="nofollow" href="%SCRIPTURL{"viewauth"}%/%TWIKIWEB%/EditTablePlugin?ettablenr=1&amp;amp;etedit=on&amp;amp;etrows=3&amp;amp;x=27&amp;amp;y=13&amp;amp;sortcol=0;table=2;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Nr<input type="hidden" name="etcell1x1" value="*Nr*" /></font></a> </th>
colas@0
   182
		<th bgcolor="#6b7f93" valign="top" class="twikiTableCol1"> <a rel="nofollow" href="%SCRIPTURL{"viewauth"}%/%TWIKIWEB%/EditTablePlugin?ettablenr=1&amp;amp;etedit=on&amp;amp;etrows=3&amp;amp;x=27&amp;amp;y=13&amp;amp;sortcol=1;table=2;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Text field<input type="hidden" name="etcell1x2" value="*Text field*" /></font></a> </th>
colas@0
   183
		<th bgcolor="#6b7f93" valign="top" class="twikiTableCol2"> <a rel="nofollow" href="%SCRIPTURL{"viewauth"}%/%TWIKIWEB%/EditTablePlugin?ettablenr=1&amp;amp;etedit=on&amp;amp;etrows=3&amp;amp;x=27&amp;amp;y=13&amp;amp;sortcol=2;table=2;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Drop down<input type="hidden" name="etcell1x3" value="*Drop down*" /></font></a> </th>
colas@0
   184
		<th bgcolor="#6b7f93" valign="top" class="twikiTableCol3"> <a rel="nofollow" href="%SCRIPTURL{"viewauth"}%/%TWIKIWEB%/EditTablePlugin?ettablenr=1&amp;amp;etedit=on&amp;amp;etrows=3&amp;amp;x=27&amp;amp;y=13&amp;amp;sortcol=3;table=2;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Mood<input type="hidden" name="etcell1x4" value="*Mood*" /></font></a> </th>
colas@0
   185
		<th bgcolor="#6b7f93" valign="top" class="twikiTableCol4 twikiLastCol"> <a rel="nofollow" href="%SCRIPTURL{"viewauth"}%/%TWIKIWEB%/EditTablePlugin?ettablenr=1&amp;amp;etedit=on&amp;amp;etrows=3&amp;amp;x=27&amp;amp;y=13&amp;amp;sortcol=4;table=2;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Timestamp<input type="hidden" name="etcell1x5" value="*Timestamp*" /></font></a> </th>
colas@0
   186
	</tr>
colas@0
   187
	</thead>
colas@0
   188
	<tr class="twikiTableOdd twikiTableRowdataBgSorted0 twikiTableRowdataBg0">
colas@0
   189
		<td bgcolor="#ffffff" valign="top" class="twikiTableCol0 twikiFirstCol"> <span class="et_rowlabel">1<input type="hidden" name="etcell2x1" value="1" /></span> </td>
colas@0
   190
		<td bgcolor="#ffffff" valign="top" class="twikiTableCol1"> <input class="twikiInputField editTableInput" type="text" name="etcell2x2" size="20" value="hello table" /> </td>
colas@0
   191
		<td bgcolor="#ffffff" valign="top" class="twikiTableCol2"> <select class="twikiSelect" name="etcell2x3" size="1"> <option selected="selected">one</option> <option>two</option> <option>three</option> <option>four</option></select> </td>
colas@0
   192
		<td bgcolor="#ffffff" valign="top" class="twikiTableCol3"> <input type="radio" name="etcell2x4" value=":-)" checked="checked" /> <img src="%PUBURL%/%TWIKIWEB%/SmiliesPlugin/smile.gif" alt="smile" title="smile" border="0" />  <input type="radio" name="etcell2x4" value=":-I" /> <img src="%PUBURL%/%TWIKIWEB%/SmiliesPlugin/indifferent.gif" alt="indifferent" title="indifferent" border="0" />  <input type="radio" name="etcell2x4" value=":-(" /> <img src="%PUBURL%/%TWIKIWEB%/SmiliesPlugin/frown.gif" alt="frown" title="frown" border="0" /> </td>
colas@0
   193
		<td bgcolor="#ffffff" valign="top" class="twikiTableCol4 twikiLastCol"> 26 Jun 2002 12:30<input type="hidden" name="etcell2x5" value="26 Jun 2002 12:30" /> </td>
colas@0
   194
	</tr>
colas@0
   195
	<tr class="twikiTableEven twikiTableRowdataBgSorted1 twikiTableRowdataBg1">
colas@0
   196
		<td bgcolor="#edf4f9" valign="top" class="twikiTableCol0 twikiFirstCol twikiLast"> <span class="et_rowlabel">2<input type="hidden" name="etcell3x1" value="2" /></span> </td>
colas@0
   197
		<td bgcolor="#edf4f9" valign="top" class="twikiTableCol1 twikiLast"> <input class="twikiInputField editTableInput" type="text" name="etcell3x2" size="20" value="" /> </td>
colas@0
   198
colas@0
   199
		<td bgcolor="#edf4f9" valign="top" class="twikiTableCol2 twikiLast"> <select class="twikiSelect" name="etcell3x3" size="1"> <option>one</option> <option selected="selected">two</option> <option>three</option> <option>four</option></select> </td>
colas@0
   200
		<td bgcolor="#edf4f9" valign="top" class="twikiTableCol3 twikiLast"> <input type="radio" name="etcell3x4" value=":-)" /> <img src="%PUBURL%/%TWIKIWEB%/SmiliesPlugin/smile.gif" alt="smile" title="smile" border="0" />  <input type="radio" name="etcell3x4" value=":-I" /> <img src="%PUBURL%/%TWIKIWEB%/SmiliesPlugin/indifferent.gif" alt="indifferent" title="indifferent" border="0" />  <input type="radio" name="etcell3x4" value=":-(" checked="checked" /> <img src="%PUBURL%/%TWIKIWEB%/SmiliesPlugin/frown.gif" alt="frown" title="frown" border="0" /> </td>
colas@0
   201
		<td bgcolor="#edf4f9" valign="top" class="twikiTableCol4 twikiLastCol twikiLast"> 27 Jun 2002 12:40<input type="hidden" name="etcell3x5" value="27 Jun 2002 12:40" /> </td>
colas@0
   202
	</tr></table>
colas@0
   203
<input type="hidden" name="etrows" value="3" />
colas@0
   204
<input type="submit" name="etsave" id="etsave" value="Save table" class="twikiSubmit" />
colas@0
   205
<input type="submit" name="etqsave" id="etqsave" value="Quiet save" class="twikiButton" />
colas@0
   206
<input type="submit" name="etaddrow" id="etaddrow" value="Add row" class="twikiButton" />
colas@0
   207
<input type="submit" name="etdelrow" id="etdelrow" value="Delete last row" class="twikiButton" />
colas@0
   208
<input type="submit" name="etcancel" id="etcancel" value="Cancel" class="twikiButton twikiButtonCancel" />
colas@0
   209
</div><!-- /editTable -->
colas@0
   210
colas@0
   211
The following example shows a simple table with key/value rows. The default edit field type for the value column is a text field. This is overloaded by a selector for the Gender, and a date picker for the DOB. This is typically used by TWiki applications where new topics with tables are created based on a template topic.
colas@0
   212
colas@0
   213
<table style="background:#f2f2f2;" cellpadding="6">
colas@0
   214
<tr>
colas@0
   215
<th>
colas@0
   216
You type:
colas@0
   217
</th>
colas@0
   218
<th>
colas@0
   219
You get:
colas@0
   220
</th>
colas@0
   221
<th>
colas@0
   222
Table in edit mode:
colas@0
   223
</th>
colas@0
   224
</tr>
colas@0
   225
<tr>
colas@0
   226
<td valign="top">
colas@0
   227
<verbatim>
colas@0
   228
%EDITTABLE{ format="| label | text, 40 |" changerows="off" }%
colas@0
   229
|*Key*|*Value*|
colas@0
   230
| Name: | John Smith |
colas@0
   231
| Gender: | M %EDITCELL{select, 1, , F, M}% |
colas@0
   232
| DOB: | 1999/12/31 %EDITCELL{date, 10}% |
colas@0
   233
| City: | New York |
colas@0
   234
</verbatim>
colas@0
   235
</td>
colas@0
   236
<td valign="top">
colas@0
   237
<img src="%ATTACHURLPATH%/ScreenshotEditCell1.gif" alt="EDITCELL Example in view mode" width="150" height="172" />
colas@0
   238
</td>
colas@0
   239
<td valign="top">
colas@0
   240
<img src="%ATTACHURLPATH%/ScreenshotEditCell2.gif" alt="EDITCELL Example in edit mode" width="436" height="198" />
colas@0
   241
</td>
colas@0
   242
</tr></table>
colas@0
   243
colas@0
   244
---++ Plugin Settings
colas@0
   245
colas@0
   246
Plugin settings are stored as preferences variables. To reference
colas@0
   247
a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, for example, ==%<nop>EDITTABLEPLUGIN_SHORTDESCRIPTION%==
colas@0
   248
colas@0
   249
   * One line description, shown in the %TWIKIWEB%.TextFormattingRules topic:
colas@0
   250
      * Set SHORTDESCRIPTION = Edit TWiki tables using edit fields, date pickers and drop down boxes
colas@0
   251
colas@0
   252
   * Set DEBUG to 1 to get debug messages in =data/debug.txt=.  Default: =0=
colas@0
   253
      * Set DEBUG = 0
colas@0
   254
colas@0
   255
   * Set JAVASCRIPTINTERFACE to 1 to be able to directly move and delete row without page refresh.
colas@0
   256
      * Set JAVASCRIPTINTERFACE = 1
colas@0
   257
   
colas@0
   258
   * Default for change rows flag: =on=, =off=, =add=
colas@0
   259
      * Set CHANGEROWS = on
colas@0
   260
colas@0
   261
   * Default flag for quiet save option: =on= to show the Quiet Save button, =off= to hide
colas@0
   262
      * Set QUIETSAVE = on
colas@0
   263
colas@0
   264
   * Default edit button: Specify =button text=, or specify =alternate text, image URL=. Note: Texts inside =%<nop>MAKETEXT{}%= are translated into other languages.
colas@0
   265
      * #Set EDIT_BUTTON = %MAKETEXT{"Edit table"}%
colas@0
   266
      * Set EDIT_BUTTON = %MAKETEXT{"Edit this table"}%, %ATTACHURL%/edittable.gif
colas@0
   267
      * Set SAVE_BUTTON = %MAKETEXT{"Save table"}%
colas@0
   268
      * Set QUIET_SAVE_BUTTON = %MAKETEXT{"Quiet save"}%
colas@0
   269
      * Set ADD_ROW_BUTTON = %MAKETEXT{"Add row"}%
colas@0
   270
      * Set DELETE_LAST_ROW_BUTTON = %MAKETEXT{"Delete last row"}%
colas@0
   271
      * Set CANCEL_BUTTON = %MAKETEXT{"Cancel"}%
colas@0
   272
colas@0
   273
   * Default help texts
colas@0
   274
      * Set INCLUDED_TOPIC_DOES_NOT_EXIST = <span class="twikiAlert">%MAKETEXT{"Warning: 'include' topic does not exist!"}%</span>
colas@0
   275
   
colas@0
   276
__Note:__ The Plugin uses base settings like date format, language and style from the JSCalendarContrib.
colas@0
   277
colas@0
   278
---++ Limitations and Known Issues
colas@0
   279
colas@0
   280
   * This Plugin does not support TWiki table formatting like Multi-span cells (e.g. =| ... ||=) and cell justification (e.g. =|  centered  |   right |=)
colas@0
   281
   * There is a performance issue when editing a large table, say, with more then 50 rows
colas@0
   282
   * Variables like =%<nop>ATTACHURL%= get expanded unless they are in a label
colas@0
   283
   * You cannot put two =%<nop>EDITTABLE{}%= statements on the same line in the source
colas@0
   284
   * You can include %-vars now in select values, by quoting them with &lt;nop&gt;, as in %&lt;nop&gt;X% for %<nop>X%, say for instance:
colas@0
   285
     <br /> =select,1,%&lt;nop&gt;X%,%&lt;nop&gt;Y%=
colas@0
   286
colas@0
   287
colas@0
   288
colas@0
   289
---++ Installation Instructions
colas@0
   290
colas@0
   291
   * Download the ZIP file from the Plugin web (see below)
colas@0
   292
   * Unzip ==%TOPIC%.zip== in your ($TWIKI_ROOT) directory.
colas@0
   293
   * Alternatively,
colas@0
   294
      * Manually resolve the dependencies listed below.
colas@0
   295
      None
colas@0
   296
   * The Plugin depends on the =viewauth= script to authenticate the user. As described in %TWIKIWEB%.TWikiAccessControl, copy the =view= script to =viewauth= (or better, create a symbolic link) and add =viewauth= to the list of authenticated scripts in the =.htaccess= file.
colas@0
   297
   * (Dakar) Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section.
colas@0
   298
   * Test if the Plugin is correctly installed:
colas@0
   299
      * Check above example if there is an *[&nbsp;Edit&nbsp;table&nbsp;]* button below the table in above example
colas@0
   300
      * Click on *[&nbsp;Edit&nbsp;table&nbsp;]*, make changes and save the table
colas@0
   301
colas@0
   302
---++ License
colas@0
   303
colas@0
   304
   * The Edit Table Plugin is released under the [[http://www.gnu.org/licenses/gpl.html][GPL]]
colas@0
   305
colas@0
   306
colas@0
   307
---++ Plugin Info
colas@0
   308
colas@0
   309
|  Plugin Author: | TWiki:Main/PeterThoeny |
colas@0
   310
|  Copyright: | &copy; 2002-2007, TWiki:Main.PeterThoeny ([[http://www.twiki.net/][TWIKI.NET]]) and TWiki Contributors |
colas@0
   311
|  License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
colas@0
   312
|  Plugin Version: | 4.7.10 (08 Jan 2008) |
colas@0
   313
|  Change History: | <!-- specify latest version first -->&nbsp; |
colas@0
   314
|  25 Dec 2007: | 4.7.1: Arthur Clemens: Added warning if =include= parameter topic does not exist. |
colas@0
   315
|  22 Dec 2007: | 4.7: Arthur Clemens: Changed handling of escaped variables. To escape TWiki variable, use formatting tokens such as =$percnt=. |
colas@0
   316
|  16 Dec 2007: | 4.6:  Kenneth Lavrsen: The plugin prevents TablePlugin from initsorting the table being edited. This is done by temporarily appending the attribute disableallsort="on" to the TABLE tag of a table being edited. Additionally all header sorting is disabled while editing a table by setting a hidden formfield =sort= to "off". Disabling sorting while editing is needed now that the EditTablePlugin supports moving rows up and down. |
colas@0
   317
|  01 Dec 2007: | 4.3:  Arthur Clemens: added support for TablePlugin =headerrows= and =footerrows=; updated edit button |
colas@0
   318
|  16 Oct 2007: | 4.2:  Arthur Clemens: refactoring, bug fixes. |
colas@0
   319
|  07 Oct 2007: | 15182: PTh: Added %TWIKIWEB%.VarEDITTABLE to have it listed in %TWIKIWEB%.TWikiVariables |
colas@0
   320
|  15 Mar 2007: | Arthur Clemens: Fixed eating of double newlines; icons for javascript buttons and interface improvements. By default the javascript interface is turned off, set =JAVASCRIPTINTERFACE= to use it in edit mode. |
colas@0
   321
|  05 Mar 2007: | Byron Darrah: Added ability to dynamically move and delete rows. |
colas@0
   322
|  12 Oct 2006: | <a rel="nofollow" href="http://develop.twiki.org/~develop/cgi-bin/view/Bugs/Item2982">Item2982</a> Use default date format from JSCalendarContrib |
colas@0
   323
|  02 Oct 2006: | <a rel="nofollow" href="http://develop.twiki.org/~develop/cgi-bin/view/Bugs/Item2884">Item2884</a> Check also for access permission in meta data; proper fix to not warn if oneself has a lock on topic |
colas@0
   324
|  30 Aug 2006: | <a rel="nofollow" href="http://develop.twiki.org/~develop/cgi-bin/view/Bugs/Item2829">Item2829</a> Remove whitespace from select, radio and checkbox items; restored topic lock if $TWiki::Plugins::VERSION < 1.1 |
colas@0
   325
|  29 Jul 2006: | <a rel='nofollow' href='http://develop.twiki.org/~develop/cgi-bin/view/Bugs/Item2684'>Item2684</a> - Quietly ignore topic edit locks on table edit |
colas@0
   326
|  21 Jan 2006: | TWiki:Main.CrawfordCurrie ported to TWiki-4.0.0, changed to use JSCalendarContrib |
colas@0
   327
|  16 Sep 2004: | Added radio buttons and checkbox controls; escaped "%VBAR%" pipe symbol found in input fields to preserve tables |
colas@0
   328
|  01 Aug 2004: | Fixed bug where edittable did not work if at the end of a topic |
colas@0
   329
|  07 Apr 2004: | Fixed bug where two tables got updated when you edit and save a table included into a topic containing other edit tables |
colas@0
   330
|  02 Mar 2004: | Default for =%<nop>EDITCELL{editbutton}%= is EDITBUTTON preference |
colas@0
   331
|  27 Feb 2004: | Added QUIETSAVE setting and =quietsave= parameter; image for Edit button |
colas@0
   332
|  18 Feb 2004: | Doc fixes; allow edit button anywhere in a cell not just at the end of a cell |
colas@0
   333
|  17 Feb 2004: | Added per cell definition of edit field types with =%<nop>EDITCELL{}%= variable; added =headerislabel= and =editbutton= parameters |
colas@0
   334
|  20 Dec 2003: | Fixed bug where calendar did not work after adding a row (TWiki:Main/PaulineCheung); added all language files of Mishoo DHTML calendar 0.9.5 |
colas@0
   335
|  13 Dec 2003: | Added CHANGEROWS, JSCALENDARDATEFORMAT, JSCALENDARLANGUAGE, JSCALENDAROPTIONS settings |
colas@0
   336
|  16 Oct 2003: | small typo fixed (garbled if ---<nop>+ header on top) |
colas@0
   337
|  15 Oct 2003: | new date field type with javascript calendar - CN |
colas@0
   338
|  14 Oct 2003: | docfix: the documentation page was an old one - CN |
colas@0
   339
|  13 Oct 2003: | bugfix: %-vars in select were resetted to first on add/del row - CN |
colas@0
   340
|  18 Sep 2003: | incompatibility: changed default of =changerows= to =on=; support for %-vars, Quiet save for saving without notification; all other fixes in Dev topic integrated - CN |
colas@0
   341
|  08 Nov 2002: | Prevent variable expansion in label text; added escape characters |
colas@0
   342
|  27 Jun 2002: | New =helptopic= parameter |
colas@0
   343
|  26 Jun 2002: | Support for variables in included EDITTABLE parameters; fixed problem with HTML in cells |
colas@0
   344
|  21 May 2002: | Added fixed label format; new =changerows="add"= parameter |
colas@0
   345
|  27 Apr 2002: | Fixed bug where text after a double quote in a cell disappeared |
colas@0
   346
|  18 Apr 2002: | Fixed bug where table was breaking when pasting multiple lines into an edit field using Netscape on Unix |
colas@0
   347
|  08 Apr 2002: | Check for change permission and edit lock of topic |
colas@0
   348
|  05 Apr 2002: | Initial version |
colas@0
   349
|  Dependencies: | None |
colas@0
   350
|  Perl Version: | 5.0 |
colas@0
   351
|  TWiki:Plugins/Benchmark: | %TWIKIWEB%.GoodStyle 98%, %TWIKIWEB%.FormattedSearch 98%, %TOPIC% 95% |
colas@0
   352
|  Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
colas@0
   353
|  Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |
colas@0
   354
|  Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal |
colas@0
   355
colas@0
   356
__Related Topics:__  %TWIKIWEB%.VarEDITTABLE, %TWIKIWEB%.TWikiPreferences, %TWIKIWEB%.TWikiPlugins
colas@0
   357
colas@0
   358
-- TWiki:Main/PeterThoeny - 07 Oct 2007
colas@0
   359
colas@0
   360
%META:FILEATTACHMENT{name="EditTablePluginCalendarExample.gif" attr="h" comment="" date="1071283396" path="EditTablePluginCalendarExample.gif" size="7823" user="TWikiContributor" version="1.1"}%
colas@0
   361
%META:FILEATTACHMENT{name="ScreenshotEditCell1.gif" attr="h" comment="Screenshot" date="1077050633" path="ScreenshotEditCell1.gif" size="2017" user="TWikiContributor" version="1.1"}%
colas@0
   362
%META:FILEATTACHMENT{name="ScreenshotEditCell2.gif" attr="h" comment="Screenshot" date="1077050702" path="ScreenshotEditCell2.gif" size="3199" user="TWikiContributor" version="1.1"}%
colas@0
   363
%META:FILEATTACHMENT{name="img.gif" attr="h" comment="Component of Mishoo DHTML calendar" date="1077813483" path="img.gif" size="145" user="TWikiContributor" version="1.1"}%
colas@0
   364
%META:FILEATTACHMENT{name="menuarrow.gif" attr="h" comment="Component of Mishoo DHTML calendar" date="1077813470" path="menuarrow.gif" size="68" user="TWikiContributor" version="1.1"}%
colas@0
   365
%META:FILEATTACHMENT{name="edittable.gif" attr="h" comment="Edit table image button" date="1077933805" path="edittable.gif" size="298" user="TWikiContributor" version="1.1"}%
colas@0
   366
%META:FILEATTACHMENT{name="btn_move.gif" attr="h" comment="Javascript button: move row" date="1077933805" path="btn_move.gif" size="298" user="TWikiContributor" version="1.1"}%
colas@0
   367
%META:FILEATTACHMENT{name="btn_target.gif" attr="h" comment="Javascript button: move target (animated)" date="1077933805" path="btn_target.gif" size="298" user="TWikiContributor" version="1.1"}%
colas@0
   368
%META:FILEATTACHMENT{name="btn_delete.gif" attr="h" comment="Javascript button: delete row" date="1077933805" path="btn_delete.gif" size="298" user="TWikiContributor" version="1.1"}%
colas@0
   369
%META:FILEATTACHMENT{name="btn_delete_disabled.gif" attr="h" comment="Javascript button: delete (disabled)" date="1077933805" path="btn_delete_disabled.gif" size="298" user="TWikiContributor" version="1.1"}%
colas@0
   370
%META:FILEATTACHMENT{name="edittable.css" attr="h" comment="Plugin Style Sheet" date="1077933805" path="edittable.css" size="298" user="TWikiContributor" version="1.1"}%
colas@0
   371
%META:FILEATTACHMENT{name="edittable.js" attr="h" comment="Javascript for table editing without page refresh" date="1077933805" path="edittable.js" size="298" user="TWikiContributor" version="1.1"}%
colas@0
   372
@
colas@0
   373
colas@0
   374
colas@0
   375
1.13
colas@0
   376
log
colas@0
   377
@buildrelease
colas@0
   378
@
colas@0
   379
text
colas@0
   380
@d1 1
colas@0
   381
a1 1
colas@0
   382
%META:TOPICINFO{author="TWikiContributor" date="1166056779" format="1.0" version="13"}%
colas@0
   383
d4 7
colas@0
   384
a10 1
colas@0
   385
This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an *[&nbsp;Edit&nbsp;table&nbsp;]* button if preceeded by an =%<nop>EDITTABLE{...}%= variable. Each column can be a text field, a drop down box, a date field, etc. Multiple tables per topic are editable, but only one at a time can be edited.
colas@0
   386
d16 25
colas@0
   387
a40 1
colas@0
   388
Add a =%<nop>EDITTABLE{...}%= variable just before an existing table to make it editable, or add the variable anywhere in a topic to start a new table. Parameters:
colas@0
   389
a41 18
colas@0
   390
| *Parameter* | *Comment* | *Default* |
colas@0
   391
| =header= | Specify the header format of a new table like ="&#124;*Food*&#124;*Drink*&#124;"=. Useful to start a table with only a button | (no header) |
colas@0
   392
| =format= | The format of one column when editing the table. A cell can be a text input field, or any of these edit field types:%BR% &#8226; Text input field (1 line):%BR% &nbsp; =&#124; text, &lt;size&gt;, &lt;initial value&gt; &#124;= %BR% &#8226; Textarea input field:%BR% &nbsp; =&#124; textarea, &lt;rows&gt;x&lt;columns&gt;, &lt;initial value&gt; &#124;= %BR% &#8226; Drop down box: %BR% &nbsp; =&#124; select, &lt;size&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc*<nop> &#124;= %BR% &nbsp; =*= only one item can be selected %BR% &#8226; Radio buttons: %BR% &nbsp; =&#124; radio, &lt;size*&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= %BR% &nbsp; =*= size indicates the number of buttons per line in edit mode %BR% &#8226; Checkboxes: %BR% &nbsp; =&#124; checkbox, &lt;size*&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= %BR% &nbsp; =*= size indicates the number of checkboxes per line in edit mode  %BR% &#8226; Fixed label: %BR% &nbsp; =&#124; label, 0, &lt;label text&gt; &#124;= %BR% &#8226; Row number: %BR% &nbsp; =&#124; row, &lt;offset&gt; &#124;= %BR% &#8226; Date: %BR% &nbsp; =&#124; date, &lt;size&gt;, &lt;initial value&gt;, &lt;DHTML date format&gt; &#124;= %BR% &nbsp; =*= see [[%PUBURL%/%TWIKIWEB%/JSCalendarContrib/doc/html/reference.html][Mishoo documentation]] for more infos about the DHTML date format | ="text, 16"= %BR% for all cells |
colas@0
   393
| =changerows= | Rows can be added and removed if ="on"=;<br /> Rows can be added but not removed if ="add"= | =CHANGEROWS= %BR% Plugin setting |
colas@0
   394
| =quietsave= | Quiet Save button is shown if ="on"=, hidden if ="off"= | =QUIETSAVE= %BR% Plugin setting |
colas@0
   395
| =include= | Other topic defining the EDITTABLE parameters. The first %<nop>EDITTABLE% in the topic is used. This is useful if you have many topics with the same table format and you want to update the format in one place. | (none) |
colas@0
   396
| =helptopic= | Topic name containing help text shown below the table when editing a table. The %<nop>STARTINCLUDE% and %<nop>STOPINCLUDE% variables can be used in the topic to specify what is shown. | (no help text) |
colas@0
   397
| =headerislabel= | Table header cells are read-only (labels) if ="on"=; header cells can be edited if ="off"= or "0" | ="on"= |
colas@0
   398
| =editbutton= | Set edit button text, e.g. ="Edit this table"=; set button image with alt text, e.g. ="Edit table, %<nop>PUBURL%/%<nop>TWIKIWEB%/TWikiDocGraphics/edittopic.gif"=; hide edit button at the end of the table with ="hide"= (Note: Button is automatically hidden if an edit button is present in a cell) | =EDITBUTTON= %BR% Plugin setting |
colas@0
   399
colas@0
   400
---+++ Initial Values
colas@0
   401
colas@0
   402
By default, variables in =&lt;initial value&gt;= (of text input field) and =&lt;label text&gt;= (of fixed label) get expanded when a new row is added. This can be used for example to add a timestamp to a label. You can escape characters if you do not want that:
colas@0
   403
| *Text:* | *To Escape:* |
colas@0
   404
| =$quot= | Double quote (="=). Alternatively write =\"= to escape it |
colas@0
   405
| =$percnt= | Percent sign (=%=) |
colas@0
   406
| =$dollar= | Dollar sign (=$=) |
colas@0
   407
| =$nop= or =$nop()= | Is a "no operation" |
colas@0
   408
d43 1
colas@0
   409
d46 3
colas@0
   410
a48 2
colas@0
   411
<img src="%ATTACHURLPATH%/EditTablePluginCalendarExample.gif" alt="Edit Table Calendar Example" width="549" height="210" align="left"  />
colas@0
   412
The =date= field type allows one to choose a date with a popup calendar. Popup calendar works for Netscape 6.0 or better, all other Gecko-based browsers, Internet Explorer 5.0 or better for Windows, Opera 7 and Konqueror 3.1.2. The =...= button is inactive if the browser cannot support the popup calendar. It uses the nice [[http://dynarch.com/mishoo/calendar.epl][Mishoo DHTML calendar]], see also TWiki:Codev/JavaScriptDatePickerForForm <br clear="all">
colas@0
   413
d62 11
colas@0
   414
a72 8
colas@0
   415
	* In page view mode:
colas@0
   416
		* <input type="submit" name="et"	value="Edit table" onclick="return(false);" /> - turn the table into edit mode
colas@0
   417
	* In edit mode:
colas@0
   418
		* <input type="submit" name="etsave"	value="Save table"  onclick="return(false);" /> - save your changes
colas@0
   419
		* <input type="submit" name="etqsave"	value="Quiet save"  onclick="return(false);" /> - save your changes without alerting subscribed WebNotify users
colas@0
   420
		* <input type="submit" name="etaddrow" value="Add row" onclick="return(false);" /> - add row to the table (if enabled)
colas@0
   421
		* <input type="submit" name="etdelrow" value="Delete last row" onclick="return(false);" /> - remove last row from the table (if enabled)
colas@0
   422
		* <input type="submit" name="etcancel" value="Cancel" onclick="return(false);" /> - cancel without saving and release edit lock
colas@0
   423
d87 35
colas@0
   424
a121 12
colas@0
   425
<form>
colas@0
   426
<table border="1" cellspacing="1" cellpadding="0">
colas@0
   427
<tr><th bgcolor="#99CCCC"> Nr </th><th bgcolor="#99CCCC"> Text field </th><th bgcolor="#99CCCC"> Drop down </th><th bgcolor="#99CCCC"> Mood </th><th bgcolor="#99CCCC"> Timestamp </th></tr>
colas@0
   428
<tr><td  bgcolor="#FFFFFF"> 1<input type="hidden" name="etcell2x1" value="1" />  </td><td  bgcolor="#FFFFFF"> <input type="text" name="etcell2x2" size="20" value="hello table" />  </td><td  bgcolor="#FFFFFF"> <select name="etcell2x3" size="1"> <option selected="selected">one</option> <option>two</option> <option>three</option> <option>four</option> </select>  </td><td bgcolor="#FFFFFF"> <input type="radio" name="etcell2x4" value=":-)" checked="checked" /> <img src="%PUBURLPATH%/%WEB%/SmiliesPlugin/smile.gif" alt="smile" title="smile" border="0" /> <input type="radio" name="etcell2x4" value=":-I" /> <img src="%PUBURLPATH%/%WEB%/SmiliesPlugin/indifferent.gif" alt="indifferent" title="indifferent" border="0" /> <input type="radio" name="etcell2x4" value=":-(" /> <img src="%PUBURLPATH%/%WEB%/SmiliesPlugin/frown.gif" alt="frown" title="frown" border="0" /> </td><td  bgcolor="#FFFFFF"> 26 Jun 2002 12:30<input type="hidden" name="etcell2x5" value="26 Jun 2002 12:30" />  </td></tr>
colas@0
   429
<tr><td  bgcolor="#FFFF99"> 2<input type="hidden" name="etcell3x1" value="2" />  </td><td  bgcolor="#FFFF99"> <input type="text" name="etcell3x2" size="20" value="" />  </td><td  bgcolor="#FFFF99"> <select name="etcell3x3" size="1"> <option>one</option> <option selected="selected">two</option> <option>three</option> <option>four</option> </select>  </td><td bgcolor="#FFFF99"> <input type="radio" name="etcell2x4" value=":-)" /> <img src="%PUBURLPATH%/%WEB%/SmiliesPlugin/smile.gif" alt="smile" title="smile" border="0" /> <input type="radio" name="etcell2x4" value=":-I" /> <img src="%PUBURLPATH%/%WEB%/SmiliesPlugin/indifferent.gif" alt="indifferent" title="indifferent" border="0" /> <input type="radio" name="etcell2x4" value=":-(" checked="checked" /> <img src="%PUBURLPATH%/%WEB%/SmiliesPlugin/frown.gif" alt="frown" title="frown" border="0" /> </td><td  bgcolor="#FFFF99"> 27 Jun 2002 12:40<input type="hidden" name="etcell3x5" value="27 Jun 2002 12:40" />  </td></tr>
colas@0
   430
</table>
colas@0
   431
<input type="submit" name="etsave"	value="Save table" onclick="return(false);" />
colas@0
   432
<input type="submit" name="etqsave"	value="Quiet save"  onclick="return(false);" />
colas@0
   433
<input type="submit" name="etaddrow" value="Add row" onclick="return(false);" />
colas@0
   434
<input type="submit" name="etdelrow" value="Delete last row" onclick="return(false);" />
colas@0
   435
<input type="submit" name="etcancel" value="Cancel" onclick="return(false);" /> (demo only, these buttons do not work)
colas@0
   436
</form>
colas@0
   437
d125 3
colas@0
   438
a127 1
colas@0
   439
<table><tr><td valign="top">
colas@0
   440
d129 12
colas@0
   441
a140 2
colas@0
   442
<pre>
colas@0
   443
%<nop>EDITTABLE{ format="| label | text, 40 |" }%
colas@0
   444
d143 2
colas@0
   445
a144 2
colas@0
   446
| Gender: | M %<nop>EDITCELL{select, 1, , F, M}% |
colas@0
   447
| DOB: | 1999/12/31 %<nop>EDITCELL{date, 10}% |
colas@0
   448
d146 9
colas@0
   449
a154 8
colas@0
   450
</pre>
colas@0
   451
</td><td valign="top">
colas@0
   452
Screenshot:
colas@0
   453
<img src="%ATTACHURLPATH%/ScreenshotEditCell1.gif" alt="EDITCELL Example in view mode" width="149" height="141" />
colas@0
   454
</td><td valign="top">
colas@0
   455
Screenshot in edit mode:
colas@0
   456
<img src="%ATTACHURLPATH%/ScreenshotEditCell2.gif" alt="EDITCELL Example in edit mode" width="276" height="164" />
colas@0
   457
</td></tr></table>
colas@0
   458
d161 2
colas@0
   459
a162 2
colas@0
   460
	* One line description, shown in the %TWIKIWEB%.TextFormattingRules topic:
colas@0
   461
		* Set SHORTDESCRIPTION = Edit TWiki tables using edit fields, date pickers and drop down boxes
colas@0
   462
d164 2
colas@0
   463
a165 2
colas@0
   464
	* Set DEBUG to 1 to get debug messages in =data/debug.txt=.  Default: =0=
colas@0
   465
		* Set DEBUG = 0
colas@0
   466
d167 22
colas@0
   467
a188 2
colas@0
   468
	* Default for change rows flag: =on=, =off=, =add=
colas@0
   469
		* Set CHANGEROWS = on
colas@0
   470
d190 1
colas@0
   471
a190 2
colas@0
   472
	* Default flag for quiet save option: =on= to show the Quiet Save button, =off= to hide
colas@0
   473
		* Set QUIETSAVE = on
colas@0
   474
d192 6
colas@0
   475
a197 3
colas@0
   476
	* Default edit button: Specify =button text=, or specify =alternate text, image URL=
colas@0
   477
		* #Set EDITBUTTON = Edit table
colas@0
   478
		* Set EDITBUTTON = Edit this table, %ATTACHURL%/edittable.gif
colas@0
   479
a198 1
colas@0
   480
__Note:__ The Plugin uses base settings like date format, language and style from the JSCalendarContrib.
colas@0
   481
a199 1
colas@0
   482
---++ Limitations and Known Issues
colas@0
   483
d201 12
colas@0
   484
a212 29
colas@0
   485
	* This Plugin does not support TWiki table formatting like Multi-span cells (e.g. =| ... ||=) and cell justification (e.g. =|  centered  |	right |=)
colas@0
   486
	* There is a performance issue when editing a large table, say, with more then 50 rows
colas@0
   487
	* Variables like =%<nop>ATTACHURL%= get expanded unless they are in a label
colas@0
   488
	* You cannot put two =%<nop>EDITTABLE{}%= statements on the same line in the source
colas@0
   489
	* You can include %-vars now in select values, by quoting them with &lt;nop&gt;, as in %&lt;nop&gt;X% for %<nop>X%, say for instance:
colas@0
   490
	  <br /> =select,1,%&lt;nop&gt;X%,%&lt;nop&gt;Y%=
colas@0
   491
colas@0
   492
---++ Plugin Installation Instructions
colas@0
   493
colas@0
   494
__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
   495
colas@0
   496
	* Download the ZIP file from the Plugin web (see below)
colas@0
   497
	* Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
colas@0
   498
	  | *File:* | *Description:* |
colas@0
   499
	  | ==data/TWiki/%TOPIC%.txt== | Plugin topic |
colas@0
   500
	  | ==data/TWiki/%TOPIC%.txt,v== | Plugin topic repository |
colas@0
   501
	  | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
colas@0
   502
	  | ==pub/TWiki/%TOPIC%/edittable.gif== | Edit table button image |
colas@0
   503
	  | ==pub/TWiki/%TOPIC%/*.gif== | Screenshots and  Mishoo DHTML calendar images |
colas@0
   504
	  | ==pub/TWiki/%TOPIC%/README== | Mishoo DHTML calendar README |
colas@0
   505
	  | ==pub/TWiki/%TOPIC%/release-notes.html== | Mishoo DHTML calendar release notes |
colas@0
   506
	  | ==pub/TWiki/%TOPIC%/*.js== | Mishoo DHTML calendar <nop>JavaScript files |
colas@0
   507
	  | ==pub/TWiki/%TOPIC%/calendar-system.css== | Mishoo DHTML calendar stylesheet |
colas@0
   508
	* The Plugin depends on the =viewauth= script to authenticate the user. As described in %TWIKIWEB%.TWikiAccessControl, copy the =view= script to =viewauth= (or better, create a symbolic link) and add =viewauth= to the list of authenticated scripts in the =.htaccess= file. 
colas@0
   509
	* The Mishoo DHTML calendar 0.9.5 is preinstalled and should work without any configuration. If you wish to use another language, specify the in the Plugin settings, or create a new language files, attach it to the Plugin topic, and change the Plugin settings
colas@0
   510
	* (Dakar) Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section.
colas@0
   511
	* Test if the Plugin is correctly installed:
colas@0
   512
		* Check above example if there is an *[&nbsp;Edit&nbsp;table&nbsp;]* button below the table in above example
colas@0
   513
		* Click on *[&nbsp;Edit&nbsp;table&nbsp;]*, make changes and save the table
colas@0
   514
d216 1
colas@0
   515
a216 2
colas@0
   516
	* The Edit Table Plugin is released under the [[http://www.gnu.org/licenses/gpl.html][GPL]]
colas@0
   517
	* The [[http://dynarch.com/mishoo/calendar.epl][Mishoo DHTML calendar]] bundled with this Plugin was created by Mihai Bazon and is released under the [[http://www.gnu.org/licenses/lgpl.html][LGPL]] -- thanks Mihai for the great tool :-)
colas@0
   518
d221 2
colas@0
   519
a222 2
colas@0
   520
|  Plugin Author: | [[http://www.structuredwikis.com/][Peter Thoeny]] |
colas@0
   521
|  Copyright: | &copy; 2002-2006, TWiki:Main.PeterThoeny |
colas@0
   522
d224 1
colas@0
   523
a224 1
colas@0
   524
|  Plugin Version: | 12327 |
colas@0
   525
d226 8
colas@0
   526
d239 1
colas@0
   527
a239 1
colas@0
   528
|  16 Sep 2004: | Added radio buttons and checkbox controls; escaped "&#124;" pipe symbol found in input fields to preserve tables |
colas@0
   529
d268 1
colas@0
   530
a268 1
colas@0
   531
__Related Topics:__ %TWIKIWEB%.TWikiPreferences, %TWIKIWEB%.TWikiPlugins
colas@0
   532
d270 1
colas@0
   533
a270 1
colas@0
   534
-- TWiki:Main/PeterThoeny - 02 Oct 2006
colas@0
   535
d272 12
colas@0
   536
a283 6
colas@0
   537
%META:FILEATTACHMENT{name="EditTablePluginCalendarExample.gif" attr="h" comment="" date="1071283396" path="EditTablePluginCalendarExample.gif" size="7823" user="PeterThoeny" version="1.1"}%
colas@0
   538
%META:FILEATTACHMENT{name="ScreenshotEditCell1.gif" attr="h" comment="Screenshot" date="1077050633" path="ScreenshotEditCell1.gif" size="2017" user="PeterThoeny" version="1.1"}%
colas@0
   539
%META:FILEATTACHMENT{name="ScreenshotEditCell2.gif" attr="h" comment="Screenshot" date="1077050702" path="ScreenshotEditCell2.gif" size="3199" user="PeterThoeny" version="1.1"}%
colas@0
   540
%META:FILEATTACHMENT{name="img.gif" attr="h" comment="Component of Mishoo DHTML calendar" date="1077813483" path="img.gif" size="145" user="PeterThoeny" version="1.1"}%
colas@0
   541
%META:FILEATTACHMENT{name="menuarrow.gif" attr="h" comment="Component of Mishoo DHTML calendar" date="1077813470" path="menuarrow.gif" size="68" user="PeterThoeny" version="1.1"}%
colas@0
   542
%META:FILEATTACHMENT{name="edittable.gif" attr="h" comment="Edit table image button" date="1077933805" path="edittable.gif" size="298" user="PeterThoeny" version="1.1"}%
colas@0
   543
@
colas@0
   544
colas@0
   545
colas@0
   546
1.12
colas@0
   547
log
colas@0
   548
@buildrelease
colas@0
   549
@
colas@0
   550
text
colas@0
   551
@d1 1
colas@0
   552
a1 1
colas@0
   553
%META:TOPICINFO{author="TWikiContributor" date="1159840454" format="1.0" version="12"}%
colas@0
   554
d14 1
colas@0
   555
a14 1
colas@0
   556
| =format= | The format of one column when editing the table. A cell can be a text input field, or any of these edit field types:%BR% &#8226; Text input field (1 line):%BR% &nbsp; =&#124; text, &lt;size&gt;, &lt;initial value&gt; &#124;= %BR% &#8226; Textarea input field:%BR% &nbsp; =&#124; textarea, &lt;rows&gt;x&lt;columns&gt;, &lt;initial value&gt; &#124;= %BR% &#8226; Drop down box: %BR% &nbsp; =&#124; select, &lt;size&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= %BR% &#8226; Radio buttons: %BR% &nbsp; =&#124; radio, &lt;size*&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= %BR% &nbsp; =*= size indicates the number of buttons per line in edit mode %BR% &#8226; Checkboxes: %BR% &nbsp; =&#124; checkbox, &lt;size*&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= %BR% &nbsp; =*= size indicates the number of checkboxes per line in edit mode  %BR% &#8226; Fixed label: %BR% &nbsp; =&#124; label, 0, &lt;label text&gt; &#124;= %BR% &#8226; Row number: %BR% &nbsp; =&#124; row, &lt;offset&gt; &#124;= %BR% &#8226; Date: %BR% &nbsp; =&#124; date, &lt;size&gt;, &lt;initial value&gt;, &lt;DHTML date format&gt; &#124;= %BR% &nbsp; =*= see [[%PUBURL%/%TWIKIWEB%/JSCalendarContrib/doc/html/reference.html][Mishoo documentation]] for more infos about the DHTML date format | ="text, 16"= %BR% for all cells |
colas@0
   557
d169 1
colas@0
   558
a169 1
colas@0
   559
|  Plugin Version: | 11706 |
colas@0
   560
@
colas@0
   561
colas@0
   562
colas@0
   563
1.11
colas@0
   564
log
colas@0
   565
@buildrelease
colas@0
   566
@
colas@0
   567
text
colas@0
   568
@d1 1
colas@0
   569
a1 1
colas@0
   570
%META:TOPICINFO{author="TWikiContributor" date="1095385227" format="1.0" version="11"}%
colas@0
   571
d124 1
colas@0
   572
a124 1
colas@0
   573
__Note:__ The Plugin uses base settings like language and style from the JSCalendarContrib. The standard date format is '%e %B %Y' and is defined within this plugin.
colas@0
   574
d153 1
colas@0
   575
d166 4
colas@0
   576
a169 2
colas@0
   577
|  Plugin Author: | TWiki:Main/PeterThoeny |
colas@0
   578
|  Plugin Version: | 9598 |
colas@0
   579
d171 4
colas@0
   580
d203 1
colas@0
   581
d207 1
colas@0
   582
a207 1
colas@0
   583
-- TWiki:Main/PeterThoeny - 16 Sep 2004
colas@0
   584
d212 2
colas@0
   585
a213 2
colas@0
   586
%META:FILEATTACHMENT{name="img.gif" attr="h" comment="Component of Mishoo DHTML calendar" date="1077813483" path="C:\Data\Temp\img.gif" size="145" user="PeterThoeny" version="1.1"}%
colas@0
   587
%META:FILEATTACHMENT{name="menuarrow.gif" attr="h" comment="Component of Mishoo DHTML calendar" date="1077813470" path="C:\Data\Temp\menuarrow.gif" size="68" user="PeterThoeny" version="1.1"}%
colas@0
   588
@
colas@0
   589
colas@0
   590
colas@0
   591
1.10
colas@0
   592
log
colas@0
   593
@buildrelease
colas@0
   594
@
colas@0
   595
text
colas@0
   596
@d1 1
colas@0
   597
a1 1
colas@0
   598
%META:TOPICINFO{author="PeterThoeny" date="1095385227" format="1.0" version="10"}%
colas@0
   599
d14 1
colas@0
   600
a14 1
colas@0
   601
| =format= | The format of one column when editing the table. A cell can be a text input field, or any of these edit field types:%BR% &#8226; Text input field (1 line):%BR% &nbsp; =&#124; text, &lt;size&gt;, &lt;initial value&gt; &#124;= %BR% &#8226; Textarea input field:%BR% &nbsp; =&#124; textarea, &lt;rows&gt;x&lt;columns&gt;, &lt;initial value&gt; &#124;= %BR% &#8226; Drop down box: %BR% &nbsp; =&#124; select, &lt;size&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= %BR% &#8226; Radio buttons: %BR% &nbsp; =&#124; radio, &lt;size*&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= %BR% &nbsp; =*= size indicates the number of buttons per line in edit mode %BR% &#8226; Checkboxes: %BR% &nbsp; =&#124; checkbox, &lt;size*&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= %BR% &nbsp; =*= size indicates the number of checkboxes per line in edit mode  %BR% &#8226; Fixed label: %BR% &nbsp; =&#124; label, 0, &lt;label text&gt; &#124;= %BR% &#8226; Row number: %BR% &nbsp; =&#124; row, &lt;offset&gt; &#124;= %BR% &#8226; Date: %BR% &nbsp; =&#124; date, &lt;size&gt;, &lt;initial value&gt;, &lt;DHTML date format&gt; &#124;= | ="text, 16"= %BR% for all cells |
colas@0
   602
d124 1
colas@0
   603
a124 10
colas@0
   604
	* Date format of [[http://dynarch.com/mishoo/calendar.epl][Mishoo DHTML calendar]]:
colas@0
   605
		* Set JSCALENDARDATEFORMAT = %Y/%m/%d
colas@0
   606
colas@0
   607
	* Language of DHTML calendar, pointing to attached =calendar-&lt;code&gt;.js= language file: =en=, =af=, =br=, =ca=, =cs-win=, =da=, =de=, =du=, =el=, =es=, =fr=, =hr=, =hr-utf8=, =hu=, =it=, =jp=, =nl=, =no=, =pl=, =pt=, =ro=, =ru=, =sk=, =sp=, =sv=, =tr=, =zh=
colas@0
   608
		* Set JSCALENDARLANGUAGE = en
colas@0
   609
colas@0
   610
	* Additional options of DHTML calendar:
colas@0
   611
		* Set JSCALENDAROPTIONS = 
colas@0
   612
colas@0
   613
__Note:__ The Plugin looks for the =JSCALENDAR*= settings first in the TWiki Preferences, then in above Plugin settings
colas@0
   614
d166 1
colas@0
   615
a166 1
colas@0
   616
|  Plugin Version: | 8670 |
colas@0
   617
@
colas@0
   618
colas@0
   619
colas@0
   620
1.9
colas@0
   621
log
colas@0
   622
@none
colas@0
   623
@
colas@0
   624
text
colas@0
   625
@d1 1
colas@0
   626
a1 1
colas@0
   627
%META:TOPICINFO{author="PeterThoeny" date="1091425534" format="1.0" version="1.9"}%
colas@0
   628
d14 1
colas@0
   629
a14 1
colas@0
   630
| =format= | The format of one column when editing the table. A cell can be a text input field, or any of these edit field types:%BR% - Text input field (1 line):%BR% &nbsp; =&#124; text, &lt;size&gt;, &lt;initial value&gt; &#124;= %BR% - Textarea input field:%BR% &nbsp; =&#124; textarea, &lt;rows&gt;x&lt;columns&gt;, &lt;initial value&gt; &#124;= %BR% - Drop down box: %BR% &nbsp; =&#124; select, &lt;size&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= %BR% - Fixed label: %BR% &nbsp; =&#124; label, 0, &lt;label text&gt; &#124;= %BR% - Row number: %BR% &nbsp; =&#124; row, &lt;offset&gt; &#124;= %BR% - Date: %BR% &nbsp; =&#124; date, &lt;size&gt;, &lt;initial value&gt;, &lt;DHTML date format&gt; &#124;= | ="text, 16"= %BR% for all cells |
colas@0
   631
d60 5
colas@0
   632
a64 5
colas@0
   633
Line before table: =%<nop>EDITTABLE{ header="|*Nr*|*Text field sandbox*|*Drop down sandbox*|*Timestamp*|" format="| row, -1 | text, 20, init | select, 1, one, two, three, four | label, 0, %<nop>SERVERTIME{"$day $mon $year $hour:$min"}% |" changerows="on" }%=
colas@0
   634
%EDITTABLE{ header="|*Nr*|*Text field sandbox*|*Drop down sandbox*|*Timestamp*|" format="| row, -1 | text, 20, init | select, 1, one, two, three, four | label, 0, %SERVERTIME{"$day $mon $year $hour:$min"}% |" changerows="on" }%
colas@0
   635
|*Nr*|*Text field sandbox*|*Drop down sandbox*|*Timestamp*|
colas@0
   636
| 1 | hello table | one | 26 Jun 2002 12:30 |
colas@0
   637
| 2 |  | two | 27 Jun 2002 12:40 |
colas@0
   638
d66 1
colas@0
   639
a66 1
colas@0
   640
%RED% __Note:__ Please use TWiki:Sandbox.EditTablePluginTesting if you want to try out this Plugin %ENDCOLOR%
colas@0
   641
d72 3
colas@0
   642
a74 3
colas@0
   643
<tr><th bgcolor="#99CCCC"> Nr </th><th bgcolor="#99CCCC"> Text field sandbox </th><th bgcolor="#99CCCC"> Drop down sandbox </th><th bgcolor="#99CCCC"> Timestamp </th></tr>
colas@0
   644
<tr><td  bgcolor="#FFFFFF"> 1<input type="hidden" name="etcell2x1" value="1" />  </td><td  bgcolor="#FFFFFF"> <input type="text" name="etcell2x2" size="20" value="hello table" />  </td><td  bgcolor="#FFFFFF"> <select name="etcell2x3" size="1"> <option selected="selected">one</option> <option>two</option> <option>three</option> <option>four</option> </select>  </td><td  bgcolor="#FFFFFF"> 26 Jun 2002 12:30<input type="hidden" name="etcell2x4" value="26 Jun 2002 12:30" />  </td></tr>
colas@0
   645
<tr><td  bgcolor="#FFFF99"> 2<input type="hidden" name="etcell3x1" value="2" />  </td><td  bgcolor="#FFFF99"> <input type="text" name="etcell3x2" size="20" value="" />  </td><td  bgcolor="#FFFF99"> <select name="etcell3x3" size="1"> <option>one</option> <option selected="selected">two</option> <option>three</option> <option>four</option> </select>  </td><td  bgcolor="#FFFF99"> 27 Jun 2002 12:40<input type="hidden" name="etcell3x4" value="27 Jun 2002 12:40" />  </td></tr>
colas@0
   646
d175 1
colas@0
   647
a175 1
colas@0
   648
|  Plugin Version: | 01 Aug 2004 |
colas@0
   649
d177 2
colas@0
   650
d200 1
colas@0
   651
a200 2
colas@0
   652
|  CPAN Dependencies: | none |
colas@0
   653
|  Other Dependencies: | [[http://dynarch.com/mishoo/calendar.epl][Mishoo DHTML calendar]] (version 0.9.5 preinstalled); TWiki version 01 Feb 2003 or later |
colas@0
   654
d208 1
colas@0
   655
a208 1
colas@0
   656
-- TWiki:Main/PeterThoeny - 01 Aug 2004
colas@0
   657
d210 6
colas@0
   658
a215 38
colas@0
   659
%META:FILEATTACHMENT{name="EditTablePluginCalendarExample.gif" attr="h" comment="Screenshot" date="1078005196" path="C:\Data\Temp\EditTablePluginCalendarExample.gif" size="7823" user="PeterThoeny" version="1.1"}%
colas@0
   660
%META:FILEATTACHMENT{name="README" attr="h" comment="Component of Mishoo DHTML calendar" date="1071361959" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\README" size="823" user="PeterThoeny" version="1.1"}%
colas@0
   661
%META:FILEATTACHMENT{name="release-notes.html" attr="h" comment="Component of Mishoo DHTML calendar" date="1071361968" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\release-notes.html" size="10593" user="PeterThoeny" version="1.1"}%
colas@0
   662
%META:FILEATTACHMENT{name="calendar.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071361980" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar.js" size="45484" user="PeterThoeny" version="1.1"}%
colas@0
   663
%META:FILEATTACHMENT{name="calendar-setup.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071361988" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-setup.js" size="7244" user="PeterThoeny" version="1.1"}%
colas@0
   664
%META:FILEATTACHMENT{name="calendar-system.css" attr="h" comment="Component of Mishoo DHTML calendar" date="1071361999" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-system.css" size="5506" user="PeterThoeny" version="1.1"}%
colas@0
   665
%META:FILEATTACHMENT{name="calendar-en.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071362008" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-en.js" size="3151" user="PeterThoeny" version="1.1"}%
colas@0
   666
%META:FILEATTACHMENT{name="calendar-fr.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071362034" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-fr.js" size="1148" user="PeterThoeny" version="1.1"}%
colas@0
   667
%META:FILEATTACHMENT{name="calendar-es.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071362044" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-es.js" size="3365" user="PeterThoeny" version="1.1"}%
colas@0
   668
%META:FILEATTACHMENT{name="calendar-de.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071362054" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-de.js" size="2493" user="PeterThoeny" version="1.1"}%
colas@0
   669
%META:FILEATTACHMENT{name="calendar-jp.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071362064" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-jp.js" size="908" user="PeterThoeny" version="1.1"}%
colas@0
   670
%META:FILEATTACHMENT{name="calendar-pt.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071362076" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-pt.js" size="1131" user="PeterThoeny" version="1.1"}%
colas@0
   671
%META:FILEATTACHMENT{name="calendar-ru.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071362089" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-ru.js" size="1144" user="PeterThoeny" version="1.1"}%
colas@0
   672
%META:FILEATTACHMENT{name="calendar-af.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904035" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-af.js" size="1011" user="PeterThoeny" version="1.1"}%
colas@0
   673
%META:FILEATTACHMENT{name="calendar-br.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904042" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-br.js" size="1112" user="PeterThoeny" version="1.1"}%
colas@0
   674
%META:FILEATTACHMENT{name="calendar-ca.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904050" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-ca.js" size="1148" user="PeterThoeny" version="1.1"}%
colas@0
   675
%META:FILEATTACHMENT{name="calendar-cs-win.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904063" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-cs-win.js" size="1351" user="PeterThoeny" version="1.1"}%
colas@0
   676
%META:FILEATTACHMENT{name="calendar-da.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904073" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-da.js" size="1086" user="PeterThoeny" version="1.1"}%
colas@0
   677
%META:FILEATTACHMENT{name="calendar-du.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904083" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-du.js" size="1143" user="PeterThoeny" version="1.1"}%
colas@0
   678
%META:FILEATTACHMENT{name="calendar-el.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904093" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-el.js" size="1237" user="PeterThoeny" version="1.1"}%
colas@0
   679
%META:FILEATTACHMENT{name="calendar-hr.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904102" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-hr.js" size="3088" user="PeterThoeny" version="1.1"}%
colas@0
   680
%META:FILEATTACHMENT{name="calendar-hr-utf8.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904114" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-hr-utf8.js" size="1553" user="PeterThoeny" version="1.1"}%
colas@0
   681
%META:FILEATTACHMENT{name="calendar-hu.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904128" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-hu.js" size="1171" user="PeterThoeny" version="1.1"}%
colas@0
   682
%META:FILEATTACHMENT{name="calendar-it.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904135" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-it.js" size="2111" user="PeterThoeny" version="1.1"}%
colas@0
   683
%META:FILEATTACHMENT{name="calendar-nl.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904142" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-nl.js" size="1157" user="PeterThoeny" version="1.1"}%
colas@0
   684
%META:FILEATTACHMENT{name="calendar-no.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904149" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-no.js" size="1084" user="PeterThoeny" version="1.1"}%
colas@0
   685
%META:FILEATTACHMENT{name="calendar-pl.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904156" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-pl.js" size="1252" user="PeterThoeny" version="1.1"}%
colas@0
   686
%META:FILEATTACHMENT{name="calendar-ro.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904164" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-ro.js" size="2016" user="PeterThoeny" version="1.1"}%
colas@0
   687
%META:FILEATTACHMENT{name="calendar-sk.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904174" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-sk.js" size="2636" user="PeterThoeny" version="1.1"}%
colas@0
   688
%META:FILEATTACHMENT{name="calendar-sp.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904181" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-sp.js" size="1111" user="PeterThoeny" version="1.1"}%
colas@0
   689
%META:FILEATTACHMENT{name="calendar-sv.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904189" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-sv.js" size="3177" user="PeterThoeny" version="1.1"}%
colas@0
   690
%META:FILEATTACHMENT{name="calendar-tr.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904199" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-tr.js" size="1736" user="PeterThoeny" version="1.1"}%
colas@0
   691
%META:FILEATTACHMENT{name="calendar-zh.js" attr="h" comment="Component of Mishoo DHTML calendar" date="1071904206" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\calendar-zh.js" size="1058" user="PeterThoeny" version="1.1"}%
colas@0
   692
%META:FILEATTACHMENT{name="ScreenshotEditCell1.gif" attr="h" comment="Screenshot" date="1077169619" path="C:\Data\Temp\ScreenshotEditCell1.gif" size="2017" user="PeterThoeny" version="1.1"}%
colas@0
   693
%META:FILEATTACHMENT{name="ScreenshotEditCell2.gif" attr="h" comment="Screenshot" date="1077169561" path="C:\Data\Temp\ScreenshotEditCell2.gif" size="3199" user="PeterThoeny" version="1.1"}%
colas@0
   694
%META:FILEATTACHMENT{name="img.gif" attr="h" comment="Component of Mishoo DHTML calendar" date="1078005090" path="C:\Data\Temp\img.gif" size="145" user="PeterThoeny" version="1.1"}%
colas@0
   695
%META:FILEATTACHMENT{name="menuarrow.gif" attr="h" comment="Component of Mishoo DHTML calendar" date="1078005104" path="C:\Data\Temp\menuarrow.gif" size="68" user="PeterThoeny" version="1.1"}%
colas@0
   696
%META:FILEATTACHMENT{name="edittable.gif" attr="h" comment="Edit button image" date="1078004977" path="C:\Data\Temp\edittable.gif" size="298" user="PeterThoeny" version="1.1"}%
colas@0
   697
@
colas@0
   698
colas@0
   699
colas@0
   700
1.8
colas@0
   701
log
colas@0
   702
@none
colas@0
   703
@
colas@0
   704
text
colas@0
   705
@d1 1
colas@0
   706
a1 1
colas@0
   707
%META:TOPICINFO{author="PeterThoeny" date="1084087287" format="1.0" version="1.8"}%
colas@0
   708
d49 1
colas@0
   709
a49 1
colas@0
   710
		* <input type="submit" name="et"	value="Edit table" onClick="return(false);" /> - turn the table into edit mode
colas@0
   711
d51 5
colas@0
   712
a55 5
colas@0
   713
		* <input type="submit" name="etsave"	value="Save table"  onClick="return(false);" /> - save your changes
colas@0
   714
		* <input type="submit" name="etqsave"	value="Quiet save"  onClick="return(false);" /> - save your changes without alerting subscribed WebNotify users
colas@0
   715
		* <input type="submit" name="etaddrow" value="Add row" onClick="return(false);" /> - add row to the table (if enabled)
colas@0
   716
		* <input type="submit" name="etdelrow" value="Delete last row" onClick="return(false);" /> - remove last row from the table (if enabled)
colas@0
   717
		* <input type="submit" name="etcancel" value="Cancel" onClick="return(false);" /> - cancel without saving and release edit lock
colas@0
   718
d66 1
colas@0
   719
a66 1
colas@0
   720
__Note:__ Please use TWiki:Sandbox.EditTablePluginTesting if you want to try out this Plugin
colas@0
   721
d68 1
colas@0
   722
a68 1
colas@0
   723
If this plugin is installed you will see an *[&nbsp;Edit&nbsp;table&nbsp;]* button above; when you click on it you get this form:
colas@0
   724
d76 5
colas@0
   725
a80 5
colas@0
   726
<input type="submit" name="etsave"	value="Save table" onClick="return(false);" />
colas@0
   727
<input type="submit" name="etqsave"	value="Quiet save"  onClick="return(false);" />
colas@0
   728
<input type="submit" name="etaddrow" value="Add row" onClick="return(false);" />
colas@0
   729
<input type="submit" name="etdelrow" value="Delete last row" onClick="return(false);" />
colas@0
   730
<input type="submit" name="etcancel" value="Cancel" onClick="return(false);" /> (demo only, these buttons do not work)
colas@0
   731
a136 1
colas@0
   732
	* %X% Bug: The Plugin fails if the table is at the very end of the topic (without a new line) Always ensure there is a newline after the table
colas@0
   733
d175 1
colas@0
   734
a175 1
colas@0
   735
|  Plugin Version: | 07 Apr 2004 |
colas@0
   736
d177 1
colas@0
   737
d207 1
colas@0
   738
a207 1
colas@0
   739
-- TWiki:Main/PeterThoeny - 07 Apr 2004
colas@0
   740
@
colas@0
   741
colas@0
   742
colas@0
   743
1.7
colas@0
   744
log
colas@0
   745
@none
colas@0
   746
@
colas@0
   747
text
colas@0
   748
@d1 208
colas@0
   749
a208 207
colas@0
   750
%META:TOPICINFO{author="PeterThoeny" date="1079857314" format="1.0" version="1.7"}%
colas@0
   751
---+!! Edit Table Plugin
colas@0
   752
colas@0
   753
This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an *[&nbsp;Edit&nbsp;table&nbsp;]* button if preceeded by an =%<nop>EDITTABLE{...}%= variable. Each column can be a text field, a drop down box, a date field, etc. Multiple tables per topic are editable, but only one at a time can be edited.
colas@0
   754
colas@0
   755
%TOC%
colas@0
   756
colas@0
   757
---++ Per Table Settings
colas@0
   758
colas@0
   759
Add a =%<nop>EDITTABLE{...}%= variable just before an existing table to make it editable, or add the variable anywhere in a topic to start a new table. Parameters:
colas@0
   760
colas@0
   761
| *Parameter* | *Comment* | *Default* |
colas@0
   762
| =header= | Specify the header format of a new table like ="&#124;*Food*&#124;*Drink*&#124;"=. Useful to start a table with only a button | (no header) |
colas@0
   763
| =format= | The format of one column when editing the table. A cell can be a text input field, or any of these edit field types:%BR% - Text input field (1 line):%BR% &nbsp; =&#124; text, &lt;size&gt;, &lt;initial value&gt; &#124;= %BR% - Textarea input field:%BR% &nbsp; =&#124; textarea, &lt;rows&gt;x&lt;columns&gt;, &lt;initial value&gt; &#124;= %BR% - Drop down box: %BR% &nbsp; =&#124; select, &lt;size&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= %BR% - Fixed label: %BR% &nbsp; =&#124; label, 0, &lt;label text&gt; &#124;= %BR% - Row number: %BR% &nbsp; =&#124; row, &lt;offset&gt; &#124;= %BR% - Date: %BR% &nbsp; =&#124; date, &lt;size&gt;, &lt;initial value&gt;, &lt;DHTML date format&gt; &#124;= | ="text, 16"= %BR% for all cells |
colas@0
   764
| =changerows= | Rows can be added and removed if ="on"=;<br /> Rows can be added but not removed if ="add"= | =CHANGEROWS= %BR% Plugin setting |
colas@0
   765
| =quietsave= | Quiet Save button is shown if ="on"=, hidden if ="off"= | =QUIETSAVE= %BR% Plugin setting |
colas@0
   766
| =include= | Other topic defining the EDITTABLE parameters. The first %<nop>EDITTABLE% in the topic is used. This is useful if you have many topics with the same table format and you want to update the format in one place. | (none) |
colas@0
   767
| =helptopic= | Topic name containing help text shown below the table when editing a table. The %<nop>STARTINCLUDE% and %<nop>STOPINCLUDE% variables can be used in the topic to specify what is shown. | (no help text) |
colas@0
   768
| =headerislabel= | Table header cells are read-only (labels) if ="on"=; header cells can be edited if ="off"= or "0" | ="on"= |
colas@0
   769
| =editbutton= | Set edit button text, e.g. ="Edit this table"=; set button image with alt text, e.g. ="Edit table, %<nop>PUBURL%/%<nop>TWIKIWEB%/TWikiDocGraphics/edittopic.gif"=; hide edit button at the end of the table with ="hide"= (Note: Button is automatically hidden if an edit button is present in a cell) | =EDITBUTTON= %BR% Plugin setting |
colas@0
   770
colas@0
   771
---+++ Initial Values
colas@0
   772
colas@0
   773
By default, variables in =&lt;initial value&gt;= (of text input field) and =&lt;label text&gt;= (of fixed label) get expanded when a new row is added. This can be used for example to add a timestamp to a label. You can escape characters if you do not want that:
colas@0
   774
| *Text:* | *To Escape:* |
colas@0
   775
| =$quot= | Double quote (="=). Alternatively write =\"= to escape it |
colas@0
   776
| =$percnt= | Percent sign (=%=) |
colas@0
   777
| =$dollar= | Dollar sign (=$=) |
colas@0
   778
| =$nop= or =$nop()= | Is a "no operation" |
colas@0
   779
colas@0
   780
---+++ Date Field Type
colas@0
   781
colas@0
   782
<img src="%ATTACHURLPATH%/EditTablePluginCalendarExample.gif" alt="Edit Table Calendar Example" width="549" height="210" align="left"  />
colas@0
   783
The =date= field type allows one to choose a date with a popup calendar. Popup calendar works for Netscape 6.0 or better, all other Gecko-based browsers, Internet Explorer 5.0 or better for Windows, Opera 7 and Konqueror 3.1.2. The =...= button is inactive if the browser cannot support the popup calendar. It uses the nice [[http://dynarch.com/mishoo/calendar.epl][Mishoo DHTML calendar]], see also TWiki:Codev/JavaScriptDatePickerForForm <br clear="all">
colas@0
   784
colas@0
   785
colas@0
   786
---++ Per Cell Settings
colas@0
   787
colas@0
   788
An individual edit field type can be defined for each table cell. Place an =%<nop>EDITCELL{ "type, ..." }%= variable at the end of the cell content. This is useful to override the per column =%<nop>EDITTABLE{ format="..." }%= settings, or to create tables with key/value rows. All edit field types of the =format="..."= parameter are supported. For example, to define a text field, type: =| cell content %<nop>EDITCELL{ "text, 20" }% |=
colas@0
   789
colas@0
   790
It is also possible to place the edit button inside a cell instead of default location below the table. Type =| %<nop>EDITCELL{ "editbutton, 1, Edit this table" }% |= to show a button, or =| %<nop>EDITCELL{ "editbutton, 1, Edit table, Image-URL" }% |= to show a button image with alternate text.
colas@0
   791
colas@0
   792
__Note:__ The =%<nop>EDITCELL{ }%=variable cannot be used by itself; place an =%<nop>EDITTABLE{ }%=variable at the beginning of a table where you want to use =%<nop>EDITCELL{ }%= variables.
colas@0
   793
colas@0
   794
---++ Table Buttons
colas@0
   795
colas@0
   796
<form>
colas@0
   797
	* In page view mode:
colas@0
   798
		* <input type="submit" name="et"	value="Edit table" onClick="return(false);" /> - turn the table into edit mode
colas@0
   799
	* In edit mode:
colas@0
   800
		* <input type="submit" name="etsave"	value="Save table"  onClick="return(false);" /> - save your changes
colas@0
   801
		* <input type="submit" name="etqsave"	value="Quiet save"  onClick="return(false);" /> - save your changes without alerting subscribed WebNotify users
colas@0
   802
		* <input type="submit" name="etaddrow" value="Add row" onClick="return(false);" /> - add row to the table (if enabled)
colas@0
   803
		* <input type="submit" name="etdelrow" value="Delete last row" onClick="return(false);" /> - remove last row from the table (if enabled)
colas@0
   804
		* <input type="submit" name="etcancel" value="Cancel" onClick="return(false);" /> - cancel without saving and release edit lock
colas@0
   805
</form>
colas@0
   806
colas@0
   807
---++ Examples
colas@0
   808
colas@0
   809
Line before table: =%<nop>EDITTABLE{ header="|*Nr*|*Text field sandbox*|*Drop down sandbox*|*Timestamp*|" format="| row, -1 | text, 20, init | select, 1, one, two, three, four | label, 0, %<nop>SERVERTIME{"$day $mon $year $hour:$min"}% |" changerows="on" }%=
colas@0
   810
%EDITTABLE{ header="|*Nr*|*Text field sandbox*|*Drop down sandbox*|*Timestamp*|" format="| row, -1 | text, 20, init | select, 1, one, two, three, four | label, 0, %SERVERTIME{"$day $mon $year $hour:$min"}% |" changerows="on" }%
colas@0
   811
|*Nr*|*Text field sandbox*|*Drop down sandbox*|*Timestamp*|
colas@0
   812
| 1 | hello table | one | 26 Jun 2002 12:30 |
colas@0
   813
| 2 |  | two | 27 Jun 2002 12:40 |
colas@0
   814
colas@0
   815
If this plugin is installed you will see an *[&nbsp;Edit&nbsp;table&nbsp;]* button above; when you click on it you get this form:
colas@0
   816
colas@0
   817
<form>
colas@0
   818
<table border="1" cellspacing="1" cellpadding="0">
colas@0
   819
<tr><th bgcolor="#99CCCC"> Nr </th><th bgcolor="#99CCCC"> Text field sandbox </th><th bgcolor="#99CCCC"> Drop down sandbox </th><th bgcolor="#99CCCC"> Timestamp </th></tr>
colas@0
   820
<tr><td  bgcolor="#FFFFFF"> 1<input type="hidden" name="etcell2x1" value="1" />  </td><td  bgcolor="#FFFFFF"> <input type="text" name="etcell2x2" size="20" value="hello table" />  </td><td  bgcolor="#FFFFFF"> <select name="etcell2x3" size="1"> <option selected="selected">one</option> <option>two</option> <option>three</option> <option>four</option> </select>  </td><td  bgcolor="#FFFFFF"> 26 Jun 2002 12:30<input type="hidden" name="etcell2x4" value="26 Jun 2002 12:30" />  </td></tr>
colas@0
   821
<tr><td  bgcolor="#FFFF99"> 2<input type="hidden" name="etcell3x1" value="2" />  </td><td  bgcolor="#FFFF99"> <input type="text" name="etcell3x2" size="20" value="" />  </td><td  bgcolor="#FFFF99"> <select name="etcell3x3" size="1"> <option>one</option> <option selected="selected">two</option> <option>three</option> <option>four</option> </select>  </td><td  bgcolor="#FFFF99"> 27 Jun 2002 12:40<input type="hidden" name="etcell3x4" value="27 Jun 2002 12:40" />  </td></tr>
colas@0
   822
</table>
colas@0
   823
<input type="submit" name="etsave"	value="Save table" onClick="return(false);" />
colas@0
   824
<input type="submit" name="etqsave"	value="Quiet save"  onClick="return(false);" />
colas@0
   825
<input type="submit" name="etaddrow" value="Add row" onClick="return(false);" />
colas@0
   826
<input type="submit" name="etdelrow" value="Delete last row" onClick="return(false);" />
colas@0
   827
<input type="submit" name="etcancel" value="Cancel" onClick="return(false);" /> (demo only, these buttons do not work)
colas@0
   828
</form>
colas@0
   829
colas@0
   830
The following example shows a simple table with key/value rows. The default edit field type for the value column is a text field. This is overloaded by a selector for the Gender, and a date picker for the DOB. This is typically used by TWiki applications where new topics with tables are created based on a template topic.
colas@0
   831
colas@0
   832
<table><tr><td valign="top">
colas@0
   833
You type:
colas@0
   834
<pre>
colas@0
   835
%<nop>EDITTABLE{ format="| label | text, 40 |" }%
colas@0
   836
|*Key*|*Value*|
colas@0
   837
| Name: | John Smith |
colas@0
   838
| Gender: | M %<nop>EDITCELL{select, 1, , F, M}% |
colas@0
   839
| DOB: | 1999/12/31 %<nop>EDITCELL{date, 10}% |
colas@0
   840
| City: | New York |
colas@0
   841
</pre>
colas@0
   842
</td><td valign="top">
colas@0
   843
Screenshot:
colas@0
   844
<img src="%ATTACHURLPATH%/ScreenshotEditCell1.gif" alt="EDITCELL Example in view mode" width="149" height="141" />
colas@0
   845
</td><td valign="top">
colas@0
   846
Screenshot in edit mode:
colas@0
   847
<img src="%ATTACHURLPATH%/ScreenshotEditCell2.gif" alt="EDITCELL Example in edit mode" width="276" height="164" />
colas@0
   848
</td></tr></table>
colas@0
   849
colas@0
   850
---++ Plugin Settings
colas@0
   851
colas@0
   852
Plugin settings are stored as preferences variables. To reference
colas@0
   853
a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, for example, ==%<nop>EDITTABLEPLUGIN_SHORTDESCRIPTION%==
colas@0
   854
colas@0
   855
	* One line description, shown in the %TWIKIWEB%.TextFormattingRules topic:
colas@0
   856
		* Set SHORTDESCRIPTION = Edit TWiki tables using edit fields, date pickers and drop down boxes
colas@0
   857
colas@0
   858
	* Set DEBUG to 1 to get debug messages in =data/debug.txt=.  Default: =0=
colas@0
   859
		* Set DEBUG = 0
colas@0
   860
colas@0
   861
	* Default for change rows flag: =on=, =off=, =add=
colas@0
   862
		* Set CHANGEROWS = on
colas@0
   863
colas@0
   864
	* Default flag for quiet save option: =on= to show the Quiet Save button, =off= to hide
colas@0
   865
		* Set QUIETSAVE = on
colas@0
   866
colas@0
   867
	* Default edit button: Specify =button text=, or specify =alternate text, image URL=
colas@0
   868
		* #Set EDITBUTTON = Edit table
colas@0
   869
		* Set EDITBUTTON = Edit this table, %ATTACHURL%/edittable.gif
colas@0
   870
colas@0
   871
	* Date format of [[http://dynarch.com/mishoo/calendar.epl][Mishoo DHTML calendar]]:
colas@0
   872
		* Set JSCALENDARDATEFORMAT = %Y/%m/%d
colas@0
   873
colas@0
   874
	* Language of DHTML calendar, pointing to attached =calendar-&lt;code&gt;.js= language file: =en=, =af=, =br=, =ca=, =cs-win=, =da=, =de=, =du=, =el=, =es=, =fr=, =hr=, =hr-utf8=, =hu=, =it=, =jp=, =nl=, =no=, =pl=, =pt=, =ro=, =ru=, =sk=, =sp=, =sv=, =tr=, =zh=
colas@0
   875
		* Set JSCALENDARLANGUAGE = en
colas@0
   876
colas@0
   877
	* Additional options of DHTML calendar:
colas@0
   878
		* Set JSCALENDAROPTIONS = 
colas@0
   879
colas@0
   880
__Note:__ The Plugin looks for the =JSCALENDAR*= settings first in the TWiki Preferences, then in above Plugin settings
colas@0
   881
colas@0
   882
---++ Limitations and Known Issues
colas@0
   883
colas@0
   884
	* This Plugin does not support TWiki table formatting like Multi-span cells (e.g. =| ... ||=) and cell justification (e.g. =|  centered  |	right |=).
colas@0
   885
	* There is a performance issue when editing a large table, say, with more then 50 rows.
colas@0
   886
	* The Plugin fails if the table is at the very end of the topic
colas@0
   887
	  (without a new line) Always ensure there is a newline after the table
colas@0
   888
	* Variables like =%<nop>ATTACHURL%= get expanded unless they are in a label.
colas@0
   889
	* You cannot put two %<nop>EDITTABLE% statements on the same line
colas@0
   890
	  in the source.
colas@0
   891
	* You can include %-vars now in select values, by quoting them with
colas@0
   892
	  &lt;nop&gt;, as in %&lt;nop&gt;X% for %<nop>X%, say for instance:
colas@0
   893
	  <br /> =select,1,%&lt;nop&gt;X%,%&lt;nop&gt;Y%=
colas@0
   894
colas@0
   895
---++ Plugin Installation Instructions
colas@0
   896
colas@0
   897
__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
   898
colas@0
   899
	* Download the ZIP file from the Plugin web (see below)
colas@0
   900
	* Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
colas@0
   901
	  | *File:* | *Description:* |
colas@0
   902
	  | ==data/TWiki/%TOPIC%.txt== | Plugin topic |
colas@0
   903
	  | ==data/TWiki/%TOPIC%.txt,v== | Plugin topic repository |
colas@0
   904
	  | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
colas@0
   905
	  | ==pub/TWiki/%TOPIC%/edittable.gif== | Edit table button image |
colas@0
   906
	  | ==pub/TWiki/%TOPIC%/*.gif== | Screenshots and  Mishoo DHTML calendar images |
colas@0
   907
	  | ==pub/TWiki/%TOPIC%/README== | Mishoo DHTML calendar README |
colas@0
   908
	  | ==pub/TWiki/%TOPIC%/release-notes.html== | Mishoo DHTML calendar release notes |
colas@0
   909
	  | ==pub/TWiki/%TOPIC%/*.js== | Mishoo DHTML calendar <nop>JavaScript files |
colas@0
   910
	  | ==pub/TWiki/%TOPIC%/calendar-system.css== | Mishoo DHTML calendar stylesheet |
colas@0
   911
	* The Plugin depends on the =viewauth= script to authenticate the user. As described in %TWIKIWEB%.TWikiAccessControl, copy the =view= script to =viewauth= (or better, create a symbolic link) and add =viewauth= to the list of authenticated scripts in the =.htaccess= file. 
colas@0
   912
	* The Mishoo DHTML calendar 0.9.5 is preinstalled and should work without any configuration. If you wish to use another language, specify the in the Plugin settings, or create a new language files, attach it to the Plugin topic, and change the Plugin settings
colas@0
   913
	* Test if the Plugin is correctly installed:
colas@0
   914
		* Check above example if there is an *[&nbsp;Edit&nbsp;table&nbsp;]* button below the table in above example
colas@0
   915
		* Click on *[&nbsp;Edit&nbsp;table&nbsp;]*, make changes and save the table
colas@0
   916
colas@0
   917
---++ License
colas@0
   918
colas@0
   919
	* The Edit Table Plugin is released under the [[http://www.gnu.org/licenses/gpl.html][GPL]]
colas@0
   920
	* The [[http://dynarch.com/mishoo/calendar.epl][Mishoo DHTML calendar]] bundled with this Plugin was created by Mihai Bazon and is released under the [[http://www.gnu.org/licenses/lgpl.html][LGPL]] -- thanks Mihai for the great tool :-)
colas@0
   921
colas@0
   922
colas@0
   923
---++ Plugin Info
colas@0
   924
colas@0
   925
|  Plugin Author: | TWiki:Main/PeterThoeny |
colas@0
   926
|  Plugin Version: | 02 Mar 2004 |
colas@0
   927
|  Change History: | <!-- specify latest version first -->&nbsp; |
colas@0
   928
|  02 Mar 2004: | Default for =%<nop>EDITCELL{editbutton}%= is EDITBUTTON preference |
colas@0
   929
|  27 Feb 2004: | Added QUIETSAVE setting and =quietsave= parameter; image for Edit button |
colas@0
   930
|  18 Feb 2004: | Doc fixes; allow edit button anywhere in a cell not just at the end of a cell |
colas@0
   931
|  17 Feb 2004: | Added per cell definition of edit field types with =%<nop>EDITCELL{}%= variable; added =headerislabel= and =editbutton= parameters |
colas@0
   932
|  20 Dec 2003: | Fixed bug where calendar did not work after adding a row (TWiki:Main/PaulineCheung); added all language files of Mishoo DHTML calendar 0.9.5 |
colas@0
   933
|  13 Dec 2003: | Added CHANGEROWS, JSCALENDARDATEFORMAT, JSCALENDARLANGUAGE, JSCALENDAROPTIONS settings |
colas@0
   934
|  16 Oct 2003: | small typo fixed (garbled if ---<nop>+ header on top) |
colas@0
   935
|  15 Oct 2003: | new date field type with javascript calendar - CN |
colas@0
   936
|  14 Oct 2003: | docfix: the documentation page was an old one - CN |
colas@0
   937
|  13 Oct 2003: | bugfix: %-vars in select were resetted to first on add/del row - CN |
colas@0
   938
|  18 Sep 2003: | incompatibility: changed default of =changerows= to =on=; support for %-vars, Quiet save for saving without notification; all other fixes in Dev topic integrated - CN |
colas@0
   939
|  08 Nov 2002: | Prevent variable expansion in label text; added escape characters |
colas@0
   940
|  27 Jun 2002: | New =helptopic= parameter |
colas@0
   941
|  26 Jun 2002: | Support for variables in included EDITTABLE parameters; fixed problem with HTML in cells |
colas@0
   942
|  21 May 2002: | Added fixed label format; new =changerows="add"= parameter |
colas@0
   943
|  27 Apr 2002: | Fixed bug where text after a double quote in a cell disappeared |
colas@0
   944
|  18 Apr 2002: | Fixed bug where table was breaking when pasting multiple lines into an edit field using Netscape on Unix |
colas@0
   945
|  08 Apr 2002: | Check for change permission and edit lock of topic |
colas@0
   946
|  05 Apr 2002: | Initial version |
colas@0
   947
|  CPAN Dependencies: | none |
colas@0
   948
|  Other Dependencies: | [[http://dynarch.com/mishoo/calendar.epl][Mishoo DHTML calendar]] (version 0.9.5 preinstalled); TWiki version 01 Feb 2003 or later |
colas@0
   949
|  Perl Version: | 5.0 |
colas@0
   950
|  TWiki:Plugins/Benchmark: | %TWIKIWEB%.GoodStyle 98%, %TWIKIWEB%.FormattedSearch 98%, %TOPIC% 95% |
colas@0
   951
|  Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
colas@0
   952
|  Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |
colas@0
   953
colas@0
   954
__Related Topics:__ %TWIKIWEB%.TWikiPreferences, %TWIKIWEB%.TWikiPlugins
colas@0
   955
colas@0
   956
-- TWiki:Main/PeterThoeny - 02 Mar 2004
colas@0
   957
@
colas@0
   958
colas@0
   959
colas@0
   960
1.6
colas@0
   961
log
colas@0
   962
@none
colas@0
   963
@
colas@0
   964
text
colas@0
   965
@d1 1
colas@0
   966
a1 1
colas@0
   967
%META:TOPICINFO{author="PeterThoeny" date="1078005060" format="1.0" version="1.6"}%
colas@0
   968
d177 1
colas@0
   969
a177 1
colas@0
   970
|  Plugin Version: | 27 Feb 2004 |
colas@0
   971
d179 1
colas@0
   972
d207 1
colas@0
   973
a207 1
colas@0
   974
-- TWiki:Main/PeterThoeny - 27 Feb 2004
colas@0
   975
@
colas@0
   976
colas@0
   977
colas@0
   978
1.5
colas@0
   979
log
colas@0
   980
@none
colas@0
   981
@
colas@0
   982
text
colas@0
   983
@d1 1
colas@0
   984
a1 1
colas@0
   985
%META:TOPICINFO{author="PeterThoeny" date="1077169680" format="1.0" version="1.5"}%
colas@0
   986
d16 1
colas@0
   987
d115 6
colas@0
   988
a120 2
colas@0
   989
	* Default text for edit button:
colas@0
   990
		* Set EDITBUTTON = Edit table
colas@0
   991
a152 1
colas@0
   992
	  | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
colas@0
   993
d155 3
colas@0
   994
a157 1
colas@0
   995
	  | ==pub/TWiki/%TOPIC%/*.gif== | Screenshots |
colas@0
   996
d177 1
colas@0
   997
a177 1
colas@0
   998
|  Plugin Version: | 18 Feb 2004 |
colas@0
   999
d179 1
colas@0
  1000
d206 2
colas@0
  1001
a207 2
colas@0
  1002
-- TWiki:Main/PeterThoeny - 18 Feb 2004
colas@0
  1003
%META:FILEATTACHMENT{name="EditTablePluginCalendarExample.gif" attr="h" comment="Screenshot" date="1071361684" path="C:\Data\MyTWiki\Plugins\EditTablePlugin\pub\TWiki\EditTablePlugin\EditTablePluginCalendarExample.gif" size="7823" user="PeterThoeny" version="1.1"}%
colas@0
  1004
d242 3
colas@0
  1005
@
colas@0
  1006
colas@0
  1007
colas@0
  1008
1.4
colas@0
  1009
log
colas@0
  1010
@none
colas@0
  1011
@
colas@0
  1012
text
colas@0
  1013
@d1 1
colas@0
  1014
a1 1
colas@0
  1015
%META:TOPICINFO{author="PeterThoeny" date="1077016839" format="1.0" version="1.4"}%
colas@0
  1016
d13 1
colas@0
  1017
a13 1
colas@0
  1018
| =header= | Enable static header if ="on"=, e.g. disable editing of the first row;<br /> Else specify the header format of a new table like ="&#124;*Food*&#124;*Drink*&#124;"=. | (no header) |
colas@0
  1019
d19 1
colas@0
  1020
a19 1
colas@0
  1021
| =editbutton= | Set edit button text, e.g. ="Edit this table"=; set button image with alt text, e.g. ="Edit table, %<nop>PUBURL%/%<nop>TWIKIWEB%/TWikiDocGraphics/edittopic.gif"=; hide button, e.g. ="hide"= (Note: Automatically hidden if edit button is present in a cell) | =EDITBUTTON= %BR% Plugin setting |
colas@0
  1022
d38 1
colas@0
  1023
a38 1
colas@0
  1024
The edit field type can be defined for each table cell by placing an =%<nop>EDITCELL{ "type, ..." }%= variable after the cell content. This is useful to override the per column =%<nop>EDITTABLE{ format="..." }%= settings, or to create tables with key/value rows. All edit field types of the =format="..."= parameter are supported, e.g. to define a text field, type: =| cell content %<nop>EDITCELL{ "text, 20" }% |=
colas@0
  1025
d40 1
colas@0
  1026
a40 1
colas@0
  1027
It is also possible to place the edit button into a cell instead of default location below the table. Type =| %<nop>EDITCELL{ "editbutton, 1, Edit this table" }% |= to show a button, or =| %<nop>EDITCELL{ "editbutton, 1, Edit table, Image-URL" }% |= to show a button image with alternate text.
colas@0
  1028
d42 1
colas@0
  1029
a42 1
colas@0
  1030
__Note:__ The EDITCELL variable cannot be used by itself; place an EDITTABLE variable at the beginning of a table where you want to use EDITCELL variables.
colas@0
  1031
d93 5
colas@0
  1032
a97 7
colas@0
  1033
You get:
colas@0
  1034
%EDITTABLE{ format="| label | text, 40 |" changerows="off" }%
colas@0
  1035
|*Key*|*Value*|
colas@0
  1036
| Name: | John Smith |
colas@0
  1037
| Gender: | M %EDITCELL{select, 1, , F, M}% |
colas@0
  1038
| DOB: | 1999/12/31 %EDITCELL{date, 10}% |
colas@0
  1039
| City: | New York |
colas@0
  1040
d148 1
colas@0
  1041
d151 5
colas@0
  1042
a155 1
colas@0
  1043
	  | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
colas@0
  1044
d171 1
colas@0
  1045
a171 1
colas@0
  1046
|  Plugin Version: | 17 Feb 2004 |
colas@0
  1047
d173 1
colas@0
  1048
d193 1
colas@0
  1049
d199 1
colas@0
  1050
a199 1
colas@0
  1051
-- TWiki:Main/PeterThoeny - 17 Feb 2004
colas@0
  1052
d233 2
colas@0
  1053
@
colas@0
  1054
colas@0
  1055
colas@0
  1056
1.3
colas@0
  1057
log
colas@0
  1058
@none
colas@0
  1059
@
colas@0
  1060
text
colas@0
  1061
@d1 1
colas@0
  1062
a1 1
colas@0
  1063
%META:TOPICINFO{author="PeterThoeny" date="1071906420" format="1.0" version="1.3"}%
colas@0
  1064
d4 1
colas@0
  1065
a4 1
colas@0
  1066
This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an *[&nbsp;Edit&nbsp;table&nbsp;]* button if preceeded by an =%<nop>EDITTABLE{...}%= variable. Each column can be a text field, a drop down box or a row number. Multiple tables per topic are editable, but only one at a time can be edited.
colas@0
  1067
d14 1
colas@0
  1068
a14 1
colas@0
  1069
| =format= | The format of one row when editing the table. A cell can be a text input field, a drop down box, a fixed label, or a row number. Cell definitions:%BR% - Text input field (1 line):%BR% &nbsp; =&#124; text, &lt;size&gt;, &lt;initial value&gt; &#124;= %BR% - Textarea input field:%BR% &nbsp; =&#124; textarea, &lt;rows&gt;x&lt;columns&gt;, &lt;initial value&gt; &#124;= %BR% - Drop down box: %BR% &nbsp; =&#124; select, &lt;size&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= %BR% - Fixed label: %BR% &nbsp; =&#124; label, 0, &lt;label text&gt; &#124;= %BR% - Row number: %BR% &nbsp; =&#124; row, &lt;offset&gt; &#124;= %BR% - Date: %BR% &nbsp; =&#124; date, &lt;size&gt;, &lt;initial value&gt;, &lt;DHTML date format&gt; &#124;= | ="text, 16"= %BR% for all cells |
colas@0
  1070
d18 2
colas@0
  1071
d21 3
colas@0
  1072
a23 1
colas@0
  1073
__Note:__ By default, variables in =&lt;initial value&gt;= (of text input field) and =&lt;label text&gt;= (of fixed label) get expanded when a new row is added. This can be used for example to add a timestamp to a label. You can escape characters if you do not want that:
colas@0
  1074
d30 14
colas@0
  1075
d80 1
colas@0
  1076
a80 1
colas@0
  1077
---+++ Date Field Type
colas@0
  1078
d82 19
colas@0
  1079
a100 2
colas@0
  1080
<img src="%ATTACHURLPATH%/EditTablePluginCalendarExample.gif" alt="Edit Table Calendar Example" width="549" height="210" align="left"  />
colas@0
  1081
The =date= field type allows one to choose a date with a popup calendar. Popup calendar works for Netscape 6.0 or better, all other Gecko-based browsers, Internet Explorer 5.0 or better for Windows, Opera 7 and Konqueror 3.1.2. The =...= button is inactive if the browser cannot support the popup calendar. It uses the nice [[http://dynarch.com/mishoo/calendar.epl][Mishoo DHTML calendar]], see also TWiki:Codev/JavaScriptDatePickerForForm <br clear="all">
colas@0
  1082
d108 1
colas@0
  1083
a108 1
colas@0
  1084
		* Set SHORTDESCRIPTION = Edit TWiki tables using edit fields and drop down boxes
colas@0
  1085
d116 3
colas@0
  1086
a136 1
colas@0
  1087
	* %RED% *Warning:* %ENDCOLOR% This plugin uses undocumented functions to read, save and lock a topic. The plugin will likely break in a future TWiki release.
colas@0
  1088
d140 1
colas@0
  1089
a140 1
colas@0
  1090
	  &lt;nop&gt;, as in %&lt;nop&gt;X% for %X%, say for instance:
colas@0
  1091
d153 1
colas@0
  1092
a153 1
colas@0
  1093
	* The plugin depends on the =viewauth= script to authenticate the user. As described in %TWIKIWEB%.TWikiAccessControl, copy the =view= script to =viewauth= (or better, create a symbolic link) and add =viewauth= to the list of authenticated scripts in the =.htaccess= file. 
colas@0
  1094
d168 1
colas@0
  1095
a168 1
colas@0
  1096
|  Plugin Version: | 20 Dec 2003 |
colas@0
  1097
d170 1
colas@0
  1098
d187 1
colas@0
  1099
a187 1
colas@0
  1100
|  Other Dependencies: | [[http://dynarch.com/mishoo/calendar.epl][Mishoo DHTML calendar]] (version 0.9.5 preinstalled) |
colas@0
  1101
d194 1
colas@0
  1102
a194 1
colas@0
  1103
-- TWiki:Main/PeterThoeny - 20 Dec 2003
colas@0
  1104
@
colas@0
  1105
colas@0
  1106
colas@0
  1107
1.2
colas@0
  1108
log
colas@0
  1109
@none
colas@0
  1110
@
colas@0
  1111
text
colas@0
  1112
@d1 1
colas@0
  1113
a1 1
colas@0
  1114
%META:TOPICINFO{author="PeterThoeny" date="1071363180" format="1.0" version="1.2"}%
colas@0
  1115
d84 1
colas@0
  1116
a84 1
colas@0
  1117
	* Language of DHTML calendar, pointing to attached =calendar-&lt;code&gt;.js= language file: =en=, =de=, =es=, =fr=, =jp=
colas@0
  1118
d117 2
colas@0
  1119
a118 2
colas@0
  1120
	* The Mishoo DHTML calendar 0.9.5 is preinstalled and should work without any configuration. If you wish to use another language, attach the language files to the Plugin topic and change the Plugin settings
colas@0
  1121
	* Test if the plugin is correctly installed:
colas@0
  1122
d131 1
colas@0
  1123
a131 1
colas@0
  1124
|  Plugin Version: | 13 Dec 2003 |
colas@0
  1125
d133 1
colas@0
  1126
d156 1
colas@0
  1127
a156 1
colas@0
  1128
-- TWiki:Main/PeterThoeny - 13 Dec 2003
colas@0
  1129
d170 20
colas@0
  1130
@
colas@0
  1131
colas@0
  1132
colas@0
  1133
1.1
colas@0
  1134
log
colas@0
  1135
@none
colas@0
  1136
@
colas@0
  1137
text
colas@0
  1138
@d1 2
colas@0
  1139
a2 2
colas@0
  1140
%META:TOPICINFO{author="PeterThoeny" date="1071217860" format="1.0" version="1.1"}%
colas@0
  1141
<h1>Edit Table Plugin</h1>
colas@0
  1142
d4 1
colas@0
  1143
a4 1
colas@0
  1144
This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an *[&nbsp;Edit&nbsp;table&nbsp;]* button if preceeded by an =%<nop>EDITTABLE{...}%= variable. Each column can be a text field, a drop down box or a row number. Multiple tables per topic can be editable, but only one at a time canbe edited.
colas@0
  1145
d6 1
colas@0
  1146
a6 10
colas@0
  1147
---++ <nop>%TOPIC% Global Settings
colas@0
  1148
colas@0
  1149
Plugin settings are stored as preferences variables. To reference
colas@0
  1150
a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, for example, ==%<nop>INTERWIKIPLUGIN_SHORTDESCRIPTION%==
colas@0
  1151
colas@0
  1152
	* One line description, shown in the %TWIKIWEB%.TextFormattingRules topic:
colas@0
  1153
		* Set SHORTDESCRIPTION = Edit TWiki tables using edit fields and drop down boxes.
colas@0
  1154
colas@0
  1155
	* Set DEBUG to 1 to get debug messages in =data/debug.txt=.  Default: =0=
colas@0
  1156
		* Set DEBUG = 0
colas@0
  1157
d14 2
colas@0
  1158
a15 2
colas@0
  1159
| =format= | The format of one row when editing the table. A cell can be a text input field, a drop down box, a fixed label, or a row number. Cell definitions: <table cellpadding="0" cellspacing="0"><tr><td valign="top">-Text input field (1 line): </td><td> =&#124; text, &lt;size&gt;, &lt;initial value&gt; &#124;= </td></tr><tr><td valign="top">-Textarea input field: </td><td> =&#124; textarea, &lt;rows&gt;x&lt;columns&gt;, &lt;initial value&gt; &#124;= </td></tr><tr><td valign="top">- Drop down box: </td><td> =&#124; select, &lt;size&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc &#124;= </td></tr><tr><td valign="top">- Fixed label: </td><td> =&#124; label, 0, &lt;label text&gt; &#124;= </td></tr><tr><td valign="top">- Row number: </td><td> =&#124; row, &lt;offset&gt; &#124;= </td></tr><tr><td valign="top">- Date: </td><td> =&#124; date, &lt;sizet&gt; &#124;= </td></tr></table>  | ="text, 16"= for all cells |
colas@0
  1160
| =changerows= | Rows can be added and removed if ="on"=;<br /> Rows can be added but not removed if ="add"= | ="on"= |
colas@0
  1161
d26 13
colas@0
  1162
d56 1
colas@0
  1163
a56 1
colas@0
  1164
<input type="submit" name="etqsave"	value="Quietsave"  onClick="return(false);" />
colas@0
  1165
d62 29
colas@0
  1166
a104 6
colas@0
  1167
	* =date= field type for the =format= parameter adds a button popping a javascript 
colas@0
  1168
	  calendar to choose the date
colas@0
  1169
	  on browsers supporting it.
colas@0
  1170
	  It uses the nice *Mishoo DHTML calendar* at http://dynarch.com/mishoo/calendar.epl,
colas@0
  1171
	  that should be included in Cairo release, or see TWiki:Codev/JavaScriptDatePickerForForm
colas@0
  1172
	  for installing it on Beijing Release
colas@0
  1173
d108 2
colas@0
  1174
d117 1
colas@0
  1175
d122 5
colas@0
  1176
d130 2
colas@0
  1177
a131 2
colas@0
  1178
|  Plugin Author: | %TWIKIWEB%.PeterThoeny |
colas@0
  1179
|  Plugin Version: | 16 Oct 2003 |
colas@0
  1180
d133 1
colas@0
  1181
d138 1
colas@0
  1182
a138 1
colas@0
  1183
|  18 Sep 2003: | *incompatibility:* changed default of =changerows= to =on=<br /> support for %-vars, Quietsave for saving without notification, all other fixes in Dev topic integrated - CN |
colas@0
  1184
d148 1
colas@0
  1185
a148 1
colas@0
  1186
|  Other Dependencies: | none |
colas@0
  1187
d155 14
colas@0
  1188
a168 1
colas@0
  1189
-- %TWIKIWEB%.PeterThoeny - 08 Nov 2002
colas@0
  1190
@