<#macro directoryCreateForm entry is_searchable=true is_exportable=true> <@tform action='jsp/admin/plugins/directory/DoCreateEntry.jsp#list'>
<@formGroup labelFor='entry_type' labelKey='#i18n{directory.create_entry.label_type}'> <@tag color='info' title='#i18n{directory.create_entry.label_type}'>#i18n{${entry.entryType.titleI18nKey}} <@formGroup labelFor='title' labelKey='#i18n{directory.create_entry.label_title}' helpKey='#i18n{directory.create_entry.label_title_comment}' mandatory=true> <@input type='text' name='title' id='title' maxlength=255 /> <@formGroup> <@checkBox labelFor='mandatory' labelKey='#i18n{directory.create_entry.label_mandatory}' name='mandatory' id='mandatory' value='1' checked=getChecked('mandatory',list_param_default_values) /> <#nested> <@formGroup labelFor='help_message' labelKey='#i18n{directory.create_entry.label_help_message}' helpKey='#i18n{directory.create_entry.label_help_message_comment}'> <@input type='textarea' name='help_message' id='help_message' rows=2> <#if is_searchable> <@formGroup labelFor='help_message_search' labelKey='#i18n{directory.create_entry.label_help_message_search}' helpKey='#i18n{directory.create_entry.label_help_message_search_comment}'> <@input type='textarea' name='help_message_search' id='help_message_search' rows=2>
<#if is_searchable> <@formGroup helpKey='#i18n{directory.create_entry.label_indexed_comment}'> <@checkBox labelFor='indexed' labelKey='#i18n{directory.create_entry.label_indexed}' name='indexed' id='indexed' value='1' checked=getChecked('indexed',list_param_default_values) /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_advanced_search_comment}'> <@checkBox labelFor='shown_in_advanced_search' labelKey='#i18n{directory.create_entry.label_shown_in_advanced_search}' name='shown_in_advanced_search' id='shown_in_advanced_search' value='1' checked=getChecked('shown_in_advanced_search',list_param_default_values) /> <@formGroup> <@checkBox labelFor='indexed_as_title' labelKey='#i18n{directory.create_entry.label_indexed_as_title}' name='indexed_as_title' id='indexed_as_title' value='1' checked=getChecked('indexed_as_title',list_param_default_values) /> <@formGroup> <@checkBox labelFor='indexed_as_summary' labelKey='#i18n{directory.create_entry.label_indexed_as_summary}' name='indexed_as_summary' id='indexed_as_summary' value='1' checked=getChecked('indexed_as_summary',list_param_default_values) /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_result_list_comment}'> <@checkBox labelFor='shown_in_result_list' labelKey='#i18n{directory.create_entry.label_shown_in_result_list}' name='shown_in_result_list' id='shown_in_result_list' value='1' checked=getChecked('shown_in_result_list',list_param_default_values) /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_result_record_comment}'> <@checkBox labelFor='shown_in_result_record' labelKey='#i18n{directory.create_entry.label_shown_in_result_record}' name='shown_in_result_record' id='shown_in_result_record' value='1' checked=getChecked('shown_in_result_record',list_param_default_values) /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_history_comment}'> <@checkBox labelFor='shown_in_history' labelKey='#i18n{directory.create_entry.label_shown_in_history}' name='shown_in_history' id='shown_in_history' value='1' checked=getChecked('shown_in_history',list_param_default_values) /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_export_comment}'> <@checkBox labelFor='shown_in_export' labelKey='#i18n{directory.create_entry.label_shown_in_export}' name='shown_in_export' id='shown_in_export' value='1' checked=getChecked('shown_in_export',list_param_default_values) /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_completeness_comment}'> <@checkBox labelFor='shown_in_completeness' labelKey='#i18n{directory.create_entry.label_shown_in_completeness}' name='shown_in_completeness' id='shown_in_completeness' value='1' checked=getChecked('shown_in_completeness',list_param_default_values) /> <@formGroup labelFor='comment' labelKey='#i18n{directory.create_entry.label_comment}'> <@input type='textarea' name='comment' rows=2>
<@formGroup> <@button type='submit' name='save' buttonIcon='save' title='#i18n{directory.create_entry.button_save}' size='' /> <@aButton href='jsp/admin/plugins/directory/ModifyDirectory.jsp?id_directory=${entry.directory.idDirectory}' name='cancel' buttonIcon='remove' title='#i18n{directory.create_entry.button_cancel}' size='' color='btn-secondary' /> <#macro directoryModifyForm entry is_searchable=true is_exportable=true> <@tform action='jsp/admin/plugins/directory/DoModifyEntry.jsp#list'>
<@formGroup labelFor='entry_type' labelKey='#i18n{directory.create_entry.label_type}'> <@tag color='info' title='#i18n{directory.create_entry.label_type}'>#i18n{${entry.entryType.titleI18nKey}} <@formGroup labelFor='title' labelKey='#i18n{directory.create_entry.label_title}' helpKey='#i18n{directory.create_entry.label_title_comment}' mandatory=true> <@input type='text' name='title' id='title' value=entry.title maxlength=255 /> <@formGroup> <@checkBox labelFor='mandatory' labelKey='#i18n{directory.create_entry.label_mandatory}' name='mandatory' id='mandatory' value='1' checked=entry.mandatory /> <#nested> <@formGroup labelFor='help_message' labelKey='#i18n{directory.create_entry.label_help_message}' helpKey='#i18n{directory.create_entry.label_help_message_comment}'> <@input type='textarea' name='help_message' id='help_message' rows=2>${entry.helpMessage!''} <#if is_searchable> <@formGroup labelFor='help_message_search' labelKey='#i18n{directory.create_entry.label_help_message_search}' helpKey='#i18n{directory.create_entry.label_help_message_search_comment}'> <@input type='textarea' name='help_message_search' id='help_message_search' rows=2>${entry.helpMessageSearch!''}
<#if is_searchable> <@formGroup helpKey='#i18n{directory.create_entry.label_indexed_comment}'> <@checkBox labelFor='indexed' labelKey='#i18n{directory.create_entry.label_indexed}' name='indexed' id='indexed' value='1' checked=entry.indexed /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_advanced_search_comment}'> <@checkBox labelFor='shown_in_advanced_search' labelKey='#i18n{directory.create_entry.label_shown_in_advanced_search}' name='shown_in_advanced_search' id='shown_in_advanced_search' value='1' checked=entry.shownInAdvancedSearch /> <@formGroup> <@checkBox labelFor='indexed_as_title' labelKey='#i18n{directory.create_entry.label_indexed_as_title}' name='indexed_as_title' id='indexed_as_title' value='1' checked=entry.indexedAsTitle /> <@formGroup> <@checkBox labelFor='indexed_as_summary' labelKey='#i18n{directory.create_entry.label_indexed_as_summary}' name='indexed_as_summary' id='indexed_as_summary' value='1' checked=entry.indexedAsSummary /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_result_list_comment}'> <@checkBox labelFor='shown_in_result_list' labelKey='#i18n{directory.create_entry.label_shown_in_result_list}' name='shown_in_result_list' id='shown_in_result_list' value='1' checked=entry.shownInResultList /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_result_record_comment}'> <@checkBox labelFor='shown_in_result_record' labelKey='#i18n{directory.create_entry.label_shown_in_result_record}' name='shown_in_result_record' id='shown_in_result_record' value='1' checked=entry.shownInResultRecord /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_history_comment}'> <@checkBox labelFor='shown_in_history' labelKey='#i18n{directory.create_entry.label_shown_in_history}' name='shown_in_history' id='shown_in_history' value='1' checked=entry.shownInHistory /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_export_comment}'> <@checkBox labelFor='shown_in_export' labelKey='#i18n{directory.create_entry.label_shown_in_export}' name='shown_in_export' id='shown_in_export' value='1' checked=entry.shownInExport /> <@formGroup helpKey='#i18n{directory.create_entry.label_shown_in_completeness_comment}'> <@checkBox labelFor='shown_in_completeness' labelKey='#i18n{directory.create_entry.label_shown_in_completeness}' name='shown_in_completeness' id='shown_in_completeness' value='1' checked=entry.shownInCompleteness /> <@formGroup labelFor='comment' labelKey='#i18n{directory.create_entry.label_comment}'> <@input type='textarea' name='comment' rows=2>${entry.comment!''}
<@formGroup> <@button type='submit' name='save' buttonIcon='save' title='#i18n{directory.create_entry.button_save}' size='' /> <@aButton href='jsp/admin/plugins/directory/ModifyDirectory.jsp?id_directory=${entry.directory.idDirectory}' name='cancel' buttonIcon='remove' title='#i18n{directory.create_entry.button_cancel}' size='' color='btn-secondary' /> <#function getName code reference_list> <#if reference_list?has_content> <#list reference_list as reference_item> <#if reference_item.code = code> <#return reference_item.name> <#return ""> <#function getChecked code reference_list> <#if reference_list?has_content> <#list reference_list as reference_item> <#if reference_item.code = code> <#if reference_item.checked> <#return true> <#else> <#return false> <#return false> <#-- -- Get the field from a given title -- @param entry the entry -- @param fieldTitle the title -- @return the field --> <#function getField entry fieldTitle> <#if entry.fields?? && entry.fields?has_content> <#list entry.fields as field> <#if field?? && field.title?? && field.title == fieldTitle> <#return field> <#-- -- Get the field value from a given entry and a given title -- @param entry the entry -- @param fieldTitle the title -- @return the field --> <#function getFieldValue entry fieldTitle> <#if getField( entry, fieldTitle )??> <#assign field = getField( entry, fieldTitle )> <#return field.value> <#return ""> <#-- -- Get the max files value of an entry -- @param entry the entry -- @return the number of max authorized uploaded files --> <#function getMaxFiles entry> <#assign fieldMaxFiles = getFieldValue( entry, "max_files" )> <#if fieldMaxFiles?? && fieldMaxFiles != ""> <#return fieldMaxFiles> <#return "1"> <#-- -- Get the max size an uploaded file is authorized to have -- @param entry the entry -- @return the max size --> <#function getFileMaxSize entry> <#assign fieldFileMaxSize = getFieldValue( entry, "file_max_size" )> <#if fieldFileMaxSize?? && fieldFileMaxSize != ""> <#return fieldFileMaxSize> <#else> <#if getField( entry, "option" )??> <#assign fieldFileMaxSize = getField( entry, "option" )> <#return fieldFileMaxSize.width> <#return "5242880"> <#-- -- Get the authorized file types -- @param entry the entry -- @return the file types --> <#function getFileTypes entry> <#assign fieldFileTypes = getFieldValue( entry, "option" )> <#if fieldFileTypes?? && fieldFileTypes != ""> <#return fieldFileTypes> <#return "*">