--- loncom/interface/lonsearchcat.pm 2009/07/31 16:01:48 1.313 +++ loncom/interface/lonsearchcat.pm 2010/08/25 12:38:45 1.326 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.313 2009/07/31 16:01:48 bisitz Exp $ +# $Id: lonsearchcat.pm,v 1.326 2010/08/25 12:38:45 wenzelju Exp $ # # Copyright Michigan State University Board of Trustees # @@ -118,8 +118,6 @@ sub handler { # This is set and used in &handler() and is also used in # &output_results(). - my $loaderror=&Apache::lonnet::overloaderror($r); - if ($loaderror) { return $loaderror; } # my $closebutton; # button that closes the search window # This button is different for the RAT compared to @@ -268,23 +266,23 @@ sub handler { if ($env{'form.catalogmode'} eq 'interactive') { $closebutton=" +onclick='javascript:select_group()' /> END } else { $closebutton = ''; @@ -324,7 +322,7 @@ END &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check(). '&phase=disp_adv'. - 'catalogmode='.$env{'form.catalogmode'}. + '&catalogmode='.$env{'form.catalogmode'}. '&launch='.$env{'form.launch'}. '&mode='.$env{'form.mode'}, text=>"Course Search", @@ -492,7 +490,7 @@ sub course_search { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check(). '&phase=disp_adv'. - 'catalogmode='.$env{'form.catalogmode'}. + '&catalogmode='.$env{'form.catalogmode'}. '&launch='.$env{'form.launch'}. '&mode='.$env{'form.mode'}, text=>"Course Search", @@ -770,14 +768,26 @@ sub setup_basic_search { portfolio => 'Portfolio Search', ); my ($userelatedwords,$onlysearchdomain,$inclext,$adv_search_link,$scrout); - $userelatedwords = ''; - $onlysearchdomain = ''; + + $userelatedwords = ''; + + $onlysearchdomain = ''; + $adv_search_link = ' $closebutton +
END my $srchtype = 'Catalog'; my $jscript; @@ -878,20 +890,28 @@ function additional_metadata() { } my $scrout= &Apache::loncommon::start_page("Advanced $srchtype Search", $jscript); - $scrout .= <<"ENDHEADER"; -$bread_crumb -'; + $scrout .= &Apache::loncommon::end_page(); $r->print($scrout); return; @@ -1703,7 +1733,7 @@ sub parse_domain_restrictions { foreach (sort @allowed_domains) { $pretty_domains_string .= "".$_." "; } - my %servers = &Apache::lonnet::get_servers(\@allowed_domains, + my %servers = &Apache::lonnet::get_unique_servers(\@allowed_domains, 'library'); $libraries_to_query = [keys(%servers)]; } @@ -2266,8 +2296,8 @@ sub print_sort_form { // &mt('Ascending'), + {asc =>&mt('Ascending'), desc=>&mt('Descending') - )) + }) .''; ## ## Display links for 'prev' and 'next' pages (if necessary) and Display Options @@ -3327,13 +3357,96 @@ SCRIPT } function select_group() { parent.window.location= - "/adm/groupsort?mode=$env{'form.mode'}&catalogmode=import$inhibit_menu&acts="+ + "/adm/groupsort?mode=$env{'form.mode'}&catalogmode=import$inhibit_menu&acts="+ parent.statusframe.document.forms.statusform.elements.acts.value; } // ]]> SCRIPT + # HTML-Markup for 'Set a link for this resource to wishlist' + # this is written via JavaScript document.write (function set_wishlistlink) + # it is split into 3 parts and the inputfields for title and path are left out + # these fields are inserted later to set the values for title and path + # automatically via JavaScript (document.title and location.pathname) + my %folders = &Apache::lonnet::get('wishlist',['folders']); + if ($folders{'folders'} eq '') { + $folders{'folders'} = ''; + } + my $start_page_wishlistlink = + &Apache::loncommon::start_page('Set link to wishlist',undef, + {'only_body' => 1, + 'js_ready' => 1, + 'bgcolor' => '#FFFFFF',}); + + my $warningLink = &mt('You must insert a title!'); + + my $in_page_wishlistlink1 = '\n";
$result .= ''.$values{'author'}.','.
' '.$values{'owner'}.' '.$closebutton.'
$errormsg
';
@@ -3521,7 +3638,7 @@ sub detailed_citation_view {
$result .= ''.&mt($field->{'translate'}).'';
foreach my $item (split(',',$values{$field->{'name'}})){
$item = &Apache::lonnet::clutter($item);
- $result .= &display_url($item,[2,0,1]);
+ $result .= '
'.&display_url($item,1).'
';
}
} elsif (exists($field->{'format'}) && $field->{'format'} ne ''){
$result.= &mt($field->{'translate'},
@@ -3529,7 +3646,7 @@ sub detailed_citation_view {
$values{$field->{'name'}}))."
\n";
} else {
if ($field->{'special'} eq 'url link') {
- $result .= &display_url($jumpurl,[3,0,1]);
+ $result .= '
'.&display_url($jumpurl,1).'
';
} else {
$result.= &mt($field->{'translate'},
$values{$field->{'name'}});
@@ -3583,11 +3700,18 @@ sub summary_view {
}
my $jumpurl=$values{'url'};
$jumpurl=~s|^/ext/|http://|;
- my $link = &display_url($jumpurl,[2,0,1]);
+ my $link = '
'.&display_url($jumpurl,1).'
';
+ my $titleWL = &mt('Set link to wishlist');
$result.=<
+ target="preview">$values{'title'}
+
+
+
+
$link
$values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}
$values{'copyrighttag'}
@@ -3619,7 +3743,7 @@ sub compact_view {
my $jumpurl=$values{'url'};
$jumpurl=~s|^/ext/|http://|;
- my $link = &display_url($jumpurl,[1,1,1]);
+ my $link = &display_url($jumpurl,1);
my $result =
$prefix.'';
@@ -3633,12 +3757,17 @@ sub compact_view {
$result.=' '.
''.
&HTML::Entities::encode($values{'title'},'<>&"').' '.
+ ''.
+ ''.
+ ''.
$link.' '.$values{'author'}.' ('.$values{'domain'}.')';
return $result;
}
sub display_url {
- my ($url,$crumb_args) = @_;
+ my ($url,$skiplast) = @_;
my $link;
if ($url=~m|^/ext/|) {
$url=~s|^/ext/|http://|;
@@ -3646,10 +3775,12 @@ sub display_url {
} elsif ($url=~m{^(http://|/uploaded/)}) {
$link=''.$url.'';
} else {
- $link=&Apache::lonhtmlcommon::crumbs($url,
- 'preview',
- '',
- (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),@{$crumb_args}).' ';
+ $link=&Apache::lonhtmlcommon::crumbs(
+ $url,
+ 'preview',
+ '',
+ (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),
+ $skiplast).' ';
}
return $link;
}
@@ -3672,12 +3803,19 @@ sub fielded_format_view {
my $jumpurl=$values{'url'};
$jumpurl=~s|^/ext/|http://|;
+ my $titleWL = ('Set link to wishlist');
my $result=<
';
+ } else {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>'',
+ text=>$heading,});
+ $start_page .= &Apache::lonhtmlcommon::breadcrumbs();
+ }
+
$r->print(<
+
$heading