<h2>{i18n}Manage Field Ordering{/i18n}</h2>

{$master_form->render()}

{if $aFieldOrders}
<h3>{i18n}Existing ordering{/i18n}</h2>

<ul>
{foreach from=$aFieldOrders item=aRow}
{php}
$this->assign("oParentField", DocumentField::get($this->_tpl_vars['aRow']['parent_field_id']));
$this->assign("oChildField", DocumentField::get($this->_tpl_vars['aRow']['child_field_id']));
{/php}
  <li>
    {$oParentField->getName()}
<span class="descriptiveText">{i18n}controls the values available in{/i18n}</span> 
    {$oChildField->getName()}
</li>
{/foreach}
</ul>
{/if}

{ if $free_fields }

<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
{foreach from=$orderingargs item=v key=k}
  <input type="hidden" name="{$k}" value="{$v}" />
{/foreach}

<legend>{i18n}Order Fields{/i18n}</legend>

<div class="field">
<p class="descriptiveText">{i18n}The value of the field{/i18n}</p>
{entity_select entities=$parent_fields name="fParentFieldId"}
</div>

<div class="field">
<p class="descriptiveText">{i18n}controls the values of the following fields{/i18n}</p>
{entity_select entities=$free_fields name="fFreeFieldIds[]" multiple="yes"}
</div>

<div class="form_actions">
<input type="submit" name="submit" value="{i18n}Order{/i18n}" />
</div>
</fieldset>
</form>
{/if}


