diff --git a/templates/ktcore/document/add.smarty b/templates/ktcore/document/add.smarty index 181def1..5e5830e 100644 --- a/templates/ktcore/document/add.smarty +++ b/templates/ktcore/document/add.smarty @@ -1,16 +1,12 @@ - - - -{literal} - +function document_type_changed() { + typeselect = getElement('add-document-type'); + getMetadataForType(typeselect.value); +} + +function startupMetadata() { + typeselect = getElement('add-document-type'); + addToCallStack(typeselect, "onchange", document_type_changed, false); + document_type_changed(); +} + +addLoadEvent(startupMetadata); {/literal} +{/capture} +{$context->oPage->requireJSStandalone($sJavascript)} -

Add a document

+

Add a document

+
Add a document + - - - - - - - - - - - - - - - - - -
Folder{" > "|join:$folder_path_array}
File
Title
Document Type{$document_type_choice}
+{foreach from=$add_fields item=oWidget } + {$oWidget->render()} +{/foreach}
-{$generic_metadata_fields} +{foreach item=oFieldset from=$generic_fieldsets} + {$oFieldset->renderEdit($document_data)} +{/foreach}
{$type_metadata_fields}
- +
+ +