Changes between Version 11 and Version 12 of TracFormsPlugin/Docs


Ignore:
Timestamp:
Jun 17, 2008 2:44:33 AM (6 years ago)
Author:
rharkins
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracFormsPlugin/Docs

    v11 v12  
    66TODO: Pontificate on the merits of forms in wikis... 
    77 
    8 == !TracForm Syntax == 
     8== Contents == 
    99 
    10 All !TracForm blocks are wrapped and formatted as follows: 
    11  
    12 {{{ 
    13  
    14 {{{ 
    15 #!TracForm 
    16 # 
    17 # comments 
    18 # 
    19 #! command  
    20 #! command arg1 arg2 
    21 # 
    22 # more comments... 
    23 # 
    24 #! more_commands "quoted argument" 
    25 # 
    26  
    27 [tf.checklist:field] 
    28 [tf.who:field] 
    29  
    30 }}} 
    31  
    32 }}} 
    33  
    34 (... and so on) 
    35  
    36 Comments are ignored and can be intermixed with commands until the first non-comment line.  [tf] operations are intermixed with other Trac wiki entities and the results ''can'' in some cases cause other wiki entities to take place (but only where it makes sense). 
    37  
    38 === !TracForm Configuration === 
    39  
    40 In the header section of the form, several commands can be used to control the rendering and configuration of the form in the form of "#!command [arg...]" lines before the first non-comment line: 
    41  
    42 || '''Command''' || '''Version''' || '''Arguments''' || '''Meaning''' || 
    43 || '''page''' || 0.1+ || page-context || Sets the page portion of the context used to store the form.  This defaults to the page the user is currently on. || 
    44 || '''subcontext''' || 0.1+ || subcontext || Sets a subcontext within the page.  For example, a SVN checklist could have a "#!subcontext SVN" to differentiate it from other forms on the page. || 
    45 || '''default''' || 0.1+ || operation || Specifies the default operation in [tf:args] blocks.  Defaults to "checkbox" || 
    46 || '''track_fields''' || 0.1+ || [yes|no] || If no argument given or yes, keep track of field changes in this form.  Defaults to false (no field changes tracked).  This affects [tf.who] and [tf.when] || 
    47 || '''submit_label''' || 0.1+ || label || Set the label to use for the submit button at the end of the form.  The default is "Submit Form" || 
    48 || '''setenv''' || 0.1+ || name value || Set the name to value in the form's environment (or any subforms therein). || 
    49  
    50 === !TracForm Operations === 
    51  
    52 Within the TracForm, you can use the following commands with [tf.OP:arg...] blocks: 
    53  
    54 || '''Operation''' || '''Version''' || '''Argument(s)''' || '''Meaning''' || 
    55 || '''tf.checkbox''' || 0.1+ || name [value] || Put an HTML checkbox here.  Use value only if specified (on is default). || 
    56 || '''tf.radio''' || 0.1+ || name value || Put an HTML checkbox here.  Use the name and value pair together. || 
    57 || '''tf.input''' || 0.1+ || name default || Put an HTML form input field here. || 
    58 || '''tf.who''' || 0.1+ || name || Show which user most recently affected the specified field.  This requires track_fields to be set in the commands section. || 
    59 || '''tf.when''' || 0.1+ || name [strftime format string] || Show when the most change was made on the specified field.  This requires track_fields to be set in the commands section. || 
    60 || '''tf.form_updater''' || 0.1+ || || Show the most recent updater of the form itself. || 
    61 || '''tf.form_updated_on''' || 0.1+ || [strftime format string] || Show when the form was most recently updated. || 
    62  
    63 === !TracForm Arguments === 
    64  
    65 Each arguments listed above are either: 
    66  
    67  * Separated by whitespace.  Example:  #!setenv VAR VALUE 
    68  * Quoted with double-quotes.  Example: #!submit_label "Hello World" 
    69  * Quoted with single-quotes.  Example: [tf.input:'Big Text'] 
    70  
    71 === !TracForm Environment === 
    72  
    73 Using the #!setenv command above, you can retrieve previously defined elements with %NAME% (case insensitive).  Other environment variables are also defined by the system: 
    74  
    75 || '''Variable''' || '''Version''' || '''Meaning''' || 
    76 || '''%USER%''' || 0.1+ || The currently active user. || 
    77 || '''%NOW%''' || 0.1+ || The current date and time. || 
    78  
    79 All substitutions may be applied to any argument within #! command or [tf:] operation sections. 
    80  
     10[[TitleIndex(TracFormsPlugin)]]