<#-- -- 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"> <#-- -- Check if the given entry must export the binary -- @param entry the entry -- @return true if it must export the binaries, false otherwise --> <#function exportBinary entry> <#assign field = getFieldValue( entry, "export_binary" ) /> <#if field?? && field = "true"> <#return true /> <#return false />