Well, what i'm about to explain here, can change with updates, but until now, everything works for me
ok
this is something like the bad guys try to do in some web sites, sql inject. but here we're going to inject html
diving into include/sugarfields/fields/ i became aware that I can deduct advantage from certain lines
for example, in include/sugarfields/fields/base we can see something like this:
size='{{$displayParams.size|default:30}}'
so, if we want to apply some style to a textfield, or make it read only, we can do something like this in editvewdef.php
with this '\' we closed the size property and now we have the way open for us, in the style property we just need the 1st (\'), cuz sugarfield will close it for usPHP Code:'dispalyParams' =>
array (
'size' => '\' onkeypress="return false;" style=\'background-color:#C9C9C9',
),
but we can do more with this, we can chose to put or not a property
in some fields declaration is little diferent, instead of using (') uses ("), but is the samePHP Code:'dispalyParams' =>
array (
'size' => '\' {if empty($fields.name.value)}onchange\'setNoSS();{else}onkeypress="return false;" style=\'background-color:#C9C9C9{/if}',
),
maybe this is nothing for you, but this has helped me with my work


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks