package HTML::Mason::Commands; use strict; use vars qw($m $r); my $_escape = \&HTML::Mason::Parser::_escape_perl_expression; ; my $pmeth = { %{ Bric::Biz::Asset::Business::Story->my_meths->{priority} } }; $pmeth->{value} = 3; my $cdate = { %{ Bric::Biz::Asset::Business::Story->my_meths->{cover_date} } }; my ($tmeth, $smeth) = @{ Bric::Biz::Asset::Business::Story->my_meths }{qw(title slug)}; 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::); ; $cdate->{value} = strfdate(); my $agent = $m->comp("/widgets/util/detectAgent.mc"); my $ieSpacer = ($agent->{browser} eq "Internet Explorer") ? qq{
} : ''; $m->comp("/widgets/wrappers/sharky/table_top.mc", caption => "Properties", number => 1); $m->out($ieSpacer); $m->comp('/widgets/profile/displayFormElement.mc', key => "title", vals => $tmeth ); $m->out($ieSpacer); $m->comp('/widgets/profile/displayFormElement.mc', key => "slug", vals => $smeth ); $m->out($ieSpacer); $m->comp( '/widgets/select_object/select_object.mc', disp => 'Story Type', object => 'element', name => 'story_prof|at_id', field => 'name', constrain => { top_level => 1, media => 0 }, useTable => 1, ); $m->out($ieSpacer); $m->comp( '/widgets/select_object/select_object.mc', disp => 'Source', object => 'source', name => "$widget|source__id", field => 'source_name', useTable => 1, ); $m->out($ieSpacer); $m->comp( '/widgets/select_object/select_object.mc', object => 'category', disp => 'Primary Category', name => "$widget|new_category_id", field => 'uri', useTable => 1 ); $m->out($ieSpacer); $m->comp('/widgets/profile/displayFormElement.mc', key => "priority", vals => $pmeth, ); $m->out($ieSpacer); $m->comp('/widgets/profile/displayFormElement.mc', key => "cover_date", vals => $cdate, ); $m->out($ieSpacer); $m->comp("/widgets/wrappers/sharky/table_bottom.mc"); $m->comp("/widgets/wrappers/sharky/table_top.mc", caption => "Submit", number => 2, ghostly => 1 ); $_out->('
'); $_out->(' '); return undef; }, 'create_time'=>1001676480, 'declared_args'=> { '$widget' => { 'default' => undef } }, 'object_size'=>2970, 'parser_version'=>0.8 ) ;