From SME Server
PythonIcon.png Skill level: Developer
Risk of inconsistencies with Koozali SME Server methodology, upgrades & functionality is high. One must be knowledgeable about how changes impact their Koozali SME Server. Significant risk of irreversible harm.


      CGI::FormMagick::Setup - setup/initialisation routines for FormMagick

In a root terminal you can do the command below if you want to display the up-to-date content

perldoc CGI::FormMagick::Setup


        use CGI::FormMagick;



default source filename to the same as the perl script, with .xml extension


Parses the XML input, setting $fm->{xml} to a usable hash of the form elements, and $fm->{lexicon} to a hash of the l10n lexicon.

The $fm->{xml} hash has the following form:

              ’form’ => {
                  ’post-event’ => ’submit_order’,
                  ’title’ => ’FormMagick demo application’
              ’pages’ => [
                       ’post-event’ => ’lookup_group_info’,
                       ’fields’ => [
                               ’type’ => ’text’,
                               ’id’ => ’firstname’,
                               ’validation’ => ’nonblank’,
                               ’label’ => ’first name’
                               ’type’ => ’text’,
                               ’id’ => ’lastname’,
                               ’validation’ => ’nonblank’,
                               ’label’ => ’last name’
                               ’type’ => ’fragment’,
                               ’content’ => ’This is a simple fragment’
                               ’type’ => ’subroutine’,
                               ’src’ => ’fragment_subroutine_name()’
                       ’name’ => ’Personal’,
                       ’title’ => ’Personal details’

Note on lexicon files: If FormMagick was given a charset argument, then the output will be encoded in that character set. Otherwise, it will be in UTF-8.


Given a messy field list (as seen as @page_fields in parse_xml()), removes extraneous data and returns a clean list.

clean_page_list(\@form_elements, \%form_attributes)

Given a messy list of form elements (as seen as @form_elements in parse_xml()), removes extraneous data and returns: 1) a clean list of pages in the form, and 2) a lexicon hash.


Cleans up XML by removing superfluous stuff. Given an array of XML, returns a cleaner array.


Figures out where the session tokens should be kept.