Class PifaExporter
This class allows for exporting a PIFA form as XML. The exported file contains the structure of the form and its fields. Optionally the export file may contain the forms gathered data from its data table.
Example usage:
plugin_include('form_assistant', 'classes/class.pifa.exporter.php'); $exp = new PifaExporter(new PifaForm($idform)); $xml = $exp->export(false); Util::logDump($xml);
Copyright: four for business AG
Author: Marcus Gnaß <marcus.gnass@4fb.de>
Located at plugins/form_assistant/classes/class.pifa.exporter.php
public
|
#
__construct(
Create an instance. Creates PIFA form and XML writer member instances. |
public
string
|
|
private
|
#
_addForm(
Adds a "form" element containing one "field" elements for each defined PIFA field. |
private
|
#
_addField(
Adds a "field" element optionally containing "label", "help", "error", "rule", "classes" and "options" elements. |
private
|
|
private
|
#
_addHelp(
Adds an optional "help" element. As the help text is free text it will be stored as CDATA. |
private
|
#
_addError(
Adds an optional "error" element. As the error message is free text it will be stored as CDATA. |
private
|
#
_addRule(
Adds an optional "rule" element. As the rule is a regular expression it will be stored as CDATA. |
private
|
#
_addClasses(
Adds an optional "classes" element containing one "class" element for each defined class. |
private
|
#
_addOptions(
Adds an optional "options" element containing one "option" element for each defined option. |
private
|
#
_addData(
Adds an optional "data" element containing one "row" element for each record in the forms data table (gathered data). If the for has either no fields or its data table has no records, no "data" element will be added. |
private
string
|
#
_getFieldTypeName( integer $fieldTypeId )
Map a numeric PIFA field ID to a name that may be used as translatable token (i18n). |
private
|
$_form |
|
#
The PIFA form to export. |
private
|
$_writer |
|
#
The XML writer that is used to create the export XML file. |