Skip to content

Commit 8ae190c

Browse files
author
Blair McKenzie
committed
cleanup display of filenames
1 parent 76414f2 commit 8ae190c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/formtools/image.cfc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
<cfproperty name="ftShowMetadata" type="boolean" default="false" hint="If this is set to false, the file size and dimensions of the current image are not displayed to the user" />
44
<cfproperty name="dbPrecision" type="string" default="640" />
55

6+
<cffunction name="edit" output="false" returntype="string">
7+
<cfargument name="typename" required="true" type="string" hint="The name of the type that this field is part of.">
8+
<cfargument name="stObject" required="true" type="struct" hint="The object of the record that this field is part of.">
9+
<cfargument name="stMetadata" required="true" type="struct" hint="This is the metadata that is either setup as part of the type.cfc or overridden when calling ft:object by using the stMetadata argument.">
10+
<cfargument name="fieldname" required="true" type="string" hint="This is the name that will be used for the form field. It includes the prefix that will be used by ft:processform.">
11+
12+
<cfset var html = super.edit(argumentCollection=arguments) />
13+
14+
<cfreturn rereplace(html, '<span class="image-filename">http%3A%2F%2F[^<]+%2F([^%]+)%2E(\w+)</span>', '<span class="image-filename">\1.\2</span>') />
15+
</cffunction>
16+
617
<cffunction name="ajax" output="false" returntype="string" hint="Response to ajax requests for this formtool">
718
<cfargument name="typename" required="true" type="string" hint="The name of the type that this field is part of.">
819
<cfargument name="stObject" required="true" type="struct" hint="The object of the record that this field is part of.">

0 commit comments

Comments
 (0)