<& '/widgets/search/search.mc', object => 'category', field => 'uri', type => 'singular', use_form_tag => 0 &>

<& '/widgets/listManager/listManager.mc', object => 'category', title => 'Publish a Category', select => $select, fields => [qw(uri)], addition => '', profile => undef, exclude => $exclude, behavior => 'expand', @constrain &>

<%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 } ); } <%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; };