package HTML::Mason::Commands; use strict; use vars qw($m $r); my $_escape = \&HTML::Mason::Parser::_escape_perl_expression; HTML::Mason::Component::FileBased->new ( 'code'=>sub { my %ARGS; if (@_ % 2 == 0) { %ARGS = @_ } else { die "Odd number of parameters passed to component expecting name/value pairs" } my $widget = (!exists $ARGS{'widget'} ? die "no value sent for required parameter 'widget'" : $ARGS{'widget'}); my $_out = $m->current_sink; $m->debug_hook($m->current_comp->path) if (%DB::); my $fa = get_state_data($widget, 'fa'); my $cat_name = $fa->get_category_name; my $oc_name = $fa->get_output_channel_name; my $code = $fa->get_data; $code =~ s//>/g; my $agent = $m->comp("/widgets/util/detectAgent.mc"); my $infoIndent = ($agent->{browser} eq "Netscape") ? FIELD_INDENT - 5 : FIELD_INDENT + 8; my $rightText = $m->scomp( '/widgets/profile/imageSubmit.mc', formName => "theForm", callback => $widget . "|notes_cb", value => 'view', image => "view_notes_teal" ); $rightText .= $m->scomp( '/widgets/profile/imageSubmit.mc', formName => "theForm", callback => $widget . "|trail_cb", image => "view_trail_teal" ); $m->comp("/widgets/wrappers/sharky/table_top.mc", caption => "Information", number => 1, rightText => $rightText); $_out->('
Asset Type:   '); $_out->( $fa->get_name ); $_out->('
Template Name:   '); $_out->( $fa->get_name ); $_out->('
Description:   '); $_out->( $fa->get_description ); $_out->('
Output Channel:   '); $_out->( $oc_name ); $_out->('
Category:   '); $_out->( $cat_name ); $_out->('
'); $m->comp("/widgets/wrappers/sharky/table_bottom.mc"); $_out->(' '); $m->comp("/widgets/wrappers/sharky/table_top.mc", caption => "Template Code", number => 2); $_out->('
 
');
$_out->( $code );
$_out->('
'); $m->comp("/widgets/wrappers/sharky/table_bottom.mc"); $_out->('
'); $_out->(' '); return undef; }, 'create_time'=>1001677796, 'declared_args'=> { '$widget' => { 'default' => undef } }, 'object_size'=>4125, 'parser_version'=>0.8 ) ;