{if $printTemplate} {* this is the xmlform template *}

{foreach from=$form->fields item=field} {if ($field->type==='title')}
{$field->field}
{elseif ($field->type==='subtitle')}
{$field->field} {if (isset($field->showHide) && $field->showHide)} Hide {/if}
{elseif ($field->type==='button') || ($field->type==='submit') || ($field->type==='reset')} {elseif ($field->type==='grid')}
{$field->field}
{elseif ($field->type==='checkbox') && ($field->labelOnRight)}
| {$field->field}
{elseif ($field->type==='phpvariable')} {elseif ($field->type==='private')} {elseif ($field->type==='javascript')} {elseif ($field->type==='pmconnection')} {elseif ($field->type==='hidden')}
{$field->field}
{elseif ($field->type==='')} {elseif ($field->withoutLabel)}
{$field->field}
{elseif (isset($field->withoutValue) && $field->withoutValue)}
{$field->label}
{else}
{if (isset($field->required)&&$field->required&&$field->mode==='edit')}* {/if}{$field->label} | width y=$form->labelWidth}" *}>{$field->field}
{/if} {/foreach}

{if $prevStep_label neq ''}
{/if} {foreach from=$form->fields item=field} {if ($field->type==='reset')}
{/if} {/foreach} {foreach from=$form->fields item=field} {if ($field->type==='button')}
{/if} {/foreach} {foreach from=$form->fields item=field} {if ($field->type==='submit')}
{/if} {/foreach}
| {$field->field} | {$field->field} | {$field->field}

{if $hasRequiredFields}
* {php}echo (G::LoadTranslation('ID_REQUIRED_FIELD'));{/php}
{/if}
{foreach from=$form->fields item=field} {if ($field->type==='javascript')}
{/if} {/foreach} {/if} {if $printJSFile} {* TODO: include file='xmlformScript.html' *} var form_{$form->id}; var object_{$form->name}; var i; if (typeof(__aObjects__) === 'undefined') {literal}{{/literal} var __aObjects__ = []; {literal}}{/literal} function loadForm_{$form->id}(ajaxServer) {literal}{{/literal} if (typeof(G_Form)==='undefined') return alert('form.js was not loaded'); form_{$form->id}=new G_Form(document.getElementById('{$form->id}'),'{$form->id}'); object_{$form->name} = form_{$form->id}; __aObjects__.push(object_{$form->name}); var myForm=form_{$form->id}; if (myForm.aElements===undefined) alert("{$form->name}"); myForm.ajaxServer=ajaxServer; //{$form->ajaxSubmit} {if isset($form->ajaxSubmit) && ($form->ajaxSubmit)} {literal} var sub = new leimnud.module.app.submit({ form : myForm.element,{/literal} inProgress: {$form->in_progress}, callback: {$form->callback} {literal} }); sub.sendObj = false; {/literal} {/if} {foreach from=$form->fields item=field key=name} i = myForm.aElements.length; {if (($field->type==='dropdown') || $field->type==='listbox')} myForm.aElements[i] = new G_DropDown(myForm, myForm.element.elements['form[{$name}]'],'{$name}'); myForm.aElements[i].setAttributes({$field->getAttributes()}); {$field->attachEvents("myForm.aElements[i].element")} {elseif ($field->type==='text')} myForm.aElements[i] = new G_Text(myForm, myForm.element.elements['form[{$name}]'],'{$name}'); myForm.aElements[i].setAttributes({$field->getAttributes()}); //alert('{$field->getAttributes()}'); {$field->attachEvents("myForm.aElements[i].element")} {elseif ($field->type==='percentage')} myForm.aElements[i] = new G_Percentage(myForm, myForm.element.elements['form[{$name}]'],'{$name}'); myForm.aElements[i].setAttributes({$field->getAttributes()}); {$field->attachEvents("myForm.aElements[i].element")} {elseif ($field->type==='currency')} myForm.aElements[i] = new G_Currency(myForm, myForm.element.elements['form[{$name}]'],'{$name}'); myForm.aElements[i].setAttributes({$field->getAttributes()}); {$field->attachEvents("myForm.aElements[i].element")} {elseif ($field->type==='textarea')} myForm.aElements[i] = new G_TextArea(myForm, myForm.element.elements['form[{$name}]'],'{$name}'); myForm.aElements[i].setAttributes({$field->getAttributes()}); {$field->attachEvents("myForm.aElements[i].element")} {elseif ($field->type==='date')} myForm.aElements[i] = new G_Date(myForm, myForm.element.elements['form[{$name}]'],'{$name}'); myForm.aElements[i].setAttributes({$field->getAttributes()}); myForm.aElements[i].mask = 'yyyy-mm-dd'; {$field->attachEvents("myForm.aElements[i].element")} {elseif ($field->type==='hidden')} myForm.aElements[i] = new G_Text(myForm, myForm.element.elements['form[{$name}]'],'{$name}'); myForm.aElements[i].setAttributes({$field->getAttributes()}); {$field->attachEvents("myForm.aElements[i].element")} {elseif ($field->type==='grid')} myForm.aElements[i] = new G_Grid(myForm, '{$name}'); grid_{$field->id}(myForm.aElements[i]); grid_{$name} = myForm.aElements[i]; {$field->attachEvents("myForm.aElements[i].element")} {else} var element = getField("{$name}"); {$field->attachEvents("element")} {/if} {/foreach} {foreach from=$form->fields item=field key=name} {if isset($field->dependentFields) && ($field->dependentFields!='')} {if ($field->type==='dropdown')} myForm.getElementByName('{$name}').setDependentFields('{$field->dependentFields}'); {elseif ($field->type==='text')} myForm.getElementByName('{$name}').setDependentFields('{$field->dependentFields}'); {elseif ($field->type==='percentage')} myForm.getElementByName('{$name}').setDependentFields('{$field->dependentFields}'); {elseif ($field->type==='currency')} myForm.getElementByName('{$name}').setDependentFields('{$field->dependentFields}'); {elseif ($field->type==='date')} myForm.getElementByName('{$name}').setDependentFields('{$field->dependentFields}'); {/if} {/if} {/foreach} {literal}}{/literal} {/if} {if $printJavaScript} leimnud.event.add(window,'load',function(){literal}{{/literal}loadForm_{$form->id}('{$form->ajaxServer}');if (typeof(dynaformOnload) !== 'undefined') {literal}{dynaformOnload();}}{/literal}); {/if}