<& '/widgets/search/search.mc', object => $class_key, type => $class_key, field => 'name', use_form_tag => 0 &>

<& /widgets/listManager/listManager.mc, object => $class_key, title => $lang->maketext("Find a $class_key to alias"), sortBy => 'name', select => undef, profile => $related_alias, exclude => $excl_sub, fields => $fields, field_values => $field_values, field_titles => { thumb => $lang->maketext('Thumb') }, addition => '', cx_filter => 0, behavior => 'expand', &>

<%args> $widget $class_key $wf_id <%init>; $link_key = $class_key; my $site_id = Bric::Biz::Workflow->lookup({ id => $wf_id })->get_site_id; my %elems = map { $_ => 1 } Bric::Biz::AssetType->list_ids ({ site_id => $site_id }); # Hack: It'd be good to be able to exclude these in the SQL query, but the # query building interface can't currently handle that sort of thing. So' # we'll have to do it on a case-by-case basis for now. In general, this # shouldn't be a big deal, as the permissions check is already done on a # case-by-case bassis to limit most things. my $excl_sub = sub { not chk_authz($_[0], READ, 1) }; my $fields = [qw(id title uri cover_date)]; unshift @$fields, 'thumb' if USE_THUMBNAILS && $class_key ne 'story'; <%once>; my $link_key; my $field_values = sub { my ($o, $field) = @_; if ($field eq 'title') { return $m->comp('/widgets/profile/preview_link.mc', type => $o->key_name, title => '' . $o->get_title . '', doc => $o); } elsif ($field eq 'thumb') { # If we get a thumbnail URI, we have an image. Otherwise, simply return # a space to fill the column properly because we aren't an image object # but USE_THUMBNAILS is on. my $thumb_uri = $o->thumbnail_uri or return ' '; return qq{ }; } }; my $related_alias = sub { [$lang->maketext('Alias'), $r->uri, "alias|make_alias_cb=" . $_[0]->get_id]; };