<%perl> my $wf = Bric::Biz::Workflow->lookup ({ id => get_state_data($widget, 'work_id')}); my $site_id = $wf->get_site_id; $m->comp("/widgets/wrappers/sharky/table_top.mc", caption => "Properties", id => 'storyinfo', number => 1); $m->comp('/widgets/profile/displayFormElement.mc', key => 'site', readOnly => 1, objref => $wf ); $m->comp('/widgets/profile/displayFormElement.mc', key => "title", vals => $tmeth ); $m->comp('/widgets/profile/displayFormElement.mc', key => "slug", id => 'slug', vals => $smeth ); $m->comp( '/widgets/select_object/select_object.mc', disp => 'Story Type', object => 'element_type', name => 'story_prof|at_id', req => 1, field => 'name', default => ['' , ''], constrain => { top_level => 1, media => 0, site_id => $site_id, }, useTable => 1, localize => 0, exclude => $excl_sub, ); $m->comp( '/widgets/select_object/select_object.mc', disp => 'Source', object => 'source', name => "$widget|source__id", field => 'source_name', localize => 0, useTable => 1, exclude => $excl_sub, ); $m->comp( '/widgets/select_object/select_object.mc', object => 'category', disp => 'Primary Category', name => "$widget|new_category_id", constrain => { site_id => $site_id }, exclude => $excl_sub, req => 1, field => 'uri', sort_field => 'uri', localize => 0, useTable => 1 ); $m->comp('/widgets/profile/displayFormElement.mc', key => "priority", vals => $pmeth, ); $m->comp('/widgets/profile/displayFormElement.mc', key => "cover_date", vals => $cdate, ); $m->comp("/widgets/wrappers/sharky/table_bottom.mc"); $m->comp("/widgets/profile/button.mc", disp => $lang->maketext('Create'), widget => $widget, cb => 'create_cb', button => 'create_red', useTable => 0 ); <%args> $widget <%once>; 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)}; my $excl_sub = sub { ! chk_authz($_[0], READ, 1) }; <%init>; $cdate->{value} = strfdate();