<h2><img src="{if $config->get("ui/morphEnabled") == '1'}{$rootUrl}/skins/kts_{$config->get("ui/morphTo")}/title_bullet.png{else}{$rootUrl}/resources/graphics/title_bullet.png{/if}"/>{i18n}Edit Field{/i18n}:<br />{$oField->getName()}</h2>

<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
<legend>{i18n}Field properties{/i18n}</legend>
<input type="hidden" name="fFieldsetId" value="{$oFieldset->getId()}" />
<input type="hidden" name="fFieldId" value="{$oField->getId()}" />
<input type="hidden" name="action" value="editfieldobject" />
<table class="prettysw" cellpadding="0" cellspacing="0">
  <tr>
    <th>{i18n}Name{/i18n}</th>
    <td><input type="textbox" name="name" value="{$oField->getName()}"></td>
  </tr>
  <tr>
    <th>{i18n}Description{/i18n}</th>
    <td><textarea name="description">{$oField->getDescription()}</textarea></td>
  </tr>  
  <tr>
    <th>{i18n}Type{/i18n}</th>
    <td>{$oField->getType()}</td>
  </tr>
  <tr>
    <th>{i18n}Required{/i18n}</th>
    <td><input type="checkbox" name="is_required" {if ($oField->getIsMandatory())}checked="true"{/if} /></td>
  </tr>  
  
</table>

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

{if $oField->getHasLookup()}
{assign var="aEnabledMetadata" value=$oField->getEnabledValues()}
{assign var="aDisabledMetadata" value=$oField->getDisabledValues()}

<p class="descriptiveText">{i18n}Lookup fields may be composed of an arbitrary number of values. These values may be added to the Lookup field by entering them in below. If these values are being generated by, or synchronised to, an external datasource, toggling the <strong>Sticky</strong> attribute of a value will ensure that it will not be modified by changes in the external datasource list.{/i18n}</p> 

<h2>{i18n}Lookup Values{/i18n}</h2>

<form action="{$smarty.server.PHP_SELF}" method="POST">

<fieldset>
<legend>{i18n}Add new values{/i18n}</legend>

<input type="hidden" name="fFieldsetId" value="{$oFieldset->getId()}" />
<input type="hidden" name="fFieldId" value="{$oField->getId()}" />
<input type="hidden" name="action" value="addLookups" />

<input type="textbox" name="value" />
<input type="submit" name="submit" value="{i18n}Add{/i18n}" />

</fieldset>
</form>

{if $oField->getHasLookup() and $oField->getHasLookupTree()}
{assign var=iFieldId value=$oField->getId()}
<a href="{addQS}action=editTree&field_id={$iFieldId}&fFieldsetId={$oFieldset->getId()}{/addQS}">{i18n}Manage lookup tree{/i18n}</a>
{/if}

{if $aEnabledMetadata}

<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
<legend>{i18n}Existing values{/i18n}</legend>
<input type="hidden" name="fFieldsetId" value="{$oFieldset->getId()}" />
<input type="hidden" name="fFieldId" value="{$oField->getId()}" />
<input type="hidden" name="action" value="metadataMultiAction" />
<ul>
{foreach from=$aEnabledMetadata item=oMetaData}
  <li><label><input type="checkbox" name="metadata[]"
value="{$oMetaData->getId()}">{$oMetaData->getName()} 
{ if $oMetaData->getIsStuck() }
<span class="helpText">({i18n}stuck, will never be disabled when synchronising
from another source{/i18n})</span>
{ /if }</label>
{/foreach}
</ul>
<div class="form_actions">
<input type="submit" name="submit[disable]" value="{i18n}Disable{/i18n}" />
<input type="submit" name="submit[togglestickiness]" value="{i18n}Toggle stickiness{/i18n}" />
<input type="submit" name="submit[remove]" value="{i18n}Remove{/i18n}" />
</div>
</fieldset>
</form>
{/if}

{if $aDisabledMetadata}

<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
<legend>{i18n}Disabled values{/i18n}</legend>
<input type="hidden" name="fFieldsetId" value="{$oFieldset->getId()}" />
<input type="hidden" name="fFieldId" value="{$oField->getId()}" />
<input type="hidden" name="action" value="metadataMultiAction" />
<ul>
{foreach from=$aDisabledMetadata item=oMetaData}
  <li><label><input type="checkbox" name="metadata[]"
value="{$oMetaData->getId()}">{$oMetaData->getName()} 
{ if $oMetaData->getIsStuck() }
<span class="helpText">({i18n}stuck, will never be enabled when synchronising
from another source{/i18n})</span>
{ /if }</label>
{/foreach}
</ul>
<div class="form_actions">
<input type="submit" name="submit[enable]" value="{i18n}Enable{/i18n}" />
<input type="submit" name="submit[togglestickiness]" value="{i18n}Toggle stickiness{/i18n}" />
<input type="submit" name="submit[remove]" value="{i18n}Remove{/i18n}" />
</div>
</fieldset>
</form>
{/if}

{/if}
