<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration>
  <source>
    <entity id="e1" name="e1" label="Textfield"></entity>
    <entity id="e1r" name="e1r" label="Textfield" readonly="true" value="Foo"></entity>
    <entity id="e2" name="e2" label="Integer" type="integer"></entity>
    <entity id="e2r" name="e2r" label="Integer" type="integer" readonly="true" value="12345"></entity>
    <entity id="email" name="email" label="Email" type="email"></entity>
    <entity id="emailr" name="emailr" label="Email" type="email" readonly="true" value="mail@example.com"></entity>
    <entity id="e3" name="e3" label="Float" type="float"></entity>
    <entity id="e3r" name="e3r" label="Float" type="float" readonly="true" value="1.2345"></entity>
    <entity id="e4" name="e4" label="Textarea">
      <renderer type="textarea"/>
    </entity>
    <entity id="e4r" name="e4r" label="Textarea" readonly="true" value="Bar">
      <renderer type="textarea"/>
    </entity>
    <entity id="e5" name="e5" label="Datefield" type="date">
      <renderer type="datepicker"/>
    </entity>
    <entity id="e5r" name="e5r" label="Datefield" type="date" readonly="true" value="2014-05-20">
      <renderer type="datepicker"/>
    </entity>
    <entity id="e6" name="e6" label="Password">
      <renderer type="password"/>
    </entity>
    <entity id="e6r" name="e6r" label="Password" readonly="true" value="xxx">
      <renderer type="password"/>
    </entity>
    <entity id="e7" name="e7" label="Dropdown">
      <renderer type="dropdown"/>
      <options>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
      </options>
    </entity>
    <entity id="e7r" name="e7r" label="Dropdown" readonly="true" value="1">
      <renderer type="dropdown"/>
      <options>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
      </options>
    </entity>
    <entity id="e8" name="e8" label="Selection">
      <renderer type="selection"/>
      <options>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
      </options>
    </entity>
    <entity id="e8r" name="e8r" label="Selection" readonly="true" value="2">
      <renderer type="selection"/>
      <options>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
      </options>
    </entity>
    <entity id="e9" name="e9" label="Radio">
      <renderer type="radio"/>
      <options>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
      </options>
    </entity>
    <entity id="e9r" name="e9r" label="Radio" readonly="true" value="3">
      <renderer type="radio"/>
      <options>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
      </options>
    </entity>
    <entity id="e10" name="e10" label="Checkboxes">
      <renderer type="checkbox"/>
      <options>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
      </options>
    </entity>
    <entity id="e10r" name="e10r" label="Checkboxes" readonly="true" value="1">
      <renderer type="checkbox"/>
      <options>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
      </options>
    </entity>
    <entity id="e11" name="e11" label="Infofield" value="Calculated value">
      <renderer type="info"/>
    </entity>
    <entity id="e12" name="e12" label="Hiddenfield">
      <renderer type="hidden"/>
    </entity>
    <entity id="e13" name="e13" label="Readonly Textfield">
    </entity>
    <entity id="e13t" name="e13t" label="Edit readonly Textfield">
      <renderer type="dropdown"></renderer>
      <options>
        <option value="0">No</option>
        <option value="1">Yes</option>
      </options>
    </entity>
    <entity id="e14" name="e14" label="Hidden Textfield">
    </entity>
    <entity id="e14t" name="e14t" label="Show hidden Textfield">
      <renderer type="dropdown"></renderer>
      <options>
        <option value="0">No</option>
        <option value="1">Yes</option>
      </options>
    </entity>
    <entity id="showhiddenpage" name="showhiddenpage" label="Show hidden Page">
      <renderer type="dropdown"></renderer>
      <options>
        <option value="0">No</option>
        <option value="1">Yes</option>
      </options>
      <help>Setting the value to "yes" will add another page to the form. The
      page will be added dynamically to the navigation too.</help>
    </entity>
    <entity id="e15m" name="e15m" label="Men" type="integer">
    </entity>
    <entity id="e15w" name="e15w" label="Woman" type="integer">
    </entity>
    <entity id="e15t" name="e15t" label="Total" expr="$e15m + $e15w">
      <renderer type="info" />
    </entity>
    <entity id="e16" name="e16" label="Odd/Even Numbers">
      <renderer type="dropdown"></renderer>
      <options>
        <option value="1">Odd</option>
        <option value="2">Even</option>
      </options>
    </entity>
    <entity id="e17" name="e17" label="Select Numbers">
      <renderer type="dropdown" filter="( %e17 / $e16 )" remove_filtered="true"></renderer>
      <options>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">8</option>
        <option value="9">9</option>
        <option value="10">10</option>
      </options>
    </entity>
    <entity id="e18" name="e18" label="Enter a number" type="integer">
      <help>Number must not be greater 100</help>
      <rule expr="$e18 le 100" msg="You entered a number larger than 100"/>
    </entity>
    <entity id="labell" name="labell" label="Label of the left">
      <renderer>
        <label position="left"/>
      </renderer>
    </entity>
    <entity id="labelr" name="labelr" label="Label of the right">
      <renderer>
        <label position="right"/>
      </renderer>
    </entity>
    <entity id="labelt" name="labelt" label="Label on the top">
      <renderer>
        <label position="top"/>
      </renderer>
    </entity>
    <entity id="req" name="req" label="Required field" required="true"></entity>
    <entity id="des" name="des" label="Desired field" desired="true"></entity>
    <entity id="help" name="help" label="Helptexts">
      <help>Fields can have a small helptext to give some explaination on how
      to fill out the field.</help>
    </entity>
    <entity id="numbering" name="numbering" label="Numbering" number="F42"></entity>
    <entity id="html" name="html" label="HTML">
      <renderer type="html">
        <div>
          <p>The following image was inserted using the HTML option of formbar</p>
          <img src="http://intevation.de/images/graphics/intevation_logo_120.png"/>
        </div>
      </renderer>
    </entity>
    <entity id="table1" name="table1" label="" type="integer"/>
    <entity id="table2" name="table2" label="" type="integer"/>
    <entity id="table3" name="table3" label="" type="integer"/>
  </source>
  <form id="example" css="testcss" autocomplete="off" method="POST" action="" enctype="multipart/form-data">
    <snippet ref="s1"/>
  </form>
  <snippet id="s1">
    <page id="p1" label="Supported Fields">
      <text>Below you find a list of supported field elements in formbar. On
      the left side you the the editable version and on the right side the
      readonly version.</text>
      <fieldset label="Textfields">
      <row>
        <col><field ref="e1"/></col>
        <col><field ref="e1r"/></col>
      </row>
      <row>
        <col><field ref="e4"/></col>
        <col><field ref="e4r"/></col>
      </row>
      <row>
        <col><field ref="e6"/></col>
        <col><field ref="e6r"/></col>
      </row>
      </fieldset>
      <fieldset label="Supported formats in textfields">
      <row>
        <col><field ref="e2"/></col>
        <col><field ref="e2r"/></col>
      </row>
      <row>
        <col><field ref="e3"/></col>
        <col><field ref="e3r"/></col>
      </row>
      <row>
        <col><field ref="e5"/></col>
        <col><field ref="e5r"/></col>
      </row>
      <row>
        <col><field ref="email"/></col>
        <col><field ref="emailr"/></col>
      </row>
      </fieldset>
      <fieldset label="Selections">
      <row>
        <col><field ref="e7"/></col>
        <col><field ref="e7r"/></col>
      </row>
      <row>
        <col><field ref="e8"/></col>
        <col><field ref="e8r"/></col>
      </row>
      <row>
        <col><field ref="e9"/></col>
        <col><field ref="e9r"/></col>
      </row>
      <row>
        <col><field ref="e10"/></col>
        <col><field ref="e10r"/></col>
      </row>
      </fieldset>
      <fieldset label="Other">
      <row>
        <col><field ref="e11"/></col>
      </row>
      <row>
        <col><field ref="e12"/></col>
      </row>
      </fieldset>
    </page>
    <page id="p2" label="Field attributes">
      <fieldset label="Required and Desired fields">
        <row>
          <col><field ref="req"/></col>
          <col><field ref="des"/></col>
        </row>
      </fieldset>
      <fieldset label="Labeling">
        <text>Labels can be place left, right and on the top of the field.
        Additionally the labels can be aligned to the left and right side.</text>
        <row>
          <col><field ref="labell"/></col>
        </row>
        <row>
          <col><field ref="labelt"/></col>
        </row>
        <row>
          <col><field ref="labelr"/></col>
        </row>
      </fieldset>
      <fieldset label="Helptexts">
        <row>
          <col><field ref="help"/></col>
        </row>
      </fieldset>
      <fieldset label="Numbering">
        <text>Use the numbering feature to give the fields a unique human
        readable identifier to make it easier to reference to fields.</text>
        <row>
          <col><field ref="numbering"/></col>
        </row>
      </fieldset>
    </page>
    <page id="p3" label="Layouting">
      <fieldset label="Pages">
        <text>Forms can be seperated in pages. If so the form will get such an
        outline as you see on the left side.</text>
      </fieldset>
      <fieldset label="Sections">
        <text>Formbar supports sections up to three layers.</text>
        <section label="1. Section">
          <text>Section text</text>
          <subsection label="1.1 Sub-Section">
            <text>Sub-Section text</text>
            <subsubsection label="1.1.1 Subsub-Section">
              <text>Subsub-Section text</text>
            </subsubsection>
          </subsection>
        </section>
      </fieldset>
      <fieldset label="Fieldsets">
        <text>Formbar offers fieldsets in the same way as plain HTML does to
        group fields into logical groups.</text>
      </fieldset>
      <fieldset label="Rows and Cols">
        <text>Formbar uses the bootstrap grid system to laout the forms. It
        supports up to 12 cols per row. Width of the cols can be sized easily.
        Rows and cols can be nested to build complex layouts.</text>
        <row>
          <col><field ref="e8r"/></col>
          <col><field ref="e10r"/></col>
          <col><field ref="e1r"/></col>
        </row>
        <row>
          <col width="9"><field ref="e7r"/></col>
          <col width="3"><field ref="e1r"/></col>
        </row>
        <row>
          <col><field ref="e2r"/></col>
          <col><field ref="e4r"/></col>
        </row>
      </fieldset>
      <fieldset label="Text elements">
        <row>
          <col>
          <text color="">Default Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.lorem</text>
          </col>
          <col>
          <text color="info">Info Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
          <col>
          <text color="primary">Primary Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
        </row>
        <row>
          <col>
          <text color="warning">Warning Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
          <col>
          <text color="danger">Danger Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
          <col>
          <text color="Muted">Muted Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
        </row>
      </fieldset>
      <fieldset label="Text elements with background">
        <row>
          <col>
          <text bg="info">Info Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
          <col>
          <text bg="primary">Primary Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
        </row>
        <row>
          <col>
          <text bg="warning">Warning Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
          <col>
          <text bg="danger">Danger Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
        </row>
      </fieldset>
      <fieldset label="Text elements with emphasis">
        <row>
          <col>
          <text em="small">Small Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
          <col>
          <text em="em">Italic Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
          <col>
          <text em="strong">Strong Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
          et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
          no sea takimata sanctus est Lorem ipsum dolor sit amet.</text>
          </col>
        </row>
      </fieldset>
      <fieldset label="Tables">
        <text>Sometimes it is helpfull to render some fields in a table layout.</text>
        <table>
          <tr>
            <th>Question</th>
            <th>Dogs</th>
            <th>Cats</th>
            <th>Birds</th>
          </tr>
          <tr>
            <td width="70%">How many pets do you have at home</td>
            <td><field ref="table1"/></td>
            <td><field ref="table2"/></td>
            <td><field ref="table3"/></td>
          </tr>
        </table>
      </fieldset>
      <fieldset label="Custom HTML">
        <text>If all the above options for layouting does not fullfill your
        requirement, there is at least the option to define your own HTML
        code. This can be helpfull to e.g insert images</text>
        <row>
          <col><field ref="html"></field></col>
        </row>
      </fieldset>
    </page>
    <page id="p4" label="Dynamic elements">
      <fieldset label="Rules">
        <text>Rules are evaluated on form submission and can be used to check
        the validity of the submitted data.</text>
        <row>
          <col><field ref="e18"/></col>
        </row>
      </fieldset>
      <fieldset label="Conditionals">
        <row>
          <col><field ref="e13t"/></col>
          <col>
            <if expr="$e13t == 1" type="readonly">
              <field ref="e13"/>
            </if>
           </col>
        </row>
        <row>
          <col><field ref="e14t"/></col>
          <col>
            <if expr="$e14t == 1">
              <field ref="e14"/>
            </if>
           </col>
        </row>
        <row>
          <col>
            <field ref="showhiddenpage"/>
          </col>
        </row>
      </fieldset>
      <fieldset label="Calculations">
        <row>
          <col><field ref="e15m"/></col>
          <col><field ref="e15w"/></col>
          <col><field ref="e15t"/></col>
        </row>
      </fieldset>
    </page>
    <if expr="$showhiddenpage == 1">
      <page id="p5" label="Hidden Page">
        <text>This page is hidden as long as the user selects show hidden page.</text>
      </page>
    </if>
  </snippet>
</configuration>
