[Rt-devel] PATCH Callbacks to customize components for CF Show/Edit

Todd Chapman todd at chaka.net
Fri May 5 12:54:58 EDT 2006


The attached patch allows callbacks to specify a
component to use for displaying and editing custom
fields.

Example: You have a text area CF that needs to be
a lot wider than normal. 

-Todd
-------------- next part --------------
==== Patch <cf_comp_callbacks> level 1
Source: 6fc35107-3207-0410-b21e-9a2d7f624572:/local/bp/rt/features/3.5_customfield_callback:6777
Target: e417ac7c-1bcc-0310-8ffa-8f5827389a85:/rt/branches/3.5-TESTING:5147
        (svn://svn.bestpractical.com)
Log:
 r6776 at slah001:  root | 2006-05-05 11:21:58 -0400
 Adding callback for ShowCustomField and EditCustomField so
 name of component to Show/Edit can be customized.
 r6777 at slah001:  root | 2006-05-05 12:42:32 -0400
 Callbacks to munge name of ShowCustomFields and EditCustomField.

=== html/Elements/EditCustomField
==================================================================
--- html/Elements/EditCustomField	(revision 5147)
+++ html/Elements/EditCustomField	(patch cf_comp_callbacks level 1)
@@ -69,8 +69,12 @@
 # we don't see a value later, since browsers aren't compelled to submit empty form fields
 $m->out("\n".'<input type="hidden" class="hidden" name="'.$NamePrefix.$CustomField->Id.'-Values-Magic" value="1" />'."\n");
 
+my $EditComponent = "EditCustomField$Type";
+$m->comp('/Elements/Callback', _CallbackName => 'EditComponentName', Name => \$EditComponent, CustomField => $CustomField, Object => $Object );
+$EditComponent = "EditCustomField$Type" unless $m->comp_exists($EditComponent);
+
 return $m->comp(
-    "EditCustomField$Type",
+    $EditComponent,
     %ARGS,
     Rows => $Rows,
     Cols => $Cols,
=== html/Elements/ShowCustomFields
==================================================================
--- html/Elements/ShowCustomFields	(revision 5147)
+++ html/Elements/ShowCustomFields	(patch cf_comp_callbacks level 1)
@@ -57,6 +57,7 @@
 <a href="<%$Value->LinkValueTo|n%>" target="_new">
 % }
 % my $comp = "ShowCustomField".$CustomField->Type;
+% $m->comp('/Elements/Callback', _CallbackName => 'ShowComponentName', Name => \$comp, CustomField => $CustomField, Object => $Object );
 % if ($m->comp_ex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