version 1.361, 2025/03/18 18:57:28
|
version 1.364, 2025/03/19 15:44:44
|
Line 170 sub handler {
|
Line 170 sub handler {
|
## |
## |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
|
my @allowed_searches = ('portfolio'); |
my $crumb_text; |
|
my @allowed_searches; |
|
if ($env{'form.catalogmode'} eq 'import') { |
|
$env{'form.area'} = 'res'; |
|
$crumb_text = 'Content Library Search'; |
|
} else { |
|
push(@allowed_searches,'portfolio'); |
|
} |
if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'}) eq 'F') { |
if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'}) eq 'F') { |
push(@allowed_searches,'res'); |
push(@allowed_searches,'res'); |
} |
} else { |
my $crumb_text = 'Portfolio Search'; |
unless ($env{'form.catalogmode'} eq 'import') { |
|
$env{'form.area'} = 'portfolio'; |
|
$crumb_text = 'Portfolio Search'; |
|
} |
|
} |
if (@allowed_searches ==2) { |
if (@allowed_searches ==2) { |
|
unless (($env{'form.area'} eq 'portfolio') || ($env{'form.area'} eq 'res')) { |
|
delete($env{'form.area'}); |
|
} |
$crumb_text = 'Portfolio and Content Library Search'; |
$crumb_text = 'Portfolio and Content Library Search'; |
} |
} |
my $target = '_top'; |
my $target = '_top'; |
Line 192 sub handler {
|
Line 206 sub handler {
|
&Apache::loncommon::inhibit_menu_check(). |
&Apache::loncommon::inhibit_menu_check(). |
'&catalogmode='.$env{'form.catalogmode'}. |
'&catalogmode='.$env{'form.catalogmode'}. |
'&launch='.$env{'form.launch'}. |
'&launch='.$env{'form.launch'}. |
'&mode='.$env{'form.mode'}, |
'&mode='.$env{'form.mode'}. |
|
'&area='.$env{'form.area'}, |
text=>"$crumb_text", |
text=>"$crumb_text", |
target=>$target, |
target=>$target, |
bug=>'Searching',}); |
bug=>'Searching',}); |
Line 317 END
|
Line 332 END
|
'&phase=disp_adv'. |
'&phase=disp_adv'. |
'&catalogmode='.$env{'form.catalogmode'}. |
'&catalogmode='.$env{'form.catalogmode'}. |
'&launch='.$env{'form.launch'}. |
'&launch='.$env{'form.launch'}. |
'&mode='.$env{'form.mode'}, |
'&mode='.$env{'form.mode'}. |
|
'&area='.$env{'form.area'}, |
text=>"Advanced $srchtype Search", |
text=>"Advanced $srchtype Search", |
bug=>'Searching',}); |
bug=>'Searching',}); |
} |
} elsif (($env{'form.phase'} eq 'results') || |
|
($env{'form.phase'} =~ /^(sort|run_search)$/)) { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check(). |
|
'&phase=disp_adv'. |
|
'&catalogmode='.$env{'form.catalogmode'}. |
|
'&launch='.$env{'form.launch'}. |
|
'&mode='.$env{'form.mode'}. |
|
'&area='.$env{'form.area'}. |
|
'&searchmode='.$env{'form.searchmode'}, |
|
text=>"Search Results", |
|
bug=>'Searching',}); |
|
} |
## |
## |
## Switch on the phase |
## Switch on the phase |
## |
## |
Line 437 sub hidden_field {
|
Line 465 sub hidden_field {
|
return '<input type="hidden" name="'.$name.'" value="'.$value.'" />'.$/; |
return '<input type="hidden" name="'.$name.'" value="'.$value.'" />'.$/; |
} |
} |
|
|
|
sub start_search_tabs { |
|
my $area; |
|
my %lt = &Apache::lonlocal::texthash ( |
|
res => 'Content Library Search', |
|
portfolio => 'Portfolio Search', |
|
); |
|
my $output = '<ul class="LC_TabContentBigger" id="main">'; |
|
if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'}) eq 'F') { |
|
unless ($env{'form.area'} eq 'portfolio') { |
|
$area = 'res'; |
|
} |
|
$output .= "\n".'<li'.($area eq 'res'?' class="active"':''). |
|
'><a href="/adm/searchcat?area=res&catalogmode='.$env{'form.catalogmode'}.'">'. |
|
'<b> '.$lt{'res'}. |
|
' </b></a></li>'; |
|
unless ($env{'form.catalogmode'}) { |
|
$output .= '<li'.($area ne 'res'?' class="active"':''). |
|
'><a href="/adm/searchcat?area=portfolio"><b> '.$lt{'portfolio'}. |
|
' </b></a></li></ul>'; |
|
} |
|
} else { |
|
$area = 'portfolio'; |
|
$output .= "\n".'<li class="active">'. |
|
'<a href="/adm/searchcat?area=portfolio"><b> '.$lt{'portfolio'}. |
|
' </b></a></li></ul>'; |
|
} |
|
$output .= '<div class="LC_Box" style="clear:both;margin:0;">'. |
|
'<div id="maincoursedoc" style="margin:0 0;padding:0 0;">'. |
|
'<div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">'; |
|
return $output; |
|
} |
|
|
|
sub end_search_tabs { |
|
return '</div></div></div>'; |
|
} |
|
|
###################################################################### |
###################################################################### |
|
|
=pod |
=pod |
Line 453 Prints the form for the basic search. S
|
Line 517 Prints the form for the basic search. S
|
###################################################################### |
###################################################################### |
sub print_basic_search_form { |
sub print_basic_search_form { |
my ($r,$closebutton,$hidden_fields) = @_; |
my ($r,$closebutton,$hidden_fields) = @_; |
|
my %lt = &Apache::lonlocal::texthash ( |
|
res => 'Content Library Search', |
|
portfolio => 'Portfolio Search', |
|
); |
my $result = ($env{'form.catalogmode'} ne 'import'); |
my $result = ($env{'form.catalogmode'} ne 'import'); |
|
my $area; |
my $bread_crumb = |
my $bread_crumb = |
&Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Basic', |
&Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Basic', |
$env{'form.catalogmode'} ne 'import'); |
$env{'form.catalogmode'} ne 'import'); |
my $scrout = &Apache::loncommon::start_page('Content Library').$bread_crumb; |
my $scrout = &Apache::loncommon::start_page('Content Library').$bread_crumb. |
# Search form for resource space |
'<div class="LC_landmark" role="main">'."\n". |
|
&start_search_tabs(); |
if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'}) eq 'F') { |
if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'}) eq 'F') { |
$scrout .= &setup_basic_search($r,'res',$hidden_fields,$closebutton); |
if ($env{'form.area'} eq 'portfolio') { |
$scrout .= '<hr /><br />'; |
|
} |
|
# Search form for accessible portfolio files |
# Search form for accessible portfolio files |
$scrout.= &setup_basic_search($r,'portfolio',$hidden_fields,$closebutton); |
$scrout .= &setup_basic_search($r,'portfolio',$hidden_fields,$closebutton); |
$scrout .= &Apache::loncommon::end_page(); |
} else { |
|
# Search form for resource space |
|
$scrout .= &setup_basic_search($r,'res',$hidden_fields,$closebutton); |
|
} |
|
} else { |
|
# Search form for accessible portfolio files |
|
$scrout .= &setup_basic_search($r,'portfolio',$hidden_fields,$closebutton); |
|
} |
|
$scrout .= &end_search_tabs().&Apache::loncommon::end_page(); |
$r->print($scrout); |
$r->print($scrout); |
return; |
return; |
} |
} |
Line 535 sub setup_basic_search {
|
Line 611 sub setup_basic_search {
|
$scrout .= '<input type="hidden" name="area" value="'.$area.'" />'; |
$scrout .= '<input type="hidden" name="area" value="'.$area.'" />'; |
} |
} |
# |
# |
$scrout .= '<div align="center">'.$/; |
$scrout .= '<div class="LC_floatleft">'. |
# if ($env{'request.course.id'}) { |
'<label>'. |
$scrout .= '<h1>'.$lt{$area}.'</h1>'; |
&Apache::lonhtmlcommon::textbox('basicexp', |
# } else { |
$env{'form.basicexp'},50). |
# No need to tell them they are searching |
'<br />'. |
# $scrout.= ('<br />'x2); |
'<span class="LC_fontsize_medium">'.&searchhelp().'</span></label></div>'. |
# } |
'<div class="LC_floatleft" style="text-align: left;">'. |
$scrout.='<table>'. |
'<span class="LC_nobreak">'.(' 'x3).$adv_search_link.'</span>'.'<br />'. |
'<tr><td align="center" valign="top">'. |
'<span class="LC_nobreak">'.(' 'x1).$userelatedwords.'</span>'.'<br />'. |
&Apache::lonhtmlcommon::textbox('basicexp', |
'<span class="LC_nobreak">'.(' 'x1).$onlysearchdomain.'</span>'.'<br />'. |
$env{'form.basicexp'},50). |
'<span class="LC_nobreak">'.(' 'x1).$inclext.'</span>'.'<br />'. |
'<br />'. |
'</div><br clear="both" />'.$/; |
'<span class="LC_fontsize_medium">'.&searchhelp().'</span>'.'</td>'. |
|
'<td>'. |
|
'<span class="LC_nobreak">'.(' 'x3).$adv_search_link.'</span>'.'<br />'. |
|
'<span class="LC_nobreak">'.(' 'x1).$userelatedwords.'</span>'.'<br />'. |
|
'<span class="LC_nobreak">'.(' 'x1).$onlysearchdomain.'</span>'.'<br />'. |
|
'<span class="LC_nobreak">'.(' 'x1).$inclext.'</span>'.'<br />'. |
|
'</td>'. |
|
'</tr>'. |
|
'</table>'.$/; |
|
# |
# |
$scrout .= '<p>' |
$scrout .= '<div><p>' |
.&viewoptions() |
.&viewoptions() |
.'</p>' |
.'</p>' |
.'<p>' |
.'<p>' |
Line 565 sub setup_basic_search {
|
Line 632 sub setup_basic_search {
|
.'value="'.&mt('Search').'" />' |
.'value="'.&mt('Search').'" />' |
.' ' |
.' ' |
.$closebutton |
.$closebutton |
.'</p>'; |
.'</p></div>'; |
# |
# |
$scrout .= '</div>'.'</form>'; |
$scrout .= '</form>'; |
return $scrout; |
return $scrout; |
} |
} |
|
|
Line 617 function additional_metadata() {
|
Line 684 function additional_metadata() {
|
} |
} |
my $scrout= &Apache::loncommon::start_page("Advanced $srchtype Search", |
my $scrout= &Apache::loncommon::start_page("Advanced $srchtype Search", |
$jscript); |
$jscript); |
$scrout .= $bread_crumb.'<div class="LC_landmark" role="main">'."\n"; |
$scrout .= $bread_crumb.'<div class="LC_landmark" role="main">'."\n". |
|
&start_search_tabs(); |
|
|
$scrout .= '<form method="post" action="/adm/searchcat" name="advsearch">' |
$scrout .= '<form method="post" action="/adm/searchcat" name="advsearch">' |
.$hidden_fields |
.$hidden_fields |
Line 717 function additional_metadata() {
|
Line 785 function additional_metadata() {
|
&titlefield(&mt('Copyright/Distribution')).'</label>') |
&titlefield(&mt('Copyright/Distribution')).'</label>') |
.&Apache::lonmeta::selectbox('copyright', |
.&Apache::lonmeta::selectbox('copyright', |
$env{'form.copyright'},'', |
$env{'form.copyright'},'', |
'copyright', |
'copyright', |
\&Apache::loncommon::copyrightdescription, |
\&Apache::loncommon::copyrightdescription, |
( undef, |
( undef, |
&Apache::loncommon::copyrightids) |
&Apache::loncommon::copyrightids) |
Line 726 function additional_metadata() {
|
Line 794 function additional_metadata() {
|
} |
} |
|
|
$scrout .= &Apache::lonhtmlcommon::row_title('<label for="language">'. |
$scrout .= &Apache::lonhtmlcommon::row_title('<label for="language">'. |
&titlefield(&mt('Language'))'</label>') |
&titlefield(&mt('Language')).'</label>') |
.&Apache::lonmeta::selectbox('language', |
.&Apache::lonmeta::selectbox('language', |
$env{'form.language'},'','language', |
$env{'form.language'},'','language', |
\&Apache::loncommon::languagedescription, |
\&Apache::loncommon::languagedescription, |
Line 764 function additional_metadata() {
|
Line 832 function additional_metadata() {
|
.' value="'.$env{'form.addedvalues_'.$j}.'" aria-label="'.$valuelabel.'" />' |
.' value="'.$env{'form.addedvalues_'.$j}.'" aria-label="'.$valuelabel.'" />' |
.&Apache::lonhtmlcommon::row_closure(); |
.&Apache::lonhtmlcommon::row_closure(); |
} |
} |
my $addcustomlabel = &mt('Add metadata field option'); |
my $addcustomlabel = &mt('Add metadata field option'); |
$scrout .= &Apache::lonhtmlcommon::row_title('<span class="LC_visually_hidden">'.$addcustomlabel.'</span>', |
$scrout .= &Apache::lonhtmlcommon::row_title('<span class="LC_visually_hidden">'.$addcustomlabel.'</span>', |
'','','',1) |
'','','',1) |
.'<label>' |
.'<label>' |
Line 919 function additional_metadata() {
|
Line 987 function additional_metadata() {
|
$scrout .= $advanced_buttons |
$scrout .= $advanced_buttons |
.'</form>'; |
.'</form>'; |
|
|
$scrout .= '</div>'.&Apache::loncommon::end_page(); |
$scrout .= &end_search_tabs().'</div>'.&Apache::loncommon::end_page(); |
$r->print($scrout); |
$r->print($scrout); |
return; |
return; |
} |
} |
Line 1301 sub parse_advanced_search {
|
Line 1369 sub parse_advanced_search {
|
} |
} |
if (! $fillflag) { |
if (! $fillflag) { |
&output_blank_field_error($r,$closebutton, |
&output_blank_field_error($r,$closebutton, |
'phase=disp_adv',$hidden_fields); |
'phase=disp_adv&area='.$env{'form.area'}. |
return ; |
'&catalogmode='.$env{'form.catalogmode'}, |
|
$hidden_fields); |
|
return; |
} |
} |
# Turn the form input into a SQL-based query |
# Turn the form input into a SQL-based query |
my $query=''; |
my $query=''; |
Line 1315 sub parse_advanced_search {
|
Line 1385 sub parse_advanced_search {
|
&process_phrase_input($env{'form.'.$field}, |
&process_phrase_input($env{'form.'.$field}, |
$env{'form.'.$field.'_related'},$field); |
$env{'form.'.$field.'_related'},$field); |
if (defined($error)) { |
if (defined($error)) { |
&output_unparsed_phrase_error($r,$closebutton,'phase=disp_adv', |
&output_unparsed_phrase_error($r,$closebutton, |
|
'phase=disp_adv&area='.$env{'form.area'}. |
|
'&catalogmode='.$env{'form.catalogmode'}. |
$hidden_fields,$field); |
$hidden_fields,$field); |
return; |
return; |
} else { |
} else { |
Line 1599 sub parse_basic_search {
|
Line 1671 sub parse_basic_search {
|
# Check to see if enough of a query is filled in |
# Check to see if enough of a query is filled in |
my $search_string = $env{'form.basicexp'}; |
my $search_string = $env{'form.basicexp'}; |
if (! &filled($search_string)) { |
if (! &filled($search_string)) { |
&output_blank_field_error($r,$closebutton,'phase=disp_basic'); |
&output_blank_field_error($r,$closebutton,'phase=disp_basic'. |
|
'&area='.$env{'form.area'}. |
|
'&catalogmode='.$env{'form.catalogmode'}); |
return OK; |
return OK; |
} |
} |
my $pretty_search_string=$search_string; |
my $pretty_search_string=$search_string; |
Line 1615 sub parse_basic_search {
|
Line 1689 sub parse_basic_search {
|
$env{'form.related'}, |
$env{'form.related'}, |
$searchfield); |
$searchfield); |
if ($error) { |
if ($error) { |
&output_unparsed_phrase_error($r,$closebutton,'phase=disp_basic', |
&output_unparsed_phrase_error($r,$closebutton,'phase=disp_basic'. |
|
'&area='.$env{'form.area'}. |
|
'&catalogmode='.$env{'form.catalogmode'}, |
'','basicexp'); |
'','basicexp'); |
return; |
return; |
} |
} |
Line 2144 sub print_sort_form {
|
Line 2220 sub print_sort_form {
|
&Apache::lonhtmlcommon::breadcrumbs('Searching','Searching', |
&Apache::lonhtmlcommon::breadcrumbs('Searching','Searching', |
$env{'form.catalogmode'} ne 'import', |
$env{'form.catalogmode'} ne 'import', |
'','','','','','',$target); |
'','','','','','',$target); |
|
|
my $result = <<END; |
my $result = <<END; |
$start_page |
$start_page |
$breadcrumbs |
$breadcrumbs |
|
<div class="LC_landmark" role="main"> |
<form name="statusform" action="" method="post" target="$target"> |
<form name="statusform" action="" method="post" target="$target"> |
<input type="hidden" name="catalogmode" value="import" /> |
<input type="hidden" name="catalogmode" value="import" /> |
<input type="hidden" name="acts" value="" /> |
<input type="hidden" name="acts" value="" /> |
Line 2170 END
|
Line 2246 END
|
.' '.$revise.'</p>' |
.' '.$revise.'</p>' |
.'<p>'.&mt('Search: ').$pretty_query_string |
.'<p>'.&mt('Search: ').$pretty_query_string |
.'</p></form>'; |
.'</p></form>'; |
$r->print($result.&Apache::loncommon::end_page()); |
$r->print($result.'</div>'.&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
|
|
Line 2307 SCRIPT
|
Line 2383 SCRIPT
|
sub reload_result_frame { |
sub reload_result_frame { |
my ($r) = @_; |
my ($r) = @_; |
my $newloc = '/adm/searchcat?phase=results&persistent_db_id='. |
my $newloc = '/adm/searchcat?phase=results&persistent_db_id='. |
$env{'form.persistent_db_id'}; |
$env{'form.persistent_db_id'}.'&area='.$env{'form.area'}. |
|
'&catalogmode='.$env{'form.catalogmode'}; |
$r->print(<<SCRIPT); |
$r->print(<<SCRIPT); |
<script type="text/javascript"> |
<script type="text/javascript"> |
parent.update_results("$newloc"); |
parent.update_results("$newloc"); |
Line 2377 sub revise_button {
|
Line 2454 sub revise_button {
|
my $newloc = '/adm/searchcat'. |
my $newloc = '/adm/searchcat'. |
'?persistent_db_id='.$env{'form.persistent_db_id'}. |
'?persistent_db_id='.$env{'form.persistent_db_id'}. |
'&cleargroupsort=1'. |
'&cleargroupsort=1'. |
'&phase='.$revise_phase; |
'&phase='.$revise_phase. |
|
'&area='.$env{'form.area'}. |
|
'&catalogmode='.$env{'form.catalogmode'}; |
my $result = qq{<input type="button" value="$revisetext" name="revise"} . |
my $result = qq{<input type="button" value="$revisetext" name="revise"} . |
qq{ onclick="parent.location='$newloc';" /> }; |
qq{ onclick="parent.location='$newloc';" /> }; |
return $result; |
return $result; |
Line 2420 sub run_search {
|
Line 2499 sub run_search {
|
$r->print(<<END); |
$r->print(<<END); |
$start_page |
$start_page |
$breadcrumbs |
$breadcrumbs |
|
<div class="LC_landmark" role="main"> |
END |
END |
# Remove leading and trailing <br /> |
# Remove leading and trailing <br /> |
$pretty_string =~ s:^\s*<br />::i; |
$pretty_string =~ s:^\s*<br />::i; |
Line 2647 END
|
Line 2727 END
|
# We have run out of time or run out of servers to talk to and |
# We have run out of time or run out of servers to talk to and |
# results to get, so let the client know the top frame needs to be |
# results to get, so let the client know the top frame needs to be |
# loaded from /adm/searchcat |
# loaded from /adm/searchcat |
$r->print(&Apache::loncommon::end_page()); |
$r->print('</div>'.&Apache::loncommon::end_page()); |
# if ($env{'form.catalogmode'} ne 'import') { |
# if ($env{'form.catalogmode'} ne 'import') { |
$r->print(<<SCRIPT); |
$r->print(<<SCRIPT); |
<script> |
<script> |
window.location='/adm/searchcat?phase=sort&persistent_db_id=$env{'form.persistent_db_id'}'; |
window.location='/adm/searchcat?phase=sort&area=$env{"form.area"}&catalogmode=$env{"form.catalogmode"}&persistent_db_id=$env{"form.persistent_db_id"}'; |
</script> |
</script> |
SCRIPT |
SCRIPT |
# } |
# } |
Line 2711 sub display_results {
|
Line 2791 sub display_results {
|
if (!defined($viewfunction)) { |
if (!defined($viewfunction)) { |
$r->print('<p class="LC_error">' |
$r->print('<p class="LC_error">' |
.&mt('Internal Error - Bad view selected.') |
.&mt('Internal Error - Bad view selected.') |
.'</p>'."\n"); |
.'</p>'."\n" |
|
.'</form></div>'.&Apache::loncommon::end_page()); |
$r->rflush(); |
$r->rflush(); |
return; |
return; |
} |
} |
Line 2722 sub display_results {
|
Line 2803 sub display_results {
|
## |
## |
## Get the catalog controls setup |
## Get the catalog controls setup |
## |
## |
my $action = "/adm/searchcat?phase=results"; |
my $action = '/adm/searchcat?phase=results&area='.$env{'form.area'}. |
|
'&catalogmode='.$env{'form.catalogmode'}; |
## |
## |
## Deal with import by opening the import db file. |
## Deal with import by opening the import db file. |
if ($env{'form.catalogmode'} eq 'import') { |
if ($env{'form.catalogmode'} eq 'import') { |
Line 2733 sub display_results {
|
Line 2815 sub display_results {
|
$r->print('<p class="LC_error">'. |
$r->print('<p class="LC_error">'. |
&mt('Unable to save import results.'). |
&mt('Unable to save import results.'). |
'</p>'. |
'</p>'. |
'</form>'. |
'</form></div>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
$r->rflush(); |
$r->rflush(); |
return; |
return; |
Line 2754 sub display_results {
|
Line 2836 sub display_results {
|
$r->print('<p class="LC_error">'. |
$r->print('<p class="LC_error">'. |
&mt('A MySQL error has occurred.'). |
&mt('A MySQL error has occurred.'). |
'</p>'. |
'</p>'. |
'</form>'. |
'</form></div>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
&Apache::lonnet::logthis("lonmysql was unable to determine the number". |
&Apache::lonnet::logthis("lonmysql was unable to determine the number". |
" of rows in table ".$table); |
" of rows in table ".$table); |
Line 2859 sub display_results {
|
Line 2941 sub display_results {
|
$env{'form.sortorder'}='asc'; |
$env{'form.sortorder'}='asc'; |
} |
} |
} |
} |
my $sortform = '<span class="LC_nobreak">' |
my $sortform = '<span class="LC_nobreak"><span id="LC_sortby">' |
.&mt('Sort by:').' ' |
.&mt('Sort by:').'</span> ' |
.&Apache::loncommon::select_form($env{'form.sortfield'}, |
.&Apache::loncommon::select_form($env{'form.sortfield'}, |
'sortfield', |
'sortfield', |
\%sort_fields) |
\%sort_fields,'','','', |
|
'LC_sortby') |
.' ' |
.' ' |
.&Apache::loncommon::select_form($env{'form.sortorder'}, |
.&Apache::loncommon::select_form($env{'form.sortorder'}, |
'sortorder', |
'sortorder', |
{asc =>&mt('Ascending'), |
{asc =>&mt('Ascending'), |
desc=>&mt('Descending') |
desc=>&mt('Descending') |
}) |
},'','','','LC_sortby') |
.'</span>'; |
.'</span>'; |
## |
## |
## Display links for 'prev' and 'next' pages (if necessary) and Display Options |
## Display links for 'prev' and 'next' pages (if necessary) and Display Options |
Line 2883 sub display_results {
|
Line 2966 sub display_results {
|
); |
); |
|
|
if ($total_results == 0) { |
if ($total_results == 0) { |
$r->print('<p class="LC_info">'.&mt('There are currently no results.').'</p>'. |
$r->print('<h1 class="LC_search_results">'.&mt('There are currently no results.').'</h1>'. |
"</form>". |
'</form></div>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
return; |
return; |
} else { |
} else { |
$r->print('<div>'. |
$r->print('<h1 class="LC_search_results">'. |
mt('Results [_1] to [_2] out of [_3]', |
mt('Results [_1] to [_2] out of [_3]', |
$min,$max,$total_results). |
$min,$max,$total_results). |
"</div>\n"); |
"</h1>\n"); |
} |
} |
## |
## |
## Get results from MySQL table |
## Get results from MySQL table |
Line 2921 sub display_results {
|
Line 3004 sub display_results {
|
if ($area eq 'portfolio') { |
if ($area eq 'portfolio') { |
$tabletype = 'portfolio_search'; |
$tabletype = 'portfolio_search'; |
} |
} |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_header_row(). |
|
'<th>'.&mt('Data').'</th>'); |
|
if (($env{'form.viewselect'} eq 'detailedpreview') || |
|
($env{'form.viewselect'} eq 'summarypreview')) { |
|
$r->print('<th>'.&mt('Preview').'</th>'); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table_header_row()); |
foreach my $row (@Results) { |
foreach my $row (@Results) { |
if ($connection->aborted()) { |
if ($connection->aborted()) { |
&cleanup(); |
&cleanup(); |
Line 2959 sub display_results {
|
Line 3049 sub display_results {
|
$env{'form.persistent_db_id'}) |
$env{'form.persistent_db_id'}) |
); |
); |
} |
} |
$r->print("</form>".&Apache::loncommon::end_page()); |
$r->print('</form></div>'.&Apache::loncommon::end_page()); |
$r->rflush(); |
$r->rflush(); |
untie %groupsearch_db if (tied(%groupsearch_db)); |
untie %groupsearch_db if (tied(%groupsearch_db)); |
return; |
return; |
Line 3270 SCRIPT
|
Line 3360 SCRIPT
|
'add_modal' =>1}); |
'add_modal' =>1}); |
my $result=<<END; |
my $result=<<END; |
$start_page |
$start_page |
|
<div class="LC_landmark" role="main"> |
<form name="results" method="post" action="/adm/searchcat"> |
<form name="results" method="post" action="/adm/searchcat"> |
$importbutton |
$importbutton |
END |
END |
Line 3278 END
|
Line 3369 END
|
|
|
sub results_link { |
sub results_link { |
my $basic_link = "/adm/searchcat?"."&table=".$env{'form.table'}. |
my $basic_link = "/adm/searchcat?"."&table=".$env{'form.table'}. |
|
"&area=".$env{'form.area'}. |
|
"&catalogmode=".$env{'form.catalogmode'}. |
"&persistent_db_id=".$env{'form.persistent_db_id'}; |
"&persistent_db_id=".$env{'form.persistent_db_id'}; |
my $results_link = $basic_link."&phase=results". |
my $results_link = $basic_link."&phase=results". |
"&pause=1"."&start=1"; |
"&pause=1"."&start=1"; |
Line 3288 sub results_link {
|
Line 3381 sub results_link {
|
###################################################################### |
###################################################################### |
sub print_frames_interface { |
sub print_frames_interface { |
my $r = shift; |
my $r = shift; |
my $basic_link = "/adm/searchcat?"."&table=".$env{'form.table'}. |
my $basic_link = "/adm/searchcat?table=".$env{'form.table'}. |
|
"&area=".$env{'form.area'}. |
|
"&catalogmode=".$env{'form.catalogmode'}. |
"&persistent_db_id=".$env{'form.persistent_db_id'}; |
"&persistent_db_id=".$env{'form.persistent_db_id'}; |
my $run_search_link = $basic_link."&phase=run_search"; |
my $run_search_link = $basic_link."&phase=run_search"; |
my $results_link = &results_link(); |
my $results_link = &results_link(); |
my $js = <<JS; |
my $js = <<JS; |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
// <![CDATA[ |
var targetwin = opener; |
var targetwin = opener; |
var queue = ''; |
var queue = ''; |
|
|
Line 3316 function done_loading_results() {
|
Line 3412 function done_loading_results() {
|
update_results(new_location); |
update_results(new_location); |
} |
} |
} |
} |
|
// ]]> |
</script> |
</script> |
JS |
JS |
|
|