version 1.314, 2009/07/31 17:58:16
|
version 1.321, 2010/05/03 16:41:51
|
Line 118 sub handler {
|
Line 118 sub handler {
|
# This is set and used in &handler() and is also used in |
# This is set and used in &handler() and is also used in |
# &output_results(). |
# &output_results(). |
|
|
my $loaderror=&Apache::lonnet::overloaderror($r); |
|
if ($loaderror) { return $loaderror; } |
|
# |
# |
my $closebutton; # button that closes the search window |
my $closebutton; # button that closes the search window |
# This button is different for the RAT compared to |
# This button is different for the RAT compared to |
Line 268 sub handler {
|
Line 266 sub handler {
|
if ($env{'form.catalogmode'} eq 'interactive') { |
if ($env{'form.catalogmode'} eq 'interactive') { |
$closebutton="<input type='button' name='close' value='".&mt('Close')."' "; |
$closebutton="<input type='button' name='close' value='".&mt('Close')."' "; |
if ($env{'form.phase'} =~ /(results|run_search)/) { |
if ($env{'form.phase'} =~ /(results|run_search)/) { |
$closebutton .="onclick='parent.close()'"; |
$closebutton .="onclick='parent.close()'"; |
} else { |
} else { |
$closebutton .="onclick='self.close()'"; |
$closebutton .="onclick='self.close()'"; |
} |
} |
$closebutton .=">\n"; |
$closebutton .=" />\n"; |
} elsif ($env{'form.catalogmode'} eq 'import') { |
} elsif ($env{'form.catalogmode'} eq 'import') { |
$closebutton="<input type='button' name='close' value='".&mt('Close')."' "; |
$closebutton="<input type='button' name='close' value='".&mt('Close')."' "; |
if ($env{'form.phase'} =~ /(results|run_search)/) { |
if ($env{'form.phase'} =~ /(results|run_search)/) { |
$closebutton .="onclick='parent.close()'"; |
$closebutton .="onclick='parent.close()'"; |
} else { |
} else { |
$closebutton .="onclick='self.close()'"; |
$closebutton .="onclick='self.close()'"; |
} |
} |
$closebutton .= ">"; |
$closebutton .= " />"; |
my $txt_import = &mt('IMPORT'); |
my $txt_import = &mt('IMPORT'); |
$importbutton=<<END; |
$importbutton=<<END; |
<input type='button' name='import' value='$txt_import' |
<input type='button' name='import' value='$txt_import' |
onclick='javascript:select_group()'> |
onclick='javascript:select_group()' /> |
END |
END |
} else { |
} else { |
$closebutton = ''; |
$closebutton = ''; |
Line 324 END
|
Line 322 END
|
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check(). |
({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check(). |
'&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'}, |
text=>"Course Search", |
text=>"Course Search", |
Line 492 sub course_search {
|
Line 490 sub course_search {
|
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check(). |
({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check(). |
'&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'}, |
text=>"Course Search", |
text=>"Course Search", |
Line 770 sub setup_basic_search {
|
Line 768 sub setup_basic_search {
|
portfolio => 'Portfolio Search', |
portfolio => 'Portfolio Search', |
); |
); |
my ($userelatedwords,$onlysearchdomain,$inclext,$adv_search_link,$scrout); |
my ($userelatedwords,$onlysearchdomain,$inclext,$adv_search_link,$scrout); |
$userelatedwords = '<label>'.&mt('[_1] use related words', |
|
&Apache::lonhtmlcommon::checkbox('related',$env{'form.related'},'related')). |
$userelatedwords = '<label>' |
'</label>'; |
.&Apache::lonhtmlcommon::checkbox( |
$onlysearchdomain = '<label>'.&mt('[_1] only search domain [_2]', |
'related', |
&Apache::lonhtmlcommon::checkbox('domains',$env{'form.domains'}, |
$env{'form.related'}, |
$r->dir_config('lonDefDomain')), |
'related') |
$r->dir_config('lonDefDomain')). |
.' ' |
'</label>'; |
.&mt('use related words') |
|
.'</label>'; |
|
|
|
$onlysearchdomain = '<label>' |
|
.&Apache::lonhtmlcommon::checkbox( |
|
'domains', |
|
$env{'form.domains'}, |
|
$r->dir_config('lonDefDomain')) |
|
.' ' |
|
.&mt('only search domain [_1]' |
|
,'<b>'.$r->dir_config('lonDefDomain').'</b>') |
|
.'</label>'; |
|
|
$adv_search_link = '<a href="/adm/searchcat?'. |
$adv_search_link = '<a href="/adm/searchcat?'. |
&Apache::loncommon::inhibit_menu_check(). |
&Apache::loncommon::inhibit_menu_check(). |
'&phase=disp_adv'. |
'&phase=disp_adv'. |
Line 3541 sub detailed_citation_view {
|
Line 3551 sub detailed_citation_view {
|
$result .= '<b>'.&mt($field->{'translate'}).'</b>'; |
$result .= '<b>'.&mt($field->{'translate'}).'</b>'; |
foreach my $item (split(',',$values{$field->{'name'}})){ |
foreach my $item (split(',',$values{$field->{'name'}})){ |
$item = &Apache::lonnet::clutter($item); |
$item = &Apache::lonnet::clutter($item); |
$result .= &display_url($item,[2,0,1]); |
$result .= '<br />'.&display_url($item,1).'<br />'; |
} |
} |
} elsif (exists($field->{'format'}) && $field->{'format'} ne ''){ |
} elsif (exists($field->{'format'}) && $field->{'format'} ne ''){ |
$result.= &mt($field->{'translate'}, |
$result.= &mt($field->{'translate'}, |
Line 3549 sub detailed_citation_view {
|
Line 3559 sub detailed_citation_view {
|
$values{$field->{'name'}}))."<br />\n"; |
$values{$field->{'name'}}))."<br />\n"; |
} else { |
} else { |
if ($field->{'special'} eq 'url link') { |
if ($field->{'special'} eq 'url link') { |
$result .= &display_url($jumpurl,[3,0,1]); |
$result .= '<br />'.&display_url($jumpurl,1).'<br />'; |
} else { |
} else { |
$result.= &mt($field->{'translate'}, |
$result.= &mt($field->{'translate'}, |
$values{$field->{'name'}}); |
$values{$field->{'name'}}); |
Line 3603 sub summary_view {
|
Line 3613 sub summary_view {
|
} |
} |
my $jumpurl=$values{'url'}; |
my $jumpurl=$values{'url'}; |
$jumpurl=~s|^/ext/|http://|; |
$jumpurl=~s|^/ext/|http://|; |
my $link = &display_url($jumpurl,[2,0,1]); |
my $link = '<br />'.&display_url($jumpurl,1).'<br />'; |
|
|
$result.=<<END; |
$result.=<<END; |
<a href="$jumpurl?inhibitmenu=yes" |
<a href="$jumpurl?inhibitmenu=yes" |
Line 3639 sub compact_view {
|
Line 3649 sub compact_view {
|
my $jumpurl=$values{'url'}; |
my $jumpurl=$values{'url'}; |
$jumpurl=~s|^/ext/|http://|; |
$jumpurl=~s|^/ext/|http://|; |
|
|
my $link = &display_url($jumpurl,[1,1,1]); |
my $link = &display_url($jumpurl,1); |
|
|
my $result = |
my $result = |
$prefix.'<img src="'.&Apache::loncommon::icon($values{'url'}).'" alt="" />'; |
$prefix.'<img src="'.&Apache::loncommon::icon($values{'url'}).'" alt="" />'; |
Line 3658 sub compact_view {
|
Line 3668 sub compact_view {
|
} |
} |
|
|
sub display_url { |
sub display_url { |
my ($url,$crumb_args) = @_; |
my ($url,$skiplast) = @_; |
my $link; |
my $link; |
if ($url=~m|^/ext/|) { |
if ($url=~m|^/ext/|) { |
$url=~s|^/ext/|http://|; |
$url=~s|^/ext/|http://|; |
Line 3666 sub display_url {
|
Line 3676 sub display_url {
|
} elsif ($url=~m{^(http://|/uploaded/)}) { |
} elsif ($url=~m{^(http://|/uploaded/)}) { |
$link='<span class="LC_filename">'.$url.'</span>'; |
$link='<span class="LC_filename">'.$url.'</span>'; |
} else { |
} else { |
$link=&Apache::lonhtmlcommon::crumbs($url, |
$link=&Apache::lonhtmlcommon::crumbs( |
'preview', |
$url, |
'', |
'preview', |
(($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),@{$crumb_args}).' '; |
'', |
|
(($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''), |
|
$skiplast).' '; |
} |
} |
return $link; |
return $link; |
} |
} |
Line 3884 sub output_blank_field_error {
|
Line 3896 sub output_blank_field_error {
|
my ($r,$closebutton,$parms,$hidden_fields)=@_; |
my ($r,$closebutton,$parms,$hidden_fields)=@_; |
my $errormsg = &mt('You did not fill in enough information for the search to be started. You need to fill in relevant fields on the search page in order for a query to be processed.'); |
my $errormsg = &mt('You did not fill in enough information for the search to be started. You need to fill in relevant fields on the search page in order for a query to be processed.'); |
my $revise = &mt('Revise Search Request'); |
my $revise = &mt('Revise Search Request'); |
my $heading = &mt('Unactionable Search Queary'); |
my $heading = &mt('Unactionable Search Query'); |
my $start_page = &Apache::loncommon::start_page('Search'); |
my $start_page = &Apache::loncommon::start_page('Search'); |
my $end_page = &Apache::loncommon::end_page(); |
my $end_page = &Apache::loncommon::end_page(); |
|
if ($closebutton) { |
|
$closebutton = '<p>'.$closebutton.'</p><hr />'; |
|
} else { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>'', |
|
text=>$heading,}); |
|
$start_page .= &Apache::lonhtmlcommon::breadcrumbs(); |
|
} |
|
|
$r->print(<<ENDPAGE); |
$r->print(<<ENDPAGE); |
$start_page |
$start_page |
<form method="post" action="/adm/searchcat"> |
<form method="post" action="/adm/searchcat"> |
$hidden_fields |
$hidden_fields |
$closebutton |
$closebutton |
<hr /> |
</form> |
<h2>$heading</h2> |
<h2>$heading</h2> |
<p class="LC_warning"> |
<p class="LC_warning"> |
$errormsg |
$errormsg |
</p> |
</p> |
<p> |
<p> |
<a href="/adm/searchcat?$parms&persistent_db_id=$env{'form.persistent_db_id'}">$revise</a> |
<a href="/adm/searchcat?$parms&persistent_db_id=$env{'form.persistent_db_id'}">$revise</a> |
</p> |
</p> |
$end_page |
$end_page |
ENDPAGE |
ENDPAGE |