{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/Base.js')}
{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/Async.js')}
{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/Iter.js')}
{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/DateTime.js')}
{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/DOM.js')}

<!-- unforunate, but (currently) necessary -->

{$context->oPage->requireJSResource('resources/js/taillog.js')}
{$context->oPage->requireJSResource('resources/js/conditional_usage.js')}

{$context->oPage->requireCSSResource('resources/css/kt-treewidget.css')}

<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 Metadata{/i18n}:<br />{$context->oDocument->getName()}</h2>

{capture assign=link}{addQS}action=selectType&fDocumentId={$document->getId()}{/addQS}{/capture}
<p class="descriptiveText">{i18n arg_link=$link}Change the <strong><a href="#link#">document type</a></strong>{/i18n}</p>

<p class="descriptiveText">{i18n}The following document metadata is available for editing.{/i18n}</p>

<form method="POST">
  
<input type="hidden" name="fDocumentId" value="{$document->getId()}" />
<input type="hidden" name="action" value="update" />
<input type="hidden" name="newType" value="{$newType}" />

{foreach item=oFieldset from=$fieldsets}
    {$oFieldset->renderEdit($document_data)}
{/foreach}

<div class="form_actions">
    <input class="save" type="submit" value="{i18n}Save Changes{/i18n}" />
    <input type="submit" name="kt_cancel[{addQS}fDocumentId={$context->oDocument->getId()}{/addQS}]" value="{i18n}Cancel{/i18n}" />
</div>

{*
<table id="brad-log">
<tbody>
</tbody>
</table>

*}