<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="home" title="HomePage" href="HomePage.html" />
<link rel="help" title="HowToUseWiki" href="HowToUseWiki.html" />
<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1" />
<link rel="author" title="The PhpWiki Programming Team" href="http://phpwiki.org/ThePhpWikiProgrammingTeam" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="en" />
<meta name="robots" content="noindex,nofollow" />
<meta name="language" content="en" />
<meta name="document-type" content="Public" />
<meta name="document-rating" content="General" />
<meta name="generator" content="PhpWiki" />
<meta name="PHPWIKI_VERSION" content="1.3.14" />

<link rel="stylesheet" type="text/css" charset="iso-8859-1" href="phpwiki-printer.css" />
<title>PhpWiki - FormMagick Reference Guide</title>
</head>
<body>

<div id="header">
  
<!-- Page title -->
<h1>FormMagick Reference Guide</h1>
</div>
<div id="content">



<div class="wikitext"><h3>INTRODUCTION</h3>
<p class="tightenable">FormMagick(FM) is the primary API available for creating server-manager panels in SME Server.  It provides a comprehensive toolset for developing form-based web pages using an easy to use XML based templating system similar to HTML template systems like <span><a href="Template.html" class="wiki relation">Template</a><span class="relation-symbol">::</span><a href="Toolkit.html" class="wiki">Toolkit</a></span> and <span><a href="HTML.html" class="wiki relation">HTML</a><span class="relation-symbol">::</span><a href="Template..html" class="wiki">Template.</a></span>  FM includes a powerful form field validation mechanism, multi-lingual support, and built in CGI security measures.  Unlike the previous SME Server Manager API, which used a Batch Oriented approach to panel design, FM uses an Event Driven approach.  This approach simplifies panel design and development and allows for easy recycling of code developed in other server-manager panels.</p>
<h3>FORMMAGICK PANEL OVERVIEW</h3>
<p class="tightenable">FormMagick Server-Manger panels consist of three major components:</p>
<ol><li class="tightenable bottom"><b>XML Document</b>:  The XML document is the backbone, or framework, of the FM server-manager panel.  While it doesn’t contain any actual logic per se, the FM XML document provides the structure for the panel through a nested hierarchy of XML elements.  Think of the XML document like an outline for a writing report.</li>
<li class="tightenable top bottom"><b>Lexicon Definitions</b>:  Lexicon definitions are collections of translation variables, in XML format, for each panel that provide the actual text for the panel depending on the defined language.  This allows for support if any of a number of different languages by simply creating a new Lexicon for the language in question.  There is no need to alter the panel code in any way.</li>
<li class="tightenable top"><b>Perl Module</b>:  This component of the FM server manager panel provides much of the “under the hood” logic for the panel.  Typical FM perl modules consist of a collection of functions that either look up existing information from SME data bases or set values in these databases.  This is also the place to signal events, restart services, etc.</li>
</ol>
<h3>XML DOCUMENT</h3>
<p class="tightenable"><b><big>Location</big></b>:  /etc/e-smith/web/functions/</p>
<h4>Overview</h4>
<p class="tightenable top">Each SME Server-Manager panel requires what we’ll now refer to as an “XML Document” to be located in etc/e-smith/web/functions and a symbolic link in /etc/e-smith/web/panels/manager/cgi-bin pointing to the XML document.  While this document isn’t 100% XML, most of what’s contained in this document are XML elements that define the layout of the panel.  The XML document contains several important things in addition to the actual XML, including information that tells SME where to put the panel in the server-manager menu bar and code that basically ties all three components of the FM panel together (i.e., XML Document, Lexicon Definitions, and Perl Module).  The XML Document can be divided into three required sections:  Header, Initialization, and XML.  Following we will look at each in detail.</p>
<h4>Header</h4>
<p class="tightenable top">A typical Header section for an XML Document is as follows:</p>
<pre class="tightenable">
1: #!/usr/bin/perl -wT
2:
3: #----------------------------------------------------------------------
4: # heading     : Security
5: # description : My first panel
6: # navigation  : 5000 5200
7: #----------------------------------------------------------------------</pre>
<p class="tightenable">OK, lets have a line-by-line look at what's included here and what it means.</p>
<p class="tightenable">Line 1:  This is the perl shebang with Taint and Warnings flags set.  Include this verbatium with all panels.
<br />Line 2:  Space.
<br />Line 3:  Begin menu placement comment block.  Include verbatium.
<br />Line 4:  Menu item placement.  Replace the work &quot;Security&quot; with the Server-Manager menu category that you'd like your panel to show up it.
<br />Line 5:  Menu item text.  Replace the phrase &quot;My first panel&quot; with the menu text that you'd like displayed in the menu block
<br />Line 6:  Menu item placement:  Replace the 5000 and 5200 numbers with numbers that place your new menu item in the order that you'd like it displayed (note to self:  Need to flush this out a bit more).
<br />Line 7:  End menu placement comment block.  Include verbatium.</p>
<p class="tightenable">Just after Line 7, you can place additional perl comment lines to include other information related to your panel code such as copyright information and licensing.</p>
<h4>Initialization</h4>
<p class="tightenable">The Initialization section must consist of the following:</p>
<pre class="tightenable">
8: use strict;
9: use <span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3APanel%3A%3Amy_first_panel%3B.html" class="wiki">FormMagick::Panel::my_first_panel;</a></span>
10: my $f = <span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3APanel%3A%3Amy_first_panel-%3Enew%28%29%3B.html" class="wiki">FormMagick::Panel::my_first_panel-&gt;new();</a></span>
11: $f-&gt;display();</pre>
<p class="tightenable">Let's have a look at what's going on here.</p>
<p class="tightenable">Line 8:  Attach the strict pragma.  Include this verbatium with all panels.
<br />Line 9:  Attach your panel perl module.  Change &quot;::my_first_pane&quot; with the perl module name for your new FM panel.
<br />Line 10:  Creates a instance of your new panel.  Replace &quot;::my_first_panel&quot; with your panel perl module name.
<br />Line 11:  Display the panel.  Include verbatium.</p>
<h4>XML</h4>
<p class="tightenable">A typical XML section is as follows:</p>
<pre class="tightenable">
12: __DATA__
13: &lt;form
14:    title=&quot;FORM_TITLE&quot;
15:    header=&quot;/etc/e-smith/web/common/head.tmpl&quot;
16:    footer=&quot;/etc/e-smith/web/common/foot.tmpl&quot;&gt;
17:
18:    &lt;!-- page 0 --&gt;
19:    &lt;page
20:        name=&quot;Front_Page&quot;
21:        pre-event=&quot;print_status_message()&quot;&gt;
22:        &lt;description&gt;FIRST_PAGE_DESCRIPTION&lt;/description&gt;
23:        &lt;field
24:            id=&quot;widget1&quot;
25:            type=&quot;select&quot;
26:            options=&quot;'YES','NO'&quot;&gt;
27:            &lt;label&gt;LABEL_FOR_WIDGET_ONE&lt;/label&gt;
28:        &lt;/field&gt;
29:    &lt;/page&gt;
30:
31:    &lt;!-- page 1 --&gt;
32:    &lt;page
33:        name=&quot;Another_Page&quot;
34:        pre-event=&quot;print_status_message()&quot;&gt;
35:        &lt;description&gt;NEXT_PAGE_DESCRIPTION&lt;/description&gt;
35:        &lt;field
36:            id=&quot;widget2&quot;
37:            type=&quot;text&quot;
38:            size=&quot;15&quot;
39:            validation=&quot;my_custom_validation_function()&quot;&gt;
40:            &lt;label&gt;LABEL_FOR_WIDGET2&lt;/label&gt;
41:        &lt;/field&gt;
42:    &lt;/page&gt;
43: &lt;/form&gt;</pre>
<h3>LEXICON DEFINITIONS</h3>
<p class="tightenable"><b><big>Location</big></b>: /etc/e-smith/location/</p>
<h3>PERL MODULE</h3>
<p class="tightenable"><b><big>Location</big></b>: /usr/lib/perl5/site_perl/esmith/FormMagick/Panel/</p>
<h3>EXAMPLE 1: Hello World</h3>
<h3>EXAMPLE 2:</h3>
<h3>FORMMAGICK XML REFERENCE</h3>
<p class="tightenable bottom">NAME</p>
<blockquote class="tightenable top"><p class="tightenable top bottom"><span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick.html" class="wiki">FormMagick</a></span> - easily create CGI form-based applications</p>
</blockquote>
<p class="tightenable bottom">SYNOPSIS</p>
<blockquote class="tightenable top"><p class="tightenable top">use <span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3B.html" class="wiki">FormMagick;</a></span></p>
<p class="tightenable">my $f = new <span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%28%29%3B.html" class="wiki">FormMagick();</a></span></p>
<ol><li class="tightenable bottom">all options available to new()</li>
</ol>
<p class="tightenable top bottom">my $f = new <span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%28.html" class="wiki">FormMagick(</a></span></p>
<blockquote class="tightenable top bottom"><p class="tightenable top bottom">type =&gt; file,
source =&gt; $myxmlfile,</p>
</blockquote>
<p class="tightenable top">);</p>
<ol><li class="tightenable bottom">other types available</li>
</ol>
<p class="tightenable top">my $f = new <span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%28type.html" class="wiki">FormMagick(type</a></span> =&gt; string,  source =&gt; $data );</p>
<p class="tightenable bottom">$f-&gt;display();</p>
</blockquote>
<p class="tightenable bottom">DESCRIPTION</p>
<blockquote class="tightenable top"><p class="tightenable top bottom"><u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> is a toolkit for easily building fairly complex form-based
web applications. It allows the developer to specify the structure of a
multi-page &quot;wizard&quot; style form using XML, then display that form using
only a few lines of Perl.</p>
</blockquote>
<dl><dt class="tightenable">How it works</dt>
<dd class="tightenable"><p class="tightenable top">You (the developer) provide at least:</p>
<ul><li class="tightenable">An XML form description</li>
<li class="tightenable">HTML templates for the page headers and footers</li>
</ul>
<p class="tightenable">And may optionally provide:</p>
<ul><li class="tightenable">Translations of strings used in your application, for localisation</li>
<li class="tightenable">Validation routines for user input data</li>
<li class="tightenable">Routines to run before or after a page of the form is displayed</li>
</ul>
<p class="tightenable bottom"><u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> brings them all together to create a full application.</p>
</dd>
</dl>
<p class="tightenable bottom">METHODS</p>
<blockquote class="tightenable top"><p class="tightenable top">new()</p>
<blockquote class="tightenable"><p class="tightenable top">The &quot;new()&quot; method requires no arguments, but may take the following
optional arguments (as a hash):</p>
<p class="tightenable bottom">type</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">Defaults to &quot;file&quot;. &quot;string&quot; is also available, in which case you
must specify a source which is either a literal string or a scalar
variable.</p>
</blockquote>
<p class="tightenable bottom">source</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">Defaults to a filename matching that of your script, only with an
extension of .xml (we got this idea from <span><a href="XML.html" class="wiki relation">XML</a><span class="relation-symbol">::</span><a href="Simple%29..html" class="wiki">Simple).</a></span></p>
</blockquote>
<p class="tightenable bottom">charset</p>
<blockquote class="tightenable top bottom"><p class="tightenable top bottom">Tell <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> that the XML input uses the specified character set
encoding. Defaults to 'none' which is good enough for English text
and US ASCII. Any other characters may cause parse errors. Valid
charsets are &quot;ISO-8859-1&quot;, &quot;UTF-8&quot;, &quot;UTF-16&quot;, or &quot;US-ASCII&quot;. This
option is case sensitive.</p>
</blockquote>
</blockquote>
<p class="tightenable">previousbutton()</p>
<blockquote class="tightenable"><p class="tightenable top bottom">With no arguments, tells you whether the previousbutton will be
displayed or not. If you give it a true argument (eg 1) it will set the
previous button to be displayed. A false value (eg 0) will set it to not
be displayed.</p>
</blockquote>
<p class="tightenable">nextbutton()</p>
<blockquote class="tightenable"><p class="tightenable top bottom">As for previousbutton, but affects the &quot;Next&quot; button.</p>
</blockquote>
<p class="tightenable">finishbutton()</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Ditto.</p>
</blockquote>
<p class="tightenable">resetbutton()</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Ditto.</p>
</blockquote>
<p class="tightenable">startoverlink()</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Ditto.</p>
</blockquote>
<p class="tightenable">debug()</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Turns debugging on/off.</p>
</blockquote>
<p class="tightenable">sessiondir()</p>
<blockquote class="tightenable"><p class="tightenable top">With no arguments, tells you the directory in which session tokens are
kept.</p>
<p class="tightenable">With a true value, set the session directory, in which session tokens
are kept. Defaults to &quot;session-tokens&quot; under the directory in which your
CGI script is kept, but you probably want to set it to something outside
the web tree.</p>
<p class="tightenable bottom">With a false (but defined) value, resets the session dir to its default
value.</p>
</blockquote>
<p class="tightenable">fallback_language($language)</p>
<blockquote class="tightenable"><p class="tightenable top">Given a 2-letter ISO language code, makes that language the fallback
language for localisation. Not necessary unless you want it to be
something other than the base language in which your application is
written. Set it to a false (but defined) value to turn off the fallback
language feature.</p>
<p class="tightenable bottom">With no arguments, tells you what the current fallback language is.</p>
</blockquote>
<p class="tightenable">display()</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom">The display method displays your form. It takes no arguments. It does
however, respect certain CGI parameters that can be set in the
submission of the page. For example, if the skip_header parameter is
set, it will just execute the post-event and return, giving the
post-event complete control over the response.</p>
</blockquote>
</blockquote>
<p class="tightenable bottom">RANDOM USEFUL METHODS</p>
<blockquote class="tightenable top"><p class="tightenable top">$fm-&gt;cgi()</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Returns the CGI object that <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> is using.</p>
</blockquote>
<p class="tightenable">$fm-&gt;wherenext($pagename);</p>
<blockquote class="tightenable"><p class="tightenable top">Set the magic &quot;wherenext&quot; CGI parameter, which tells <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> which
page to display next. Particularly useful when used in a page's
post-event routine, to (for instance) go to a different next page
depending on what the user entered on the last page.</p>
<p class="tightenable bottom">This method is also exported so you can use it in the form itself, for</p>
<dl><dt class="tightenable top">instance</dt>
<dd class="tightenable">&lt;page post-event=&quot;wherenext('<u title="Empty link to: SomePage" onmouseover="window.status=&quot;Empty link to: SomePage&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">SomePage</u>')&quot;&gt;</dd>
</dl>
<p class="tightenable bottom">With no args, returns the value of the &quot;wherenext&quot; parameter.</p>
</blockquote>
<p class="tightenable">$fm-&gt;go_to_finish()</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom">Like wherenext(), except that it says to go to the finish and perform
the form post-event and do all the things that would ordinarily be done
when a user clicks the &quot;Finish&quot; button. Can be used as a method or as an</p>
<dl><dt class="tightenable top">exported function, so you can do things like</dt>
<dd class="tightenable bottom">&lt;page post-event=&quot;go_to_finish()&quot;&gt;</dd>
</dl>
</blockquote>
</blockquote>
<p class="tightenable bottom">FORMMAGICK XML TUTORIAL</p>
<blockquote class="tightenable top"><p class="tightenable top">Form descriptions</p>
<blockquote class="tightenable bottom"><p class="tightenable top">The main thing you need to know to use <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> is the structure and
syntax of <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> forms. <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> is based on a &quot;wizard&quot; sort of
interface, in which one form has many pages, and each page has many
fields. This is expressed as a nested hierarchy of XML elements.</p>
<p class="tightenable">For examples of <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> XML, see the &quot;examples/&quot; directory included
in the <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> distribution.</p>
<p class="tightenable">The XML must comply with the <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> DTD (included in the
distribution as <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u>.dtd). A command-line tool to test compliance
is planned for a future release.</p>
<p class="tightenable bottom">Here is an explanation of the nesting of elements and the attributes
supported by each element.</p>
</blockquote>
</blockquote>
<p class="tightenable bottom">FORMS</p>
<blockquote class="tightenable top"><p class="tightenable top">Form sub-elements</p>
<blockquote class="tightenable"><p class="tightenable top">A form may contain the following elements:</p>
<ul><li class="tightenable bottom">page</li>
</ul>
</blockquote>
<p class="tightenable">Form attributes</p>
<blockquote class="tightenable"><p class="tightenable top">The following attributes are supported for forms:</p>
<ul><li class="tightenable">pre-event (a subroutine to run before the form is displayed)</li>
<li class="tightenable bottom">post-event (a subroutine to run after the form is completed)</li>
</ul>
</blockquote>
<p class="tightenable">Example</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom">&lt;form pre-event=&quot;setup()&quot; post-event=&quot;submit()&gt;</p>
<blockquote class="tightenable top bottom"><p class="tightenable top bottom">&lt;page&gt; ... &lt;/page&gt;
&lt;page&gt; ... &lt;/page&gt;
&lt;page&gt; ... &lt;/page&gt;</p>
</blockquote>
<p class="tightenable top bottom">&lt;/form&gt;</p>
</blockquote>
</blockquote>
<p class="tightenable bottom">PAGES</p>
<blockquote class="tightenable top"><p class="tightenable top">Page sub-elements</p>
<blockquote class="tightenable"><p class="tightenable top">A page may contain the following sub-elements:</p>
<ul><li class="tightenable">description</li>
<li class="tightenable bottom">field</li>
</ul>
</blockquote>
<p class="tightenable">Page attributes</p>
<blockquote class="tightenable"><p class="tightenable top">The following attributes are supported for pages:</p>
<ul><li class="tightenable">name (required)</li>
<li class="tightenable">pre-event=&lt;func&gt;</li>
<li class="tightenable">post-event=&lt;func&gt;</li>
<li class="tightenable bottom">menu=&lt;func&gt;</li>
</ul>
</blockquote>
<p class="tightenable">Example</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom">&lt;page</p>
<blockquote class="tightenable top bottom"><blockquote class="tightenable top bottom"><p class="tightenable top bottom">name=&quot;<u title="Empty link to: RoomType" onmouseover="window.status=&quot;Empty link to: RoomType&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">RoomType</u>&quot;
menu=&quot;show_menu()&quot;
post-event=&quot;check_availability&quot;&gt;</p>
</blockquote>
<p class="tightenable top bottom">&lt;description&gt;</p>
<blockquote class="tightenable top bottom"><p class="tightenable top bottom">Please provide us with details of your preferred room.</p>
</blockquote>
<p class="tightenable top bottom">&lt;/description&gt;
&lt;field&gt; ... &lt;/field&gt;
&lt;field&gt; ... &lt;/field&gt;
&lt;field&gt; ... &lt;/field&gt;</p>
</blockquote>
<p class="tightenable top bottom">&lt;/page&gt;</p>
</blockquote>
</blockquote>
<p class="tightenable bottom">FIELDS</p>
<blockquote class="tightenable"><blockquote class="tightenable top"><p class="tightenable top bottom">Fields are the most important part of the form definition. Several types
of HTML fields are supported, and each one has various attributes
associated with it.</p>
</blockquote>
<p class="tightenable top">Field types</p>
<blockquote class="tightenable"><p class="tightenable top bottom">You can specify the type of HTML field to be generated using the type</p>
<dl><dt class="tightenable top">attribute</dt>
<dd class="tightenable">&lt;field type=&quot;...&quot;&gt;</dd>
</dl>
<p class="tightenable">The following field types are supported:</p>
<p class="tightenable bottom">text</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">A plain text field. You may optionally use the size attribute to
modify the size of the field displayed. To restrict the length of
data entered by the user, use the maxlength() validation routine.</p>
</blockquote>
<p class="tightenable bottom">select</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">A dropdown list. You must provide the options attribute to specify
the contents of the list (see below for the format of this
attribute). If you set the multiple attribute to 1, multiple
selections will be enabled. The optional size attribute sets the
number of items displayed at once.</p>
</blockquote>
<p class="tightenable bottom">radio</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">Radio buttons allow users to choose one item from a group. This
field type requires the options attribute (as for select, above).</p>
</blockquote>
<p class="tightenable bottom">checkbox</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">This field type provides a simple check box for yes/no questions.
The checked attribute is optional, but if set to 1 will make the
checkbox checked by default.</p>
</blockquote>
<p class="tightenable bottom">password</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">The password field type is like a text field, but obscures the data
typed in by the user.</p>
</blockquote>
<p class="tightenable bottom">file</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">This field type allows the upload of a file by the user.</p>
</blockquote>
<p class="tightenable bottom">textarea</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">A multi-line text field allowing the input of blocks of text.
Defaults to 5 rows and 60 columns, but you can specify &quot;rows&quot; and
&quot;cols&quot; arguments to change that.</p>
</blockquote>
<p class="tightenable bottom">literal</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">A field that is just printed literally. Useful if you want to just
print out a non-editable bit of text in the same sort of layout as
the other fields in the form.</p>
</blockquote>
<p class="tightenable bottom">You may specify a subroutine to generate the field type. This is
particularly useful in &quot;create or modify&quot; type forms where one or more
fields will be input fields when creating or literals when modifying.
The subroutine can return any of the above type as a string.</p>
</blockquote>
<p class="tightenable">Field sub-elements</p>
<blockquote class="tightenable"><p class="tightenable top">The following elements may be nested within a field:</p>
<ul><li class="tightenable">label (a short description; required)</li>
<li class="tightenable bottom">description (a more verbose description; optional)</li>
</ul>
</blockquote>
<p class="tightenable">Other field attributes</p>
<blockquote class="tightenable"><p class="tightenable top">Fields must ALWAYS have a type (described in the previous section) and
an id attribute, which is a unique name for the field. Each type of
field may have additional required attributes, and may support other
optional attributes.</p>
<p class="tightenable">Here is a list of optional attributes for fields:</p>
<p class="tightenable bottom">value</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">A default value to fill in; see below for more information on the
format of this field.</p>
</blockquote>
<p class="tightenable bottom">validation</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">a list of validation functions; see the <span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3AValidator.html" class="wiki">FormMagick::Validator</a></span>
manpage for more information on this subject.</p>
</blockquote>
<p class="tightenable bottom">validation-error-message</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">an error message to present to the user if validation fails.
<span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3AValidator.html" class="wiki">FormMagick::Validator</a></span> provides one by default, but you may
prefer to override it.</p>
</blockquote>
<p class="tightenable bottom">options</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">A list of options required for a select list or radio buttons; see
below for more information on the format of this attribute.</p>
</blockquote>
<p class="tightenable bottom">checked</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">For checkbox fields, used to make the box checked by default.
Defaults to 0.</p>
</blockquote>
<p class="tightenable bottom">multiple</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">For select fields, used to allow the user to select more than one
value.</p>
</blockquote>
<p class="tightenable bottom">size</p>
<blockquote class="tightenable top bottom"><p class="tightenable top bottom">For select fields, height; for text and textarea fields, length.</p>
</blockquote>
</blockquote>
<p class="tightenable">Notes on parsing of value attribute</p>
<blockquote class="tightenable"><p class="tightenable top">If your value attribute ends in parens, it'll be taken as a subroutine
to run. Otherwise, it'll just be taken as a literal.</p>
<dl><dt class="tightenable">This will be literal</dt>
<dd class="tightenable">value=&quot;username&quot;</dd>
<dt class="tightenable">This will run a subroutine</dt>
<dd class="tightenable">value=&quot;get_username()&quot;</dd>
</dl>
<p class="tightenable">The subroutine will be passed the CGI object as an argument, so you can
use the CGI params to help you generate the value you need.</p>
<p class="tightenable bottom">Your subroutine should return a string containing the value you want.</p>
</blockquote>
<p class="tightenable">Notes on parsing of options attribute</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom">The options attribute has automagical Do What I Mean (DWIM) abilities.
You can give it a value which looks like a Perl list, a Perl hash, or a</p>
<dl><dt class="tightenable top">subroutine name. For instance</dt>
<dd class="tightenable"><p class="tightenable top">options=&quot;'red', 'green', 'blue'&quot;</p>
<p class="tightenable">options=&quot;'ff0000' =&gt; 'red', '00ff00' =&gt; 'green', '0000ff' =&gt; 'blue'&quot;</p>
<p class="tightenable bottom">options=&quot;get_colors()&quot;</p>
</dd>
</dl>
<p class="tightenable">How it works is that <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> looks for the =&gt; operator, and if it
finds it it evals the options string and assigns the result to a hash.
If it finds a comma (but no little =&gt; arrows) it figures it's a list,
and evals it and assigns the results to an array. Otherwise, it tries to
interpret what's there as the name of a subroutine in the scope of the
script that called <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u>, expecting to get back a value which is
either an arrayref or a hashref, which it will deal with appropriately
in either case.</p>
<p class="tightenable">A few gotchas to look out for:</p>
<ul><li class="tightenable">Make sure you quote strings in lists and hashes. &quot;red,blue,green&quot;
will fail (silently) because of the barewords.</li>
<li class="tightenable">Single-element lists (&quot;red&quot;) will fail because the DWIM parsing
doesn't find a comma there and treats it as the name of a
subroutine. But then, a single-element radio button group or select
dropdown is pretty meaningless anyway, so why would you do that?</li>
<li class="tightenable">Arrays will result in options being sorted in the same order they
were listed. Hashes will be sorted by value using the Perl's cmp()
function (ASCIIbetical sort, in other words).</li>
<li class="tightenable bottom">An anti-gotcha: subroutine names do not require the parens on them.
&quot;get_colors&quot; and &quot;get_colors()&quot; will work the same.</li>
</ul>
</blockquote>
</blockquote>
<p class="tightenable bottom">INTERNAL, DEVELOPER-ONLY ROUTINES</p>
<blockquote class="tightenable"><blockquote class="tightenable top"><p class="tightenable top bottom">The following routines are used internally by <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> and are
documented here as a developers' reference. If you are using <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u>
to develop web applications, you can skip this section entirely.</p>
</blockquote>
<p class="tightenable top">magic_wherenext</p>
<blockquote class="tightenable"><p class="tightenable top bottom">We allow FM users to set the &quot;wherenext&quot; param explicitly in their code,
to do branching of program logic. This routine checks to see if they
have a magic &quot;wherenext&quot; param and returns it. Gives undef if it's not
set.</p>
</blockquote>
<p class="tightenable">prepare_for_next_page</p>
<blockquote class="tightenable"><p class="tightenable top bottom">This does all the things needed before going on to the next page.
Specifically, it validates the data from this page, and then if
validation was successful it puts the current page onto the page stack
and then sets page_number to whatever page we should be visiting next.</p>
</blockquote>
<p class="tightenable">$fm-&gt;cleanup_checkboxes()</p>
<blockquote class="tightenable"><p class="tightenable top">Checkbox params only get passed around if they're checked. An unchecked
box doesn't send &quot;checkbox=0&quot; ... no, it just completely fails to send
anything at all. This is a PITA, as it's impossible to distinguish an
explicity unchecked box from one that never got seen at all.</p>
<p class="tightenable bottom">This subroutine is intended to clean up the mess, by checking the
checkboxes that were expected on the current page against what it
actually saw on the CGI parameters, and explicitly setting any missing
ones to 0.</p>
</blockquote>
<p class="tightenable">$fm-&gt;commit_session()</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Commits a session's details to disk, in the same way as <span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="Persistent..html" class="wiki">Persistent.</a></span>
Needed by cleanup_checkboxes().</p>
</blockquote>
<p class="tightenable">get_option_labels_and_values ($fieldinfo)</p>
<blockquote class="tightenable"><p class="tightenable top bottom">returns labels and values for fields that require them, by running a</p>
<dl><dt class="tightenable top">subroutine or whatever else is needed. Returns a hashref containing</dt>
<dd class="tightenable bottom">{ labels =&gt; \@options_labels, $vals =&gt; \@option_values }</dd>
</dl>
</blockquote>
<p class="tightenable">parse_options_attribute($options_field)</p>
<blockquote class="tightenable"><p class="tightenable top bottom">parses the options attibute from a field element and returns a reference
to either a hash or an array containing the relevant data to fill in a
select box or a radio group.</p>
</blockquote>
<p class="tightenable">do_external_routine($self, $routine, @optional_args)</p>
<blockquote class="tightenable bottom"><p class="tightenable top">Runs an external routine, for whatever purpose (filling in default
values of fields, validation, etc). If anything is in @optional_args,
the routine is called using those. If @optional_args is ommitted, then
$self-&gt;{cgi} is passed. Returns the return value of the routine, or
undef on failure. Also emits a warning (to your webserver's error log,
most likely) if it can't run the routine.</p>
<p class="tightenable">The routine is always called in the package which called <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u>
(usually <span><a href="main.html" class="wiki relation">main</a><span class="relation-symbol">::</span><a href="%2C.html" class="wiki">,</a></span> but possibly something else).</p>
<p class="tightenable bottom">The CGI object is passed to your routine, so you can do stuff like
$cgi-&gt;param(&quot;foo&quot;) to it to find out CGI parameters and so on.</p>
</blockquote>
</blockquote>
<p class="tightenable bottom">SEE ALSO</p>
<blockquote class="tightenable top"><p class="tightenable top"><span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3AUtils.html" class="wiki">FormMagick::Utils</a></span></p>
<p class="tightenable"><span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3AEvents.html" class="wiki">FormMagick::Events</a></span></p>
<p class="tightenable"><span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3ASetup.html" class="wiki">FormMagick::Setup</a></span></p>
<p class="tightenable"><span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3AL10N.html" class="wiki">FormMagick::L10N</a></span></p>
<p class="tightenable"><span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3AValidator.html" class="wiki">FormMagick::Validator</a></span></p>
<p class="tightenable bottom"><span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3AFAQ.html" class="wiki">FormMagick::FAQ</a></span></p>
</blockquote>
<p class="tightenable bottom">BUGS</p>
<blockquote class="tightenable top"><p class="tightenable top bottom">The validation attribute must be very carefully formatted, with spaces
between the names of routines but not between the arguments to a
routine. See description above.</p>
</blockquote>
<p class="tightenable bottom">AUTHOR</p>
<blockquote class="tightenable top"><p class="tightenable top">Kirrily &quot;Skud&quot; Robert &lt;skud@infotrope.net&gt;</p>
<p class="tightenable">Contributors:</p>
<p class="tightenable">Shane R. Landrum &lt;slandrum@turing.csc.smith.edu&gt;</p>
<p class="tightenable">James Ramirez &lt;jamesr@cogs.susx.ac.uk&gt;</p>
<p class="tightenable bottom">More information about <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> may be found at
<a href="http://sourceforge.net/projects/formmagick/" target="" class="namedurl"><span style="white-space: nowrap"><img src="images/http.png" alt="" class="linkicon" border="0" />http://sourceforge.net/projects/formmagick/</span></a></p>
</blockquote>
<p class="tightenable bottom">NAME</p>
<blockquote class="tightenable top"><p class="tightenable top bottom"><span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick.html" class="wiki">FormMagick</a></span> - esmith wrapper for <span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick.html" class="wiki">FormMagick</a></span></p>
</blockquote>
<p class="tightenable bottom">SYNOPSIS</p>
<blockquote class="tightenable top"><p class="tightenable top">use <span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick%3B.html" class="wiki">FormMagick;</a></span></p>
<p class="tightenable">my $f = new <span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick%28%29%3B.html" class="wiki">FormMagick();</a></span>
$f-&gt;display();</p>
<p class="tightenable bottom">my $f = new <span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick%28.html" class="wiki">FormMagick(</a></span> filename=&gt;'/some/path/to/script' );
$f-&gt;display();</p>
</blockquote>
<p class="tightenable bottom">DESCRIPTION</p>
<blockquote class="tightenable top"><p class="tightenable top"><span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick.html" class="wiki">FormMagick</a></span> is a wrapper for <span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick.html" class="wiki">FormMagick</a></span> which automatically
does all the things that we always want to do for the SMEServer manager.
These include:</p>
<ul><li class="tightenable">Turning off unwanted buttons (previous, reset)</li>
<li class="tightenable">Automatically clearing %ENV for taint-friendliness</li>
<li class="tightenable">Disabling uploads through CGI.pm and setting the MAX_POST size to
100KB.</li>
<li class="tightenable">Reading in <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> XML from the <strong>DATA</strong> section of the script</li>
</ul>
<p class="tightenable bottom">This last point is the most important one. In order to avoid having XML
files littering the filesystem, we have chosen to include them along
with the script which parses them. Your script will therefore look like</p>
<dl><dt class="tightenable top">this</dt>
<dd class="tightenable"><p class="tightenable top">my $fm = <span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick-%3Enew%28%29%3B.html" class="wiki">FormMagick-&gt;new();</a></span>
$fm-&gt;display();</p>
<ol><li class="tightenable">miscellaneous subroutines, etc</li>
</ol>
<p class="tightenable bottom"><strong>DATA</strong>
&lt;form ...&gt;</p>
<blockquote class="tightenable top bottom"><p class="tightenable top bottom">&lt;page ...&gt;</p>
<blockquote class="tightenable top bottom"><p class="tightenable top bottom">&lt;field ...&gt; ... &lt;/field&gt;
&lt;field ...&gt; ... &lt;/field&gt;
&lt;field ...&gt; ... &lt;/field&gt;</p>
</blockquote>
<p class="tightenable top bottom">&lt;/page&gt;
&lt;page ...&gt;</p>
<blockquote class="tightenable top bottom"><p class="tightenable top bottom">&lt;field ...&gt; ... &lt;/field&gt;
&lt;field ...&gt; ... &lt;/field&gt;
&lt;field ...&gt; ... &lt;/field&gt;</p>
</blockquote>
<p class="tightenable top bottom">&lt;/page&gt;</p>
</blockquote>
<p class="tightenable top bottom">&lt;/form&gt;</p>
</dd>
</dl>
<p class="tightenable bottom"><span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick.html" class="wiki">FormMagick</a></span> also provides certain convenience functions to assist
in writing <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> web panels.</p>
</blockquote>
<p class="tightenable bottom">METHODS</p>
<blockquote class="tightenable top"><p class="tightenable top">new()</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Creates a new <span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick.html" class="wiki">FormMagick</a></span> object. Takes an optional hash of</p>
<dl><dt class="tightenable top">arguments, including</dt>
<dd class="tightenable"><p class="tightenable top bottom">more_lexicons       a list of additional lexicon files to use
charset             the character set encoding of the lexicon files</p>
<blockquote class="tightenable top bottom"><p class="tightenable top bottom">(default is ISO-8859-1 (Latin1)).</p>
</blockquote>
</dd>
</dl>
<p class="tightenable">Notes on lexicon files:</p>
<p class="tightenable">By default, lexicons are read in from /etc/e-smith/locale/<b>/<u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u>
(general <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u>-internal phrases) and
/etc/e-smith/locale/</b>/$scriptpath (where $scriptpath is something like
etc/e-smith/web/functions/useraccounts. NB: any symlinks will be traced
to their source). You can append items to this list using the
more_lexicons argument. Later lexfiles override earlier ones.</p>
<p class="tightenable">For debugging purposes, $fm-&gt;{lexfiles} will tell you which files were
read in, and $fm-&gt;{original_xml} will show you the XML that was
generated by smushing those files together.</p>
<p class="tightenable">The script will also be parsed to look for the following special
coments, which are used to generate the navigation bar:</p>
<ol><li class="tightenable bottom">heading : Security # description : Remote access # navigation : 1000</li>
</ol>
<p class="tightenable top">1200</p>
<p class="tightenable">Note on character set encodings:</p>
<p class="tightenable bottom">Valid character sets are &quot;ISO-8859-1&quot;, &quot;US-ASCII&quot;, &quot;UTF-8&quot; and &quot;UTF-16&quot;.</p>
</blockquote>
<p class="tightenable">get_languages</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Override for <span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3Aget_languages.html" class="wiki">FormMagick::get_languages</a></span> to only return languages
which are installed on this server</p>
</blockquote>
<p class="tightenable">_filename</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Figures out the filename of the script being run, either from the
arguments or by looking at the perl special variable $0.</p>
</blockquote>
<p class="tightenable">_scriptname_from_filename</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Given a filename such as that found in $0, follows symlinks and figures
out the actual original filename. This is mostly used to turn
/etc/e-smith/web/panels/manager/cgi-bin/whatever into
/etc/e-smith/web/functions/whatever.</p>
</blockquote>
<p class="tightenable">_lexicon_filename_list</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Figures out the full filenames of all required i18n/l10n lexicons, and
returns them as a list.</p>
</blockquote>
<p class="tightenable">_read_lexicons</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Given a list of lexicon filenames, reads each of them in and returns
them as a concatenated string.</p>
</blockquote>
<p class="tightenable">$fm-&gt;_navigation_setup(%args)</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Sets up various properties related to the navigation menu, such as
heading/description/etc. You need to pass it the same args as were
passed to new(). It doesn't return anything.</p>
</blockquote>
<p class="tightenable">$fm-&gt;get_validation_attribute</p>
<blockquote class="tightenable"><p class="tightenable top bottom">This method overrides the one in <span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3AValidator.html" class="wiki">FormMagick::Validator</a></span> to forcibly
add &quot;nopipes&quot; to the list of validations performed.</p>
</blockquote>
<p class="tightenable">$fm-&gt;props_to_query_string()</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom">Given a hash of properties, turns them into a CGI query string. Useful
for if you need to pre-populate a form based on data from the accounts
or config database. See the table on the first page of the
&quot;useraccounts&quot; web function for an example.</p>
</blockquote>
</blockquote>
<p class="tightenable bottom">EXPORTED FUNCTIONS</p>
<blockquote class="tightenable bottom"><blockquote class="tightenable top"><p class="tightenable top bottom">The following exported functions may be used in your <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> scripts
and XML, for instance as page pre-events, validation routines, etc.</p>
</blockquote>
<p class="tightenable top">turn_off_buttons()</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Turns off <b>all</b> buttons. Useful if you want to replace the Next/Prev
style of navigation with something else.</p>
</blockquote>
<p class="tightenable">print_button('STRING')</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Given a string, prints a submit button with that string localised. For
instance, print_button('SAVE') will localise SAVE and put it onto the
button. This is used to replace the next/prev/etc buttons with custom
buttons.</p>
</blockquote>
<p class="tightenable">set_status_message($message)</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Sets the status message to be displayed at the top of the next page.</p>
</blockquote>
<p class="tightenable">print_status_message()</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Prints an status message on the first page, to give an indication of
success/failure of the previous step. Resets the status message to blank
and turns off all buttons as a side-effect.</p>
</blockquote>
<p class="tightenable">description</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Return the description entry read from the script, or &quot;Unknown&quot;</p>
</blockquote>
<p class="tightenable">heading</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Return the heading entry read from the script, or &quot;Unknown&quot;</p>
</blockquote>
<p class="tightenable">description_weight</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Return the description weight entry read from the script, or zero</p>
</blockquote>
<p class="tightenable">heading_weight</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Return the heading weight entry read from the script, or zero</p>
</blockquote>
<p class="tightenable">validate_password ($strength, $password)</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Checks the supplied password for security. Strength can be &quot;strong&quot;,
&quot;normal&quot; or &quot;none&quot;. A &quot;strong&quot; password passes the cracklib tests. A
&quot;normal&quot; password passes the tests in
<span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3AValidator%3A%3ANetwork%3A%3Apassword%2C.html" class="wiki">FormMagick::Validator::Network::password,</a></span> and &quot;none&quot; will accept
any password. An invalid argument for 'strength' is considered to be
'normal'.</p>
</blockquote>
<p class="tightenable bottom">validate_description ($description).</p>
</blockquote>
<p class="tightenable top">Checks the supplied description. Period is allowed in description</p>
<blockquote class="tightenable"><p class="tightenable top">nopipes</p>
<blockquote class="tightenable"><p class="tightenable top">Validation routine to ensure there are no pipe characters in a field.
This is necessary because we don't want them to end up in the esmith
configuration databases.</p>
<p class="tightenable bottom">Note that this validation routine is automatically added to every field,
so you do not have to call it explicitly.</p>
</blockquote>
<p class="tightenable">gen_locale_date_string</p>
<blockquote class="tightenable"><p class="tightenable top bottom">Generates a date string in the preferred format for the locale.</p>
</blockquote>
<p class="tightenable">success</p>
<blockquote class="tightenable"><p class="tightenable top">This method takes a lexicon tag as argument, optionally with a page name
as second argument (defaulting to 'First'), and sets the status message
to the lexicon tag, and sets the next page. To make use of this, the
page that the method is directing <u title="Empty link to: FormMagick" onmouseover="window.status=&quot;Empty link to: FormMagick&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">FormMagick</u> to should have, as
pre-event, the print_status_message method.</p>
<p class="tightenable bottom">This method simply factor's all of the results of successful operations,
and helps to ensure that all results end up in looping back to the start
page.</p>
</blockquote>
<p class="tightenable">error</p>
<blockquote class="tightenable bottom"><p class="tightenable top">This method is much like the above 'success' method, except it is
intended for display of error messages.</p>
<p class="tightenable bottom">It is currently identical to success(), but can be altered to yield
different results, like addition of red text, or logging of the error,
etc.</p>
</blockquote>
</blockquote>
<p class="tightenable bottom">SEE ALSO</p>
<blockquote class="tightenable top"><p class="tightenable top">the <span><a href="CGI.html" class="wiki relation">CGI</a><span class="relation-symbol">::</span><a href="FormMagick.html" class="wiki">FormMagick</a></span> manpage</p>
<p class="tightenable">the <span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3ATester.html" class="wiki">FormMagick::Tester</a></span> manpage</p>
<p class="tightenable bottom">the <span><a href="esmith.html" class="wiki relation">esmith</a><span class="relation-symbol">::</span><a href="FormMagick%3A%3ALexTester.html" class="wiki">FormMagick::LexTester</a></span> manpage</p>
</blockquote>
<p class="tightenable bottom">AUTHOR</p>
<blockquote class="tightenable top bottom"><p class="tightenable top">Mitel Networks Corporation</p>
<p class="tightenable bottom">See <a href="http://www.e-smith.org/" target="" class="namedurl"><span style="white-space: nowrap"><img src="images/http.png" alt="" class="linkicon" border="0" />http://www.e-smith.org/</span></a> for more information</p>
</blockquote>
</div>

<div id="footer">  <hr class="printer" noshade="noshade" />
<p class="editdate">Owner: &quot;gzartman&quot;  Last edited on November 5, 2004  7:31 pm by &quot;gzartman&quot;</p>
</div>

</div>
<!-- Add your Disclaimer here -->
</body>
</html>
