<& '/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 => [qw(uri)], addition => '', profile => undef, exclude => $exclude, behavior => 'expand', &> <& '/widgets/wrappers/sharky/table_bottom.mc' &>

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

<%once>; 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"]]; }; # exclude categories that aren't in the current site my $exclude = sub { my $site_id = $c->get_user_cx(get_user_id()); my $cat = shift; return $cat->get_site_id != $site_id; };