FormTemplateSystem

<< | Cookbook-V1 | >>

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Goal

A flexible, extensible, parameter driven template system to support the use of form pages within PmWiki.

Solution

To achieve this goal the FormTemplateSystem (FTS) uses two types of php scripts.

One of the scripts is the main module that oversees and manages the interaction between the "user", the template forms, and PmWiki. This module is activated by using an include_once statement in the local.php file.

The other type of script contains specification parameters for a form template. There may be multiples scripts of this type with each defining a unique form template. The PmWiki administrator would use these scripts to construct one or more specification scripts to meet his/her need for local forms.

Files

Attach:FTS-0.1.7.zip

Installation

  1. Download the above zip file and extract it to a working directory.
  2. Place the FTS-0.1.7.php file in your local.php directory.
  3. Within your PmWiki directory (where your wiki.d directory is located), create a subdirectory for your template files. Select a name for this directory that is meaningful to you.
  4. Copy the Description.php, FTS-SampleTemplate.php, ReleaseNotes.php, and PHPCode.php files to this subdirectory. These are form template files. You will want to study them.

Configuration

Add the following to your local.php script file.

  • $TemplateDir='your_template_subdirectory';
  • include_once("local/FTS-0.1.7.php");

Usage

To activate a form template with a particular wiki page simply include the following at the end of the URL address: ?action=edit&template=templatename. For example, assuming that the FTS were installed with the related templates in the templates subdirectory,

http://www.pmichaud.com/wiki/group/WikiPage?action=edit&template=FTS-SampleTemplate

would open an existing or a new page with the associated form attached to group/WikiPage.

Example

A working example of the use of the Form Template System is available at the following URL: FTS Example.

See Also

History

January 22, 2004 -- Corrected password problem, various bug fixes -- version 0.1.7 January 11, 2004 -- Corrected ?action=export&select= logic -- version 0.1.6 January 9, 2004 -- Added new logic and altered diff operation -- version 0.1.5 January 5, 2004 -- Added new logic and minor bug fixes -- version 0.1.4 December 8, 2003 -- Minor adjustments to code, functionality -- version 0.1.3 December 6, 2003 -- Modifications and enhancements -- version 0.1.2 November 10, 2003 -- Initial release -- version 0.1.0

Documentation

FormTemplateSystem-Documentation
FormTemplateSystem-ReleaseNotes

Comments, Bugs

December 23, 2003 --
the include of FTS-0.1.3.php has two reproducible side effect in my installation:

  • Browser: after a group slash was necessary (I had to change the forward in my index.php)
Corrected in FTS-0.1.4. -JF
  • worse: after installing this include, the system didn't recognize the admin-user anymore. I searched quite a while, also for my passwords.
Corrected in FTS-0.1.7. -JF
  • minor: RecentChanges doesn't seen to work with forms

:: Logic added for FTS-0.1.4 release. -JF

Patrick Ogay

Contributors

John Feezell, concept design and programming.

Copyright

Copyright 2003-2004 John Feezell, All Rights Reserved.
Copyright release is hereby given to PmWiki site administrators to include these scripts in support of normal site operations. Modifications that conform to current copyright law can be made to the scripts for personal use. pmwiki-2.3.38 -- Last modified by {{}}?

from IP: 85.171.160.186 ip should be disabled by default for security reasons