<%perl> my $rightText = $m->scomp( '/widgets/profile/imageSubmit.mc', formName => "theForm", callback => $widget . "|trail_cb", image => "view_trail_teal" ) . ' '; $rightText .= $m->scomp( '/widgets/profile/imageSubmit.mc', formName => "theForm", callback => $widget . "|notes_cb", value => 'edit', image => %{ $fa->get_notes } ? 'note_fill' : "note" ); $m->comp("/widgets/wrappers/sharky/table_top.mc", caption => "Information", number => 1, rightText => $rightText );
Asset Type:   <% $fa->get_element_name %>
Template Name:   <% $fa->get_name %>
Output Channel:   <% $fa->get_output_channel_name %>
URI:   <% $fa->get_uri %>
<& '/widgets/profile/displayFormElement.mc', objref => $fa, key => 'priority', &> <& '/widgets/select_object/select_object.mc', object => 'category', field => 'uri', sort_field => 'uri', name => 'category_id', disp => 'Category', selected => $fa->get_category_id &> <& '/widgets/profile/displayFormElement.mc', objref => $fa, key => 'description', &> <& '/widgets/profile/displayFormElement.mc', objref => $fa, key => 'expire_date', &> <& '/widgets/wrappers/sharky/table_bottom.mc' &> <& /widgets/wrappers/sharky/table_top.mc, caption => 'Template Code', number => 2 &> % if ($at) { % if (@{$at->get_data}) { % } % if (@{$at->get_containers}) { % }
align="right" class=medHeader>Element:  > <% $at->get_name %> <% $show_element_flags->($at) %>
Data Elements:  % my $comma = ''; % foreach my $d ($at->get_data) { <% $comma %> <% $fmt_name->($d->get_name) %> <% $show_data_flags->($d) %> % $comma = ', '; % }
Container Elements:  % my $comma = ''; % foreach my $c ($at->get_containers) { <% $comma %> <% $fmt_name->($c->get_name) %> <% $show_subelement_flags->($at, $c) %> % $comma = ', '; % }
% }
<& '/widgets/profile/textarea.mc', 'name' => $widget.'|code', 'value' => $fa->get_data, 'cols' => ($agent->{browser} eq "Internet Explorer") ? 60 : 72, 'rows' => 20 , 'useTable' => 0 &>
<& /widgets/wrappers/sharky/table_bottom.mc &> <%perl> $m->comp("/widgets/profile/buttonBar.mc", widget => $widget, desks => $desks, cd => $cd, obj => $fa, ); <%args> $widget <%init> my $fa = get_state_data($widget, 'fa'); my $at = $fa->get_element; # Use the same reset key for this widget in all the widgets we call. my $rk = get_state_data($widget, 'reset_key'); # Get the workflow ID. my $wf_id = get_state_data($widget, 'work_id') || $fa->get_workflow_id(); # Lookup the workflow and get its allowed desks. my $wf = Bric::Biz::Workflow->lookup({id => $wf_id}); my $desks = $wf->allowed_desks(); # Get the current desk, or if this hasn't been put on a desk yet, the start desk my $cd = $fa->get_current_desk() || $wf->get_start_desk(); # Set up a formatting variable my $agent = $m->comp("/widgets/util/detectAgent.mc"); my $infoIndent = ($agent->{browser} eq "Netscape") ? FIELD_INDENT - 5 : FIELD_INDENT + 8; <%once> my $fmt_name = sub { my ($name) = @_; # Lowercase the name and replace non-alphanumeric characters ($name = lc $name) =~ y/a-z0-9/_/cs; return $name; }; my $show_element_flags = sub { my ($at) = @_; my @flags; push @flags, 'paginated' if $at->get_paginated; push @flags, 'top level' if $at->get_top_level; push @flags, 'fixed url' if $at->get_fixed_url; push @flags, 'media' if $at->is_media; push @flags, 'related media' if $at->is_related_media; push @flags, 'related story' if $at->is_related_story; if (scalar @flags) { return ' ('.join(', ', @flags).')'; } else { return; } }; my $show_data_flags = sub { my ($d) = @_; my @flags; push @flags, 'required' if $d->get_required; push @flags, 'repeatable' if $d->get_quantifier; if (scalar @flags) { return ' ('.join(', ', @flags).')'; } else { return; } }; my $show_subelement_flags = sub { my ($at, $c) = @_; my @flags; push @flags, 'repeatable' if $at->is_repeatable($c); if (scalar @flags) { return ' ('.join(', ', @flags).')'; } else { return; } };