<& '/widgets/search/search.mc', object => 'category', field => 'uri', type => 'singular', use_form_tag => 0 &> <& '/widgets/wrappers/sharky/table_top.mc', caption => 'Publish a Category' &> <& '/widgets/listManager/listManager.mc', object => 'category', select => $select, fields => [(@$sites > 1 ? 'site' : () ), 'uri'], addition => '', profile => undef, exclude => $exclude, behavior => 'expand', @constrain &> <& '/widgets/wrappers/sharky/table_bottom.mc' &> <& /widgets/select_time/select_time.mc, base_name => 'pub_time', default_current => 1, disp => 'Publish Time', &>

<& '/widgets/buttons/submit.mc', disp => 'Publish Checked', name => 'publish_button', button => 'publish_checked_red', useTable => 0, &>

<%init>; my @constrain; # Limit to the current site context? Site ID 0 or undef is no context. if (my $site_id = $c->get_user_cx(get_user_id) && get_pref("Filter by Site Context")) { @constrain = ( constrain => { site_id => $site_id } ); } my $sites = $c->get('__SITES__'); unless ($sites) { $sites = Bric::Biz::Site->list({ active => 1 }); $c->set('__SITES__', $sites); } <%once> my $widget = 'bulk_publish'; my $select = sub { my $cat = shift; my $cat_id = $cat->get_id; return [['Stories', 'bulk_publish|publish_categories_cb', "story=$cat_id"], ['Media', 'bulk_publish|publish_categories_cb', "media=$cat_id"]]; }; my $exclude = sub { my $cat = shift; # exclude unauthorized categories return 1 unless chk_authz($cat, READ, 1); # Keep it! return; };