%#--- Arguments ---# <%args> $widget $object $disp_field $use_form_tag %#--- Initialization ---# <%init> my $agent = detect_agent(); my $spacerRow = $agent->ie ? '' : ""; my $advanced_search = get_state_data($widget, 'advanced_search'); $advanced_search = get_pref('Default Search') unless defined $advanced_search; my $sites = $c->get('__SITES__'); unless ($sites) { $sites = Bric::Biz::Site->list({ active => 1 }); $c->set('__SITES__', $sites); } $sites = [grep { chk_authz($_, EDIT, 1) } @$sites]; % if ($use_form_tag) {
% } <%perl> my $caption; unless ($advanced_search) { $caption = sprintf(qq{%s ~[%s~]}, $lang->maketext('Search'), $r->uri, $widget, $lang->maketext('Advanced Search')); } else { $caption = sprintf(qq{%s ~[%s~]}, $lang->maketext('Advanced Search'), $r->uri, $widget, $lang->maketext('Simple Search')); } $m->comp("/widgets/wrappers/sharky/table_top.mc", caption => $caption, search => 1); % unless ($advanced_search) { <& '/widgets/profile/text.mc', name => $widget.'|simple', value => get_state_data($widget, 'simple') || '', useTable => 0 &> % # This hidden field is required to make the form submit when the user hits % # the "enter" key. <& '/widgets/profile/hidden.mc', name => $widget.'|formatting_cb', value => 'Search' &> <& '/widgets/profile/button.mc', disp => $lang->maketext('Search'), widget => $widget, cb => 'formatting_cb', button => 'search_red', useTable => 0 &> % } else { <& /widgets/profile/text.mc, disp => $lang->maketext('Name'), name => $widget.'|name', value => get_state_data($widget, 'name') || '' &> <& /widgets/profile/text.mc, disp => $lang->maketext('File Name'), name => $widget.'|file_name', value => get_state_data($widget, 'file_name') || '' &> % my $site_id = $c->get_user_cx(get_user_id); % my ($one_site, $oc_name_getter); % if (get_pref("Filter by Site Context")) { % $one_site = 1; <& /widgets/profile/hidden.mc, name => "$widget|site_id", value => $site_id &> % } elsif (@$sites > 1) { <%perl>; my $ng = Bric::Biz::OutputChannel->my_meths->{name}{get_meth}; my $sg = Bric::Biz::OutputChannel->my_meths->{site}{get_meth}; $oc_name_getter = sub { my $o = shift; return $ng->($o) . ' (' . $sg->($o) . ')'; }; \ % $one_site = <& /widgets/profile/select.mc, disp => $lang->maketext('Site'), name => $widget.'|site_id', value => get_state_data($widget, 'site_id') || '', options => [ [ '' => $lang->maketext('All Sites') ], map { [$_->get_id => $_->get_name] } @$sites ], localize => 0 &> % } else { % $one_site = 1; % } <& /widgets/select_object/select_object.mc, disp => $lang->maketext('Output Channel'), object => 'output_channel', field => 'name', constrain => { active => 1, $one_site ? (site_id => $site_id) : () }, no_persist => 1, name => "$widget|output_channel_id", default => ['', $lang->maketext('All Output Channels')], getter => $oc_name_getter &>
<% $lang->maketext('Cover Date') %>:
<& '/widgets/select_time/select_time.mc', base_name => "$widget|cover_date_start", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'cover_date_start')||'', compact => 1, style => 'inline', &> —<& '/widgets/select_time/select_time.mc', base_name => "$widget|cover_date_end", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'cover_date_end')||'', compact => 1, style => 'inline', &>
<% $lang->maketext('Publish Date') %>:
<& '/widgets/select_time/select_time.mc', base_name => "$widget|publish_date_start", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'publish_date_start')||'', compact => 1, style => 'inline', &> —<& '/widgets/select_time/select_time.mc', base_name => "$widget|publish_date_end", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'publish_date_end')||'', compact => 1, style => 'inline', &>
<% $lang->maketext('Expire Date') %>:
<& '/widgets/select_time/select_time.mc', base_name => "$widget|expire_date_start", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'expire_date_start')||'', compact => 1, style => 'inline', &> —<& '/widgets/select_time/select_time.mc', base_name => "$widget|expire_date_end", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'expire_date_end')||'', compact => 1, style => 'inline', &>
<& /widgets/profile/button.mc, disp => $lang->maketext('Search'), widget => $widget, cb => 'formatting_cb', button => 'search_red', useTable => 0 &> <& /widgets/profile/button.mc, disp => $lang->maketext('Clear Values'), widget => $widget, cb => 'clear_cb', button => 'clear_values_lgreen', useTable => 0 &>
% } <& '/widgets/wrappers/sharky/table_bottom.mc' &> %#--- Log History ---# % if ($use_form_tag) {
% }