<<O>>  Difference Topic EditTablePlugin (r1.9 - 02 Aug 2004 - PeterThoeny)

Edit Table Plugin

This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %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.

Line: 46 to 46

  • In page view mode:
Changed:
<
<
    • - turn the table into edit mode
>
>
    • - turn the table into edit mode

  • In edit mode:
Changed:
<
<
    • - save your changes
    • - save your changes without alerting subscribed WebNotify users
    • - add row to the table (if enabled)
    • - remove last row from the table (if enabled)
    • - cancel without saving and release edit lock
>
>
    • - save your changes
    • - save your changes without alerting subscribed WebNotify users
    • - add row to the table (if enabled)
    • - remove last row from the table (if enabled)
    • - cancel without saving and release edit lock

Examples

Line: 63 to 63

1 hello table one 26 Jun 2002 12:30
2   two 27 Jun 2002 12:40
Changed:
<
<
Note: Please use TWiki:Sandbox.EditTablePluginTesting if you want to try out this Plugin
>
>
Note: Please use TWiki:Sandbox.EditTablePluginTesting if you want to try out this Plugin

Changed:
<
<
If this plugin is installed you will see an [ Edit table ] button above; when you click on it you get this form:
>
>
If this plugin is installed you will see an [ Edit table ] button above; if you were to click on it (please don't, use TWiki:Sandbox.EditTablePluginTesting for testing) you get this form:

Line: 73 to 73

1 26 Jun 2002 12:30
2 27 Jun 2002 12:40
Changed:
<
<
(demo only, these buttons do not work)
>
>
(demo only, these buttons do not work)

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.

Line: 134 to 134

Limitations and Known Issues

Deleted:
<
<
  • ALERT! 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

  • This Plugin does not support TWiki table formatting like Multi-span cells (e.g. | ... ||) and cell justification (e.g. |  centered  |   right |)
  • There is a performance issue when editing a large table, say, with more then 50 rows
  • Variables like %ATTACHURL% get expanded unless they are in a label
Line: 173 to 172

Plugin Info

Plugin Author: TWiki:Main/PeterThoeny
Changed:
<
<
Plugin Version: 07 Apr 2004
>
>
Plugin Version: 01 Aug 2004

Change History: <!-- specify latest version first --> 
Added:
>
>
01 Aug 2004: Fixed bug where edittable did not work if at the end of a topic

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
02 Mar 2004: Default for %EDITCELL{editbutton}% is EDITBUTTON preference
27 Feb 2004: Added QUIETSAVE setting and quietsave parameter; image for Edit button
Line: 204 to 204

Related Topics: TWikiPreferences, TWikiPlugins

Changed:
<
<
-- TWiki:Main/PeterThoeny - 07 Apr 2004
>
>
-- TWiki:Main/PeterThoeny - 01 Aug 2004

META FILEATTACHMENT EditTablePluginCalendarExample?.gif attr="h" comment="Screenshot" date="1078005196" path="C:\Data\Temp\EditTablePluginCalendarExample.gif" size="7823" user="PeterThoeny" version="1.1"
META FILEATTACHMENT 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"
 <<O>>  Difference Topic EditTablePlugin (r1.8 - 09 May 2004 - PeterThoeny)

Edit Table Plugin

This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %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.

Line: 63 to 63

1 hello table one 26 Jun 2002 12:30
2   two 27 Jun 2002 12:40
Added:
>
>
Note: Please use TWiki:Sandbox.EditTablePluginTesting if you want to try out this Plugin

If this plugin is installed you will see an [ Edit table ] button above; when you click on it you get this form:

Line: 132 to 134

Limitations and Known Issues

Changed:
<
<
  • This Plugin does not support TWiki table formatting like Multi-span cells (e.g. | ... ||) and cell justification (e.g. |  centered  |   right |).
  • There is a performance issue when editing a large table, say, with more then 50 rows.
  • 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
  • Variables like %ATTACHURL% get expanded unless they are in a label.
  • You cannot put two %EDITTABLE% statements on the same line in the source.
  • You can include %-vars now in select values, by quoting them with <nop>, as in %<nop>X% for %X%, say for instance:
>
>
  • ALERT! 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
  • This Plugin does not support TWiki table formatting like Multi-span cells (e.g. | ... ||) and cell justification (e.g. |  centered  |   right |)
  • There is a performance issue when editing a large table, say, with more then 50 rows
  • Variables like %ATTACHURL% get expanded unless they are in a label
  • You cannot put two %EDITTABLE{}% statements on the same line in the source
  • You can include %-vars now in select values, by quoting them with <nop>, as in %<nop>X% for %X%, say for instance:


select,1,%<nop>X%,%<nop>Y%

Plugin Installation Instructions

Line: 174 to 173

Plugin Info

Plugin Author: TWiki:Main/PeterThoeny
Changed:
<
<
Plugin Version: 02 Mar 2004
>
>
Plugin Version: 07 Apr 2004

Change History: <!-- specify latest version first --> 
Added:
>
>
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

02 Mar 2004: Default for %EDITCELL{editbutton}% is EDITBUTTON preference
27 Feb 2004: Added QUIETSAVE setting and quietsave parameter; image for Edit button
18 Feb 2004: Doc fixes; allow edit button anywhere in a cell not just at the end of a cell
Line: 204 to 204

Related Topics: TWikiPreferences, TWikiPlugins

Changed:
<
<
-- TWiki:Main/PeterThoeny - 02 Mar 2004
>
>
-- TWiki:Main/PeterThoeny - 07 Apr 2004

META FILEATTACHMENT EditTablePluginCalendarExample?.gif attr="h" comment="Screenshot" date="1078005196" path="C:\Data\Temp\EditTablePluginCalendarExample.gif" size="7823" user="PeterThoeny" version="1.1"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
 <<O>>  Difference Topic EditTablePlugin (r1.7 - 21 Mar 2004 - PeterThoeny)

Edit Table Plugin

This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %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.

Line: 174 to 174

Plugin Info

Plugin Author: TWiki:Main/PeterThoeny
Changed:
<
<
Plugin Version: 27 Feb 2004
>
>
Plugin Version: 02 Mar 2004

Change History: <!-- specify latest version first --> 
Added:
>
>
02 Mar 2004: Default for %EDITCELL{editbutton}% is EDITBUTTON preference

27 Feb 2004: Added QUIETSAVE setting and quietsave parameter; image for Edit button
18 Feb 2004: Doc fixes; allow edit button anywhere in a cell not just at the end of a cell
17 Feb 2004: Added per cell definition of edit field types with %EDITCELL{}% variable; added headerislabel and editbutton parameters
Line: 203 to 204

Related Topics: TWikiPreferences, TWikiPlugins

Changed:
<
<
-- TWiki:Main/PeterThoeny - 27 Feb 2004
>
>
-- TWiki:Main/PeterThoeny - 02 Mar 2004

META FILEATTACHMENT EditTablePluginCalendarExample?.gif attr="h" comment="Screenshot" date="1078005196" path="C:\Data\Temp\EditTablePluginCalendarExample.gif" size="7823" user="PeterThoeny" version="1.1"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
 <<O>>  Difference Topic EditTablePlugin (r1.6 - 28 Feb 2004 - PeterThoeny)

Edit Table Plugin

This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %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.

Line: 13 to 13

header Specify the header format of a new table like "|*Food*|*Drink*|". Useful to start a table with only a button (no header)
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:
- Text input field (1 line):
  | text, <size>, <initial value> |
- Textarea input field:
  | textarea, <rows>x<columns>, <initial value> |
- Drop down box:
  | select, <size>, <option 1>, <option 2>, etc |
- Fixed label:
  | label, 0, <label text> |
- Row number:
  | row, <offset> |
- Date:
  | date, <size>, <initial value>, <DHTML date format> |
"text, 16"
for all cells
changerows Rows can be added and removed if "on";
Rows can be added but not removed if "add"
CHANGEROWS
Plugin setting
Added:
>
>
quietsave Quiet Save button is shown if "on", hidden if "off" QUIETSAVE
Plugin setting

include Other topic defining the EDITTABLE parameters. The first %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)
helptopic Topic name containing help text shown below the table when editing a table. The %STARTINCLUDE% and %STOPINCLUDE% variables can be used in the topic to specify what is shown. (no help text)
headerislabel Table header cells are read-only (labels) if "on"; header cells can be edited if "off" or "0" "on"
Line: 111 to 112

  • Default for change rows flag: on, off, add
    • Set CHANGEROWS = on
Changed:
<
<
  • Default text for edit button:
    • Set EDITBUTTON = Edit table
>
>
  • Default flag for quiet save option: on to show the Quiet Save button, off to hide
    • Set QUIETSAVE = on

  • Default edit button: Specify button text, or specify alternate text, image URL
    • #Set EDITBUTTON = Edit table
    • Set EDITBUTTON = Edit this table, edittable.gif

Line: 145 to 150

  • Download the ZIP file from the Plugin web (see below)
  • Unzip EditTablePlugin.zip in your twiki installation directory. Content:
    File: Description:
Deleted:
<
<
lib/TWiki/Plugins/EditTablePlugin.pm Plugin Perl module

data/TWiki/EditTablePlugin.txt Plugin topic
data/TWiki/EditTablePlugin.txt,v Plugin topic repository
Changed:
<
<
pub/TWiki/EditTablePlugin/*.gif Screenshots
>
>
lib/TWiki/Plugins/EditTablePlugin.pm Plugin Perl module
pub/TWiki/EditTablePlugin/edittable.gif Edit table button image
pub/TWiki/EditTablePlugin/*.gif Screenshots and Mishoo DHTML calendar images

pub/TWiki/EditTablePlugin/README Mishoo DHTML calendar README
pub/TWiki/EditTablePlugin/release-notes.html Mishoo DHTML calendar release notes
pub/TWiki/EditTablePlugin/*.js Mishoo DHTML calendar JavaScript files
Line: 168 to 174

Plugin Info

Plugin Author: TWiki:Main/PeterThoeny
Changed:
<
<
Plugin Version: 18 Feb 2004
>
>
Plugin Version: 27 Feb 2004

Change History: <!-- specify latest version first --> 
Added:
>
>
27 Feb 2004: Added QUIETSAVE setting and quietsave parameter; image for Edit button

18 Feb 2004: Doc fixes; allow edit button anywhere in a cell not just at the end of a cell
17 Feb 2004: Added per cell definition of edit field types with %EDITCELL{}% variable; added headerislabel and editbutton parameters
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
Line: 196 to 203

Related Topics: TWikiPreferences, TWikiPlugins

Changed:
<
<
-- TWiki:Main/PeterThoeny - 18 Feb 2004
META FILEATTACHMENT 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"
>
>
-- TWiki:Main/PeterThoeny - 27 Feb 2004
META FILEATTACHMENT EditTablePluginCalendarExample?.gif attr="h" comment="Screenshot" date="1078005196" path="C:\Data\Temp\EditTablePluginCalendarExample.gif" size="7823" user="PeterThoeny" version="1.1"

META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
Line: 232 to 239

META FILEATTACHMENT 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"
META FILEATTACHMENT ScreenshotEditCell1?.gif attr="h" comment="Screenshot" date="1077169619" path="C:\Data\Temp\ScreenshotEditCell1.gif" size="2017" user="PeterThoeny" version="1.1"
META FILEATTACHMENT ScreenshotEditCell2?.gif attr="h" comment="Screenshot" date="1077169561" path="C:\Data\Temp\ScreenshotEditCell2.gif" size="3199" user="PeterThoeny" version="1.1"
Added:
>
>
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT edittable.gif attr="h" comment="Edit button image" date="1078004977" path="C:\Data\Temp\edittable.gif" size="298" user="PeterThoeny" version="1.1"
 <<O>>  Difference Topic EditTablePlugin (r1.5 - 19 Feb 2004 - PeterThoeny)

Edit Table Plugin

This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %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.

Line: 10 to 10

Add a %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:

Parameter Comment Default
Changed:
<
<
header Enable static header if "on", e.g. disable editing of the first row;
Else specify the header format of a new table like "|*Food*|*Drink*|".
(no header)
>
>
header Specify the header format of a new table like "|*Food*|*Drink*|". Useful to start a table with only a button (no header)

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:
- Text input field (1 line):
  | text, <size>, <initial value> |
- Textarea input field:
  | textarea, <rows>x<columns>, <initial value> |
- Drop down box:
  | select, <size>, <option 1>, <option 2>, etc |
- Fixed label:
  | label, 0, <label text> |
- Row number:
  | row, <offset> |
- Date:
  | date, <size>, <initial value>, <DHTML date format> |
"text, 16"
for all cells
changerows Rows can be added and removed if "on";
Rows can be added but not removed if "add"
CHANGEROWS
Plugin setting
include Other topic defining the EDITTABLE parameters. The first %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)
helptopic Topic name containing help text shown below the table when editing a table. The %STARTINCLUDE% and %STOPINCLUDE% variables can be used in the topic to specify what is shown. (no help text)
headerislabel Table header cells are read-only (labels) if "on"; header cells can be edited if "off" or "0" "on"
Changed:
<
<
editbutton Set edit button text, e.g. "Edit this table"; set button image with alt text, e.g. "Edit table, %PUBURL%/%TWIKIWEB%/TWikiDocGraphics/edittopic.gif"; hide button, e.g. "hide" (Note: Automatically hidden if edit button is present in a cell) EDITBUTTON
Plugin setting
>
>
editbutton Set edit button text, e.g. "Edit this table"; set button image with alt text, e.g. "Edit table, %PUBURL%/%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
Plugin setting

Initial Values

Line: 35 to 35

Per Cell Settings

Changed:
<
<
The edit field type can be defined for each table cell by placing an %EDITCELL{ "type, ..." }% variable after the cell content. This is useful to override the per column %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 %EDITCELL{ "text, 20" }% |
>
>
An individual edit field type can be defined for each table cell. Place an %EDITCELL{ "type, ..." }% variable at the end of the cell content. This is useful to override the per column %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 %EDITCELL{ "text, 20" }% |

Changed:
<
<
It is also possible to place the edit button into a cell instead of default location below the table. Type | %EDITCELL{ "editbutton, 1, Edit this table" }% | to show a button, or | %EDITCELL{ "editbutton, 1, Edit table, Image-URL" }% | to show a button image with alternate text.
>
>
It is also possible to place the edit button inside a cell instead of default location below the table. Type | %EDITCELL{ "editbutton, 1, Edit this table" }% | to show a button, or | %EDITCELL{ "editbutton, 1, Edit table, Image-URL" }% | to show a button image with alternate text.

Changed:
<
<
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.
>
>
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.

Table Buttons

Line: 90 to 90

City: New York
Changed:
<
<
You get:
Key Value
Name: John Smith
Gender: M
DOB: 1999/12/31
City: New York
>
>
Screenshot: EDITCELL Example in view mode
Screenshot in edit mode: EDITCELL Example in edit mode

Plugin Settings

Line: 147 to 145

  • Download the ZIP file from the Plugin web (see below)
  • Unzip EditTablePlugin.zip in your twiki installation directory. Content:
    File: Description:
Added:
>
>
lib/TWiki/Plugins/EditTablePlugin.pm Plugin Perl module

data/TWiki/EditTablePlugin.txt Plugin topic
data/TWiki/EditTablePlugin.txt,v Plugin topic repository
Changed:
<
<
lib/TWiki/Plugins/EditTablePlugin.pm Plugin Perl module
>
>
pub/TWiki/EditTablePlugin/*.gif Screenshots
pub/TWiki/EditTablePlugin/README Mishoo DHTML calendar README
pub/TWiki/EditTablePlugin/release-notes.html Mishoo DHTML calendar release notes
pub/TWiki/EditTablePlugin/*.js Mishoo DHTML calendar JavaScript files
pub/TWiki/EditTablePlugin/calendar-system.css Mishoo DHTML calendar stylesheet

  • The Plugin depends on the viewauth script to authenticate the user. As described in 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.
  • 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
  • Test if the Plugin is correctly installed:
Line: 165 to 168

Plugin Info

Plugin Author: TWiki:Main/PeterThoeny
Changed:
<
<
Plugin Version: 17 Feb 2004
>
>
Plugin Version: 18 Feb 2004

Change History: <!-- specify latest version first --> 
Added:
>
>
18 Feb 2004: Doc fixes; allow edit button anywhere in a cell not just at the end of a cell

17 Feb 2004: Added per cell definition of edit field types with %EDITCELL{}% variable; added headerislabel and editbutton parameters
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
13 Dec 2003: Added CHANGEROWS, JSCALENDARDATEFORMAT, JSCALENDARLANGUAGE, JSCALENDAROPTIONS settings
Line: 186 to 190

CPAN Dependencies: none
Other Dependencies: Mishoo DHTML calendar (version 0.9.5 preinstalled); TWiki version 01 Feb 2003 or later
Perl Version: 5.0
Added:
>
>
TWiki:Plugins/Benchmark: GoodStyle 98%, FormattedSearch 98%, EditTablePlugin 95%

Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/EditTablePlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/EditTablePluginDev

Related Topics: TWikiPreferences, TWikiPlugins

Changed:
<
<
-- TWiki:Main/PeterThoeny - 17 Feb 2004
>
>
-- TWiki:Main/PeterThoeny - 18 Feb 2004

META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
Line: 225 to 230

META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
Added:
>
>
META FILEATTACHMENT ScreenshotEditCell1?.gif attr="h" comment="Screenshot" date="1077169619" path="C:\Data\Temp\ScreenshotEditCell1.gif" size="2017" user="PeterThoeny" version="1.1"
META FILEATTACHMENT ScreenshotEditCell2?.gif attr="h" comment="Screenshot" date="1077169561" path="C:\Data\Temp\ScreenshotEditCell2.gif" size="3199" user="PeterThoeny" version="1.1"
 <<O>>  Difference Topic EditTablePlugin (r1.4 - 17 Feb 2004 - PeterThoeny)

Edit Table Plugin

Changed:
<
<
This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %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.
>
>
This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %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.

TOC: No TOC in "TWiki.EditTablePlugin"

Line: 11 to 11

Parameter Comment Default
header Enable static header if "on", e.g. disable editing of the first row;
Else specify the header format of a new table like "|*Food*|*Drink*|".
(no header)
Changed:
<
<
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:
- Text input field (1 line):
  | text, <size>, <initial value> |
- Textarea input field:
  | textarea, <rows>x<columns>, <initial value> |
- Drop down box:
  | select, <size>, <option 1>, <option 2>, etc |
- Fixed label:
  | label, 0, <label text> |
- Row number:
  | row, <offset> |
- Date:
  | date, <size>, <initial value>, <DHTML date format> |
"text, 16"
for all cells
>
>
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:
- Text input field (1 line):
  | text, <size>, <initial value> |
- Textarea input field:
  | textarea, <rows>x<columns>, <initial value> |
- Drop down box:
  | select, <size>, <option 1>, <option 2>, etc |
- Fixed label:
  | label, 0, <label text> |
- Row number:
  | row, <offset> |
- Date:
  | date, <size>, <initial value>, <DHTML date format> |
"text, 16"
for all cells

changerows Rows can be added and removed if "on";
Rows can be added but not removed if "add"
CHANGEROWS
Plugin setting
include Other topic defining the EDITTABLE parameters. The first %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)
helptopic Topic name containing help text shown below the table when editing a table. The %STARTINCLUDE% and %STOPINCLUDE% variables can be used in the topic to specify what is shown. (no help text)
Added:
>
>
headerislabel Table header cells are read-only (labels) if "on"; header cells can be edited if "off" or "0" "on"
editbutton Set edit button text, e.g. "Edit this table"; set button image with alt text, e.g. "Edit table, %PUBURL%/%TWIKIWEB%/TWikiDocGraphics/edittopic.gif"; hide button, e.g. "hide" (Note: Automatically hidden if edit button is present in a cell) EDITBUTTON
Plugin setting

Changed:
<
<
Note: By default, variables in <initial value> (of text input field) and <label text> (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:
>
>

Initial Values

By default, variables in <initial value> (of text input field) and <label text> (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:


Text: To Escape:
$quot Double quote ("). Alternatively write \" to escape it
$percnt Percent sign (%)
$dollar Dollar sign ($)
$nop or $nop() Is a "no operation"
Added:
>
>

Date Field Type

Edit Table Calendar Example 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 Mishoo DHTML calendar, see also TWiki:Codev/JavaScriptDatePickerForForm

Per Cell Settings

The edit field type can be defined for each table cell by placing an %EDITCELL{ "type, ..." }% variable after the cell content. This is useful to override the per column %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 %EDITCELL{ "text, 20" }% |

It is also possible to place the edit button into a cell instead of default location below the table. Type | %EDITCELL{ "editbutton, 1, Edit this table" }% | to show a button, or | %EDITCELL{ "editbutton, 1, Edit table, Image-URL" }% | to show a button image with alternate text.

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.


Table Buttons

Line: 59 to 77

(demo only, these buttons do not work)
Changed:
<
<

Date Field Type

>
>
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.

Changed:
<
<
Edit Table Calendar Example 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 Mishoo DHTML calendar, see also TWiki:Codev/JavaScriptDatePickerForForm
>
>
You type:
%EDITTABLE{ format="| label | text, 40 |" }%
|*Key*|*Value*|
| Name: | John Smith |
| Gender: | M %EDITCELL{select, 1, , F, M}% |
| DOB: | 1999/12/31 %EDITCELL{date, 10}% |
| City: | New York |
You get:
Key Value
Name: John Smith
Gender: M
DOB: 1999/12/31
City: New York

Plugin Settings

Line: 70 to 105

a plugin setting write %<plugin>_<setting>%, for example, %EDITTABLEPLUGIN_SHORTDESCRIPTION%

Changed:
<
<
    • Set SHORTDESCRIPTION = Edit TWiki tables using edit fields and drop down boxes
>
>
    • Set SHORTDESCRIPTION = Edit TWiki tables using edit fields, date pickers and drop down boxes

  • Set DEBUG to 1 to get debug messages in data/debug.txt. Default: 0
    • Set DEBUG = 0
Line: 78 to 113

  • Default for change rows flag: on, off, add
    • Set CHANGEROWS = on
Added:
>
>
  • Default text for edit button:
    • Set EDITBUTTON = Edit table

Line: 96 to 134

  • 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
  • Variables like %ATTACHURL% get expanded unless they are in a label.
Deleted:
<
<
  • Warning: This plugin uses undocumented functions to read, save and lock a topic. The plugin will likely break in a future TWiki release.

  • You cannot put two %EDITTABLE% statements on the same line in the source.
  • You can include %-vars now in select values, by quoting them with
Changed:
<
<
<nop>, as in %<nop>X% for ALERT!, say for instance:
>
>
<nop>, as in %<nop>X% for %X%, say for instance:


select,1,%<nop>X%,%<nop>Y%

Plugin Installation Instructions

Line: 113 to 150

data/TWiki/EditTablePlugin.txt Plugin topic
data/TWiki/EditTablePlugin.txt,v Plugin topic repository
lib/TWiki/Plugins/EditTablePlugin.pm Plugin Perl module
Changed:
<
<
  • The plugin depends on the viewauth script to authenticate the user. As described in 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.
>
>
  • The Plugin depends on the viewauth script to authenticate the user. As described in 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.

  • 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
  • Test if the Plugin is correctly installed:
    • Check above example if there is an [ Edit table ] button below the table in above example
Line: 128 to 165

Plugin Info

Plugin Author: TWiki:Main/PeterThoeny
Changed:
<
<
Plugin Version: 20 Dec 2003
>
>
Plugin Version: 17 Feb 2004

Change History: <!-- specify latest version first --> 
Added:
>
>
17 Feb 2004: Added per cell definition of edit field types with %EDITCELL{}% variable; added headerislabel and editbutton parameters

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
13 Dec 2003: Added CHANGEROWS, JSCALENDARDATEFORMAT, JSCALENDARLANGUAGE, JSCALENDAROPTIONS settings
16 Oct 2003: small typo fixed (garbled if ---+ header on top)
Line: 146 to 184

08 Apr 2002: Check for change permission and edit lock of topic
05 Apr 2002: Initial version
CPAN Dependencies: none
Changed:
<
<
Other Dependencies: Mishoo DHTML calendar (version 0.9.5 preinstalled)
>
>
Other Dependencies: Mishoo DHTML calendar (version 0.9.5 preinstalled); TWiki version 01 Feb 2003 or later

Perl Version: 5.0
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/EditTablePlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/EditTablePluginDev

Related Topics: TWikiPreferences, TWikiPlugins

Changed:
<
<
-- TWiki:Main/PeterThoeny - 20 Dec 2003
>
>
-- TWiki:Main/PeterThoeny - 17 Feb 2004

META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
 <<O>>  Difference Topic EditTablePlugin (r1.3 - 20 Dec 2003 - PeterThoeny)

Edit Table Plugin

This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %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.

Line: 81 to 81

Changed:
<
<
  • Language of DHTML calendar, pointing to attached calendar-<code>.js language file: en, de, es, fr, jp
>
>
  • Language of DHTML calendar, pointing to attached calendar-<code>.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

    • Set JSCALENDARLANGUAGE = en

  • Additional options of DHTML calendar:
Line: 114 to 114

data/TWiki/EditTablePlugin.txt,v Plugin topic repository
lib/TWiki/Plugins/EditTablePlugin.pm Plugin Perl module
  • The plugin depends on the viewauth script to authenticate the user. As described in 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.
Changed:
<
<
  • 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
  • Test if the plugin is correctly installed:
>
>
  • 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
  • Test if the Plugin is correctly installed:

    • Check above example if there is an [ Edit table ] button below the table in above example
    • Click on [ Edit table ], make changes and save the table
Line: 128 to 128

Plugin Info

Plugin Author: TWiki:Main/PeterThoeny
Changed:
<
<
Plugin Version: 13 Dec 2003
>
>
Plugin Version: 20 Dec 2003

Change History: <!-- specify latest version first --> 
Added:
>
>
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

13 Dec 2003: Added CHANGEROWS, JSCALENDARDATEFORMAT, JSCALENDARLANGUAGE, JSCALENDAROPTIONS settings
16 Oct 2003: small typo fixed (garbled if ---+ header on top)
15 Oct 2003: new date field type with javascript calendar - CN
Line: 152 to 153

Related Topics: TWikiPreferences, TWikiPlugins

Changed:
<
<
-- TWiki:Main/PeterThoeny - 13 Dec 2003
>
>
-- TWiki:Main/PeterThoeny - 20 Dec 2003

META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
Line: 166 to 167

META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
Added:
>
>
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
 <<O>>  Difference Topic EditTablePlugin (r1.2 - 14 Dec 2003 - PeterThoeny)
Changed:
<
<

Edit Table Plugin

>
>

Edit Table Plugin


Changed:
<
<
This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %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.
>
>
This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %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.

Changed:
<
<

EditTablePlugin Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, for example, %INTERWIKIPLUGIN_SHORTDESCRIPTION%

  • One line description, shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Edit TWiki tables using edit fields and drop down boxes.

  • Set DEBUG to 1 to get debug messages in data/debug.txt. Default: 0
    • Set DEBUG = 0
>
>
TOC: No TOC in "TWiki.EditTablePlugin"

Per Table Settings

Line: 20 to 11

Parameter Comment Default
header Enable static header if "on", e.g. disable editing of the first row;
Else specify the header format of a new table like "|*Food*|*Drink*|".
(no header)
Changed:
<
<
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:
-Text input field (1 line): | text, <size>, <initial value> |
-Textarea input field: | textarea, <rows>x<columns>, <initial value> |
- Drop down box: | select, <size>, <option 1>, <option 2>, etc |
- Fixed label: | label, 0, <label text> |
- Row number: | row, <offset> |
- Date: | date, <sizet> |
"text, 16" for all cells
changerows Rows can be added and removed if "on";
Rows can be added but not removed if "add"
"on"
>
>
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:
- Text input field (1 line):
  | text, <size>, <initial value> |
- Textarea input field:
  | textarea, <rows>x<columns>, <initial value> |
- Drop down box:
  | select, <size>, <option 1>, <option 2>, etc |
- Fixed label:
  | label, 0, <label text> |
- Row number:
  | row, <offset> |
- Date:
  | date, <size>, <initial value>, <DHTML date format> |
"text, 16"
for all cells
changerows Rows can be added and removed if "on";
Rows can be added but not removed if "add"
CHANGEROWS
Plugin setting

include Other topic defining the EDITTABLE parameters. The first %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)
helptopic Topic name containing help text shown below the table when editing a table. The %STARTINCLUDE% and %STOPINCLUDE% variables can be used in the topic to specify what is shown. (no help text)
Line: 32 to 23

$dollar Dollar sign ($)
$nop or $nop() Is a "no operation"
Added:
>
>

Table Buttons

  • In page view mode:
    • - turn the table into edit mode
  • In edit mode:
    • - save your changes
    • - save your changes without alerting subscribed WebNotify users
    • - add row to the table (if enabled)
    • - remove last row from the table (if enabled)
    • - cancel without saving and release edit lock

Examples

Line before table: %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" }%

Line: 55 to 59

(demo only, these buttons do not work)
Added:
>
>

Date Field Type

Edit Table Calendar Example 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 Mishoo DHTML calendar, see also TWiki:Codev/JavaScriptDatePickerForForm

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, for example, %EDITTABLEPLUGIN_SHORTDESCRIPTION%

  • One line description, shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Edit TWiki tables using edit fields and drop down boxes

  • Set DEBUG to 1 to get debug messages in data/debug.txt. Default: 0
    • Set DEBUG = 0

  • Default for change rows flag: on, off, add
    • Set CHANGEROWS = on

  • Language of DHTML calendar, pointing to attached calendar-<code>.js language file: en, de, es, fr, jp
    • Set JSCALENDARLANGUAGE = en

  • Additional options of DHTML calendar:
    • Set JSCALENDAROPTIONS =

Note: The Plugin looks for the JSCALENDAR* settings first in the TWiki Preferences, then in above Plugin settings


Limitations and Known Issues

Line: 69 to 102

  • You can include %-vars now in select values, by quoting them with <nop>, as in %<nop>X% for ALERT!, say for instance:
    select,1,%<nop>X%,%<nop>Y%
Deleted:
<
<

Plugin Installation Instructions

Added:
>
>
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.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip EditTablePlugin.zip in your twiki installation directory. Content:
    File: Description:
Line: 85 to 114

data/TWiki/EditTablePlugin.txt,v Plugin topic repository
lib/TWiki/Plugins/EditTablePlugin.pm Plugin Perl module
  • The plugin depends on the viewauth script to authenticate the user. As described in 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.
Added:
>
>
  • 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

  • Test if the plugin is correctly installed:
    • Check above example if there is an [ Edit table ] button below the table in above example
    • Click on [ Edit table ], make changes and save the table
Added:
>
>

License

  • The Edit Table Plugin is released under the GPL
  • The Mishoo DHTML calendar bundled with this Plugin was created by Mihai Bazon and is released under the LGPL -- thanks Mihai for the great tool smile

Plugin Info

Changed:
<
<
Plugin Author: PeterThoeny
Plugin Version: 16 Oct 2003
>
>
Plugin Author: TWiki:Main/PeterThoeny
Plugin Version: 13 Dec 2003

Change History: <!-- specify latest version first --> 
Added:
>
>
13 Dec 2003: Added CHANGEROWS, JSCALENDARDATEFORMAT, JSCALENDARLANGUAGE, JSCALENDAROPTIONS settings

16 Oct 2003: small typo fixed (garbled if ---+ header on top)
15 Oct 2003: new date field type with javascript calendar - CN
14 Oct 2003: docfix: the documentation page was an old one - CN
13 Oct 2003: bugfix: %-vars in select were resetted to first on add/del row - CN
Changed:
<
<
18 Sep 2003: incompatibility: changed default of changerows to =on=
support for %-vars, Quietsave for saving without notification, all other fixes in Dev topic integrated - CN
>
>
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

08 Nov 2002: Prevent variable expansion in label text; added escape characters
27 Jun 2002: New helptopic parameter
26 Jun 2002: Support for variables in included EDITTABLE parameters; fixed problem with HTML in cells
Line: 109 to 145

08 Apr 2002: Check for change permission and edit lock of topic
05 Apr 2002: Initial version
CPAN Dependencies: none
Changed:
<
<
Other Dependencies: none
>
>
Other Dependencies: Mishoo DHTML calendar (version 0.9.5 preinstalled)

Perl Version: 5.0
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/EditTablePlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/EditTablePluginDev

Related Topics: TWikiPreferences, TWikiPlugins

Changed:
<
<
-- PeterThoeny - 08 Nov 2002
>
>
-- TWiki:Main/PeterThoeny - 13 Dec 2003
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
META FILEATTACHMENT 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"
 <<O>>  Difference Topic EditTablePlugin (r1.1 - 12 Dec 2003 - PeterThoeny)
Line: 1 to 1
Added:
>
>

Edit Table Plugin

This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %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.

EditTablePlugin Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, for example, %INTERWIKIPLUGIN_SHORTDESCRIPTION%

  • One line description, shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Edit TWiki tables using edit fields and drop down boxes.

  • Set DEBUG to 1 to get debug messages in data/debug.txt. Default: 0
    • Set DEBUG = 0

Per Table Settings

Add a %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:

Parameter Comment Default
header Enable static header if "on", e.g. disable editing of the first row;
Else specify the header format of a new table like "|*Food*|*Drink*|".
(no header)
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:
-Text input field (1 line): | text, <size>, <initial value> |
-Textarea input field: | textarea, <rows>x<columns>, <initial value> |
- Drop down box: | select, <size>, <option 1>, <option 2>, etc |
- Fixed label: | label, 0, <label text> |
- Row number: | row, <offset> |
- Date: | date, <sizet> |
"text, 16" for all cells
changerows Rows can be added and removed if "on";
Rows can be added but not removed if "add"
"on"
include Other topic defining the EDITTABLE parameters. The first %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)
helptopic Topic name containing help text shown below the table when editing a table. The %STARTINCLUDE% and %STOPINCLUDE% variables can be used in the topic to specify what is shown. (no help text)

Note: By default, variables in <initial value> (of text input field) and <label text> (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:

Text: To Escape:
$quot Double quote ("). Alternatively write \" to escape it
$percnt Percent sign (%)
$dollar Dollar sign ($)
$nop or $nop() Is a "no operation"

Examples

Line before table: %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" }%

Nr Text field sandbox up Drop down sandbox Timestamp
1 hello table one 26 Jun 2002 12:30
2   two 27 Jun 2002 12:40

If this plugin is installed you will see an [ Edit table ] button above; when you click on it you get this form:

Nr Text field sandbox Drop down sandbox Timestamp
1 26 Jun 2002 12:30
2 27 Jun 2002 12:40
(demo only, these buttons do not work)

Limitations and Known Issues

  • This Plugin does not support TWiki table formatting like Multi-span cells (e.g. | ... ||) and cell justification (e.g. |  centered  |   right |).
  • There is a performance issue when editing a large table, say, with more then 50 rows.
  • 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
  • Variables like %ATTACHURL% get expanded unless they are in a label.
  • Warning: This plugin uses undocumented functions to read, save and lock a topic. The plugin will likely break in a future TWiki release.
  • You cannot put two %EDITTABLE% statements on the same line in the source.
  • You can include %-vars now in select values, by quoting them with <nop>, as in %<nop>X% for ALERT!, say for instance:
    select,1,%<nop>X%,%<nop>Y%
  • date field type for the format parameter adds a button popping a javascript calendar to choose the date on browsers supporting it. It uses the nice Mishoo DHTML calendar at http://dynarch.com/mishoo/calendar.epl, that should be included in Cairo release, or see TWiki:Codev/JavaScriptDatePickerForForm for installing it on Beijing Release

Plugin Installation Instructions

  • Download the ZIP file from the Plugin web (see below)
  • Unzip EditTablePlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/EditTablePlugin.txt Plugin topic
    data/TWiki/EditTablePlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/EditTablePlugin.pm Plugin Perl module
  • The plugin depends on the viewauth script to authenticate the user. As described in 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.
  • Test if the plugin is correctly installed:
    • Check above example if there is an [ Edit table ] button below the table in above example
    • Click on [ Edit table ], make changes and save the table

Plugin Info

Plugin Author: PeterThoeny
Plugin Version: 16 Oct 2003
Change History: <!-- specify latest version first --> 
16 Oct 2003: small typo fixed (garbled if ---+ header on top)
15 Oct 2003: new date field type with javascript calendar - CN
14 Oct 2003: docfix: the documentation page was an old one - CN
13 Oct 2003: bugfix: %-vars in select were resetted to first on add/del row - CN
18 Sep 2003: incompatibility: changed default of changerows to =on=
support for %-vars, Quietsave for saving without notification, all other fixes in Dev topic integrated - CN
08 Nov 2002: Prevent variable expansion in label text; added escape characters
27 Jun 2002: New helptopic parameter
26 Jun 2002: Support for variables in included EDITTABLE parameters; fixed problem with HTML in cells
21 May 2002: Added fixed label format; new changerows="add" parameter
27 Apr 2002: Fixed bug where text after a double quote in a cell disappeared
18 Apr 2002: Fixed bug where table was breaking when pasting multiple lines into an edit field using Netscape on Unix
08 Apr 2002: Check for change permission and edit lock of topic
05 Apr 2002: Initial version
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.0
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/EditTablePlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/EditTablePluginDev

Related Topics: TWikiPreferences, TWikiPlugins

-- PeterThoeny - 08 Nov 2002

View topic | Diffs | r1.9 | > | r1.8 | > | r1.7 | More
Revision r1.1 - 12 Dec 2003 - 08:31 - PeterThoeny
Revision r1.9 - 02 Aug 2004 - 05:45 - PeterThoeny