<#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 "checked='checked'"> <#else> <#return ""> <#return ""> <#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 ""> <#-- -- 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">