.id
3045
.gutitle
jfield
.title
jfield
.file
.extension
.name
|/routinetype-generic|
.user_id
7
.notes
.body
<!---
Outputs a value in a way that will make it "effortlessly editable".
--->



<ensure variable="att.j" default=""><!--- this is not a full jParse string; it must fit the pattern "/table-id.field". --->
<var att.j = trim(lcase(att.j))>
<ensure variable="att.v" default=""><!--- the naked value - do not soup up with escapeMarkup(), etc - jfield will do this. --->
<ensure variable="att.type" default=""><!--- can override field type for editing purposes --->
<var att.type = trim(lcase(att.type))>
<ensure variable="att.update" value="0">
<if att.update NEQ 1><var att.update = 0></if>

<ensure variable="att.picwidth" value="120">
<ensure variable="att.max_height" value="#att.picwidth*1.66#">
<ensure variable="att.so_lastupdated" value="">

<ensure variable="att.label" value="">

<ensure variable="att.style" value="">

<var _update = att.update>

<var _otype = "">
<var _idstr = "">
<var _fname = "">
<if reFind("/([a-z]+(_[a-z]+)*)-([a-z]+(_[a-z]+)*|[0-9]+).([a-z]+(_[a-z]+)*)",att.j) EQ 0>
<!--- programmer specified an invalid jparse string! --->
<div class="jfield_error">
<div><b>jfield:</b> invalid jparse string "#escapeMarkup(att.j)#".</div>
<div>
jParse strings for jfields are like <b>/table-id.field</b>
</div>
</div>
<else>
<!--- determine _otype, _idstr and _fname from simple jParse string.
(this should be faster than actually jParsing it) --->
<var _str = att.j>
<var _str = replace(_str,"/","")>
<var _otype = listFirst(_str,"-")>
<var _str = listLast(_str,"-")>
<var _idstr = listFirst(_str,".")>
<var _fname = listLast(_str,".")>
</if>

<var _type = att.type>
<var _readonly = 0>
<var _types = "int,unsignedint,foreign_key,double,datetime,longtext,shorttext,gutitle,code"><!--- this list basically comes from the 7o getFieldDataType() function, plus a few extras. --->
<if _fname EQ "file">
<var _type = "file">
<var _readonly = 0>
<elseif _type EQ "">
<!--- determine type according to field name --->
<var _type = getFieldDataType(_fname)>
<!--- plus a few extra types... --->
<if _fname EQ "title" OR _fname EQ "name" OR _fname EQ "gutitle" OR _fname EQ "fentriss_approve">
<var _type = "shorttext">
<elseif _fname EQ "body">
<var _type = "code">
<elseif _otype EQ "docentry" AND listFindNoCase("example,required_params,optional_params",_fname) GT 0>
<var _type = "code">
<elseif _otype EQ "site" AND (_fname EQ "headerhtml" OR _fname EQ "siteheader" OR _fname EQ "sitefooter")>
<var _type = "code">
</if>
<!--- is it readonly? --->
<var _readonly = isReadOnlyField(_fname)>
<elseif listFind(_types,_type) EQ 0>
<!--- programmer specified an invalid type! --->
<div class="jfield_error">
<div><b>jfield:</b> cannot have a field of type "#escapeMarkup(_type)#".</div>
<div>
Valid types are: <loop list="#_types#" index="i"> #i# </loop>
</div>
</div>
<break>
</if>



<if _type EQ "file">
<if _otype EQ "user">
<var _f2 = "icon-2">
<elseif isDefined("att.f2") AND att.f2 NEQ "">
<var _f2 = att.f2>
<else>
<var _f2 = "site-#site_id#">
</if>
<if isNumeric(_idstr)>
<var _src = 'http://#this_domain#/?&f=#_otype#-#_idstr#&f2=#_f2#&picwidth=#att.picwidth#&so_lastupdated=#att.so_lastupdated#'>
<else>
<set orb="#_otype#" select="#_otype#.id" where="#_otype#.gutitle = '#_idstr#'" maxrows="1">
<var _src = 'http://#this_domain#/?&f=#_otype#-#set.id#&f2=#_f2#&picwidth=#att.picwidth#&so_lastupdated=#att.so_lastupdated#'>
</set>
</if>
<var _value = '<img src="#_src#" border="0" style="max-height:#att.max_height#px;">'>
<else>
<var _value = escapeMarkup(att.v)>
<var _value = replace(_value,CHR(10),'#CHR(10)#<br>','all')>
<var _value = replace(_value,CHR(9),'#CHR(9)#<span style="display:inline-block; width:4em;"></span>','all')>
</if>



<!--- Output element that will be souped-up by jfield_script! --->
<if _update EQ 1><var _update = "yes"><else><var _update = "no"></if>
<if _readonly EQ 1><var _readonly = "yes"><else><var _readonly = "no"></if>
<div id="#att.j#|#_type#-#_readonly#-#_update#"
title="#escapeDoubleQuotes(att.label)#"
style="position:relative;"
class="jfield jfieldtype_#_type# jfieldreadonly_#_readonly# jfieldupdate_#_update#">
<div class="jfield_view" style="#att.style#">#_value#</div>
<div class="jfield_edit" style="display:none;"></div>
</div>
 
.sum_double
0.00
.producttype
.productincludes
.physical_unsignedint
0
.isprotected_unsignedint
0
.overridesiteheader_unsignedint
0