Diff for /loncom/interface/lonsearchcat.pm between versions 1.260 and 1.268

version 1.260, 2006/03/23 22:01:58 version 1.268, 2006/06/08 16:58:56
Line 78  use HTML::Entities(); Line 78  use HTML::Entities();
 use Parse::RecDescent;  use Parse::RecDescent;
 use Apache::lonnavmaps;  use Apache::lonnavmaps;
 use Apache::lonindexer();  use Apache::lonindexer();
   use lib '/home/httpd/lib/perl/';
   use LONCAPA;
   
 ######################################################################  ######################################################################
 ######################################################################  ######################################################################
Line 153  sub handler { Line 155  sub handler {
     ##      ##
     my $domain  = $r->dir_config('lonDefDomain');      my $domain  = $r->dir_config('lonDefDomain');
     $diropendb= "/home/httpd/perl/tmp/".      $diropendb= "/home/httpd/perl/tmp/".
         "$env{'user.domain'}_$env{'user.name'}_searchcat.db";          "$env{'user.domain'}_$env{'user.name'}_sel_res.db";
     #      #
     # set the name of the persistent database      # set the name of the persistent database
     #          $env{'form.persistent_db_id'} can only have digits in it.      #          $env{'form.persistent_db_id'} can only have digits in it.
Line 164  sub handler { Line 166  sub handler {
     }      }
   
     my $persistent_db_file = "/home/httpd/perl/tmp/".      my $persistent_db_file = "/home/httpd/perl/tmp/".
         &Apache::lonnet::escape($domain).          &escape($domain).
             '_'.&Apache::lonnet::escape($env{'user.name'}).              '_'.&escape($env{'user.name'}).
                 '_'.$env{'form.persistent_db_id'}.'_persistent_search.db';                  '_'.$env{'form.persistent_db_id'}.'_persistent_search.db';
     ##      ##
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
Line 199  sub handler { Line 201  sub handler {
     'We were unable to retrieve data describing your search. '.      'We were unable to retrieve data describing your search. '.
     'This is a serious error and has been logged. '.      'This is a serious error and has been logged. '.
     'Please alert your LON-CAPA administrator.';      'Please alert your LON-CAPA administrator.';
  return &Apache::loncommon::simple_error_page($r,'Search Error',   &Apache::loncommon::simple_error_page($r,'Search Error',
      $msg);        $msg);
    return OK;
             }              }
         }          }
     } else {      } else {
Line 212  sub handler { Line 215  sub handler {
     untie %groupsearch_db if (tied(%groupsearch_db));      untie %groupsearch_db if (tied(%groupsearch_db));
     if (($env{'form.cleargroupsort'} eq '1') ||       if (($env{'form.cleargroupsort'} eq '1') || 
         (($env{'form.launch'} eq '1') &&           (($env{'form.launch'} eq '1') && 
          ($env{'form.catalogmode'} eq 'groupsearch'))) {           ($env{'form.catalogmode'} eq 'import'))) {
  if (tie(%groupsearch_db,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) {   if (tie(%groupsearch_db,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) {
     &start_fresh_session();      &start_fresh_session();
     untie %groupsearch_db;      untie %groupsearch_db;
Line 221  sub handler { Line 224  sub handler {
             # This is a stupid error to give to the user.                # This is a stupid error to give to the user.  
             # It really tells them nothing.              # It really tells them nothing.
     my $msg = 'Unable to tie hash to db file.';      my $msg = 'Unable to tie hash to db file.';
     return &Apache::loncommon::simple_error_page($r,'Search Error',      &Apache::loncommon::simple_error_page($r,'Search Error',
  $msg);    $msg);
       return OK;
  }   }
     }      }
     ##      ##
Line 256  sub handler { Line 260  sub handler {
             $closebutton .="onClick='self.close()'";              $closebutton .="onClick='self.close()'";
         }          }
         $closebutton .=">\n";          $closebutton .=">\n";
     } elsif ($env{'form.catalogmode'} eq 'groupsearch') {      } elsif ($env{'form.catalogmode'} eq 'import') {
         $closebutton="<input type='button' name='close' value='CLOSE' ";          $closebutton="<input type='button' name='close' value='CLOSE' ";
         if ($env{'form.phase'} =~ /(results|run_search)/) {          if ($env{'form.phase'} =~ /(results|run_search)/) {
     $closebutton .="onClick='parent.close()'";      $closebutton .="onClick='parent.close()'";
Line 363  END Line 367  END
     my $msg =       my $msg = 
  'Unable to create table in which to store search results. '.   'Unable to create table in which to store search results. '.
  'The search has been aborted.';   'The search has been aborted.';
     return &Apache::loncommon::simple_error_page($r,'Search Error',      &Apache::loncommon::simple_error_page($r,'Search Error',
  $msg);    $msg);
       return OK;
         }          }
         delete($env{'form.launch'});          delete($env{'form.launch'});
         if (! &make_form_data_persistent($r,$persistent_db_file)) {          if (! &make_form_data_persistent($r,$persistent_db_file)) {
     my $msg=      my $msg=
  'Unable to properly store search information. '.   'Unable to properly store search information. '.
  'The search has been aborted.';   'The search has been aborted.';
     return &Apache::loncommon::simple_error_page($r,'Search Error',      &Apache::loncommon::simple_error_page($r,'Search Error',
  $msg);    $msg);
       return OK;
  }   }
         ##          ##
         ## Print out the frames interface          ## Print out the frames interface
Line 547  sub course_search { Line 553  sub course_search {
                 } else {                  } else {
                     $url .= '?symb=';                      $url .= '?symb=';
                 }                  }
                 $url .= &Apache::lonnet::escape($resource->symb());                  $url .= &escape($resource->symb());
                 my $title = $resource->compTitle();                  my $title = $resource->compTitle();
                 $r->print('<br /><a href="'.$url.'" target="cat">'.                  $r->print('<br /><a href="'.$url.'" target="cat">'.
                      ($title?$title:$url).'</a>&nbsp;&nbsp;-&nbsp;'.$disctype.'<br />');                       ($title?$title:$url).'</a>&nbsp;&nbsp;-&nbsp;'.$disctype.'<br />');
Line 583  sub checkonthis { Line 589  sub checkonthis {
     my ($extension)=($url=~/\.(\w+)$/);      my ($extension)=($url=~/\.(\w+)$/);
     if (&Apache::loncommon::fileembstyle($extension) eq 'ssi' &&      if (&Apache::loncommon::fileembstyle($extension) eq 'ssi' &&
  ($url) && ($fulltext)) {   ($url) && ($fulltext)) {
  $result.=&Apache::lonnet::ssi_body($url.'?symb='.&Apache::lonnet::escape($symb));   $result.=&Apache::lonnet::ssi_body($url.'?symb='.&escape($symb));
     }      }
     $result=~s/\s+/ /gs;      $result=~s/\s+/ /gs;
     my $applies = 0;      my $applies = 0;
Line 599  sub checkonthis { Line 605  sub checkonthis {
    $href=&Apache::lonenc::encrypted($href)     $href=&Apache::lonenc::encrypted($href)
        .'?symb='.&Apache::lonenc::encrypted($symb);         .'?symb='.&Apache::lonenc::encrypted($symb);
        } else {         } else {
    $href.='?symb='.&Apache::lonnet::escape($symb);     $href.='?symb='.&escape($symb);
        }         }
        $r->print('<a href="'.$href.'" target="cat">'.($title?$title:$url).         $r->print('<a href="'.$href.'" target="cat">'.($title?$title:$url).
  '</a><br />');   '</a><br />');
Line 654  Prints the form for the basic search.  S Line 660  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 $result = ($env{'form.catalogmode'} ne 'groupsearch');      my $result = ($env{'form.catalogmode'} ne 'import');
     my $bread_crumb =      my $bread_crumb =
         &Apache::lonhtmlcommon::breadcrumbs(undef,'Searching','Search_Basic',          &Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Basic',
                                    undef,undef,      $env{'form.catalogmode'} ne 'import');
                                    $env{'form.catalogmode'} ne 'groupsearch');  
     my $scrout = &Apache::loncommon::start_page('Search').$bread_crumb;      my $scrout = &Apache::loncommon::start_page('Search').$bread_crumb;
     if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'})) {      if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'})) {
         # Define interface components          # Define interface components
Line 700  sub print_basic_search_form { Line 705  sub print_basic_search_form {
         }          }
         $scrout.='<table>'.          $scrout.='<table>'.
             '<tr><td align="center" valign="top">'.              '<tr><td align="center" valign="top">'.
             &Apache::lonhtmlcommon::textbox              &Apache::lonhtmlcommon::textbox('basicexp',
             ('basicexp',      $env{'form.basicexp'},50).
              &HTML::Entities::encode($env{'form.basicexp'},'<>&"'),50  
              ).  
              '<br />'.               '<br />'.
             '<font size="-1">'.&searchhelp().'</font>'.'</td>'.              '<font size="-1">'.&searchhelp().'</font>'.'</td>'.
             '<td><font size="-1">'.              '<td><font size="-1">'.
Line 790  Prints the advanced search form. Line 793  Prints the advanced search form.
 sub print_advanced_search_form{  sub print_advanced_search_form{
     my ($r,$closebutton,$hidden_fields) = @_;      my ($r,$closebutton,$hidden_fields) = @_;
     my $bread_crumb =       my $bread_crumb = 
         &Apache::lonhtmlcommon::breadcrumbs(undef,'Searching',          &Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Advanced',
                                             'Search_Advanced',      $env{'form.catalogmode'} ne 'import');
                                             undef,undef,  
                                   $env{'form.catalogmode'} ne 'groupsearch');  
     my %lt=&Apache::lonlocal::texthash('srch' => 'Search',      my %lt=&Apache::lonlocal::texthash('srch' => 'Search',
        'reset' => 'Reset',         'reset' => 'Reset',
        'help' => 'Help');         'help' => 'Help');
Line 1148  sub get_persistent_form_data { Line 1149  sub get_persistent_form_data {
         # End kludge (hopefully)          # End kludge (hopefully)
         next if (exists($env{$name}));          next if (exists($env{$name}));
         my @values = map {           my @values = map { 
             &Apache::lonnet::unescape($_);              &unescape($_);
         } split(',',$persistent_db{$name});          } split(',',$persistent_db{$name});
         next if (@values <1);          next if (@values <1);
         if ($arrays_allowed{$name}) {          if ($arrays_allowed{$name}) {
Line 1194  sub get_persistent_data { Line 1195  sub get_persistent_data {
             next;              next;
         }          }
         my @values = map {           my @values = map { 
             &Apache::lonnet::unescape($_);              &unescape($_);
         } split(',',$persistent_db{$name});          } split(',',$persistent_db{$name});
         if (@values <= 1) {          if (@values <= 1) {
             push @Values,$values[0];              push @Values,$values[0];
Line 1231  sub make_persistent { Line 1232  sub make_persistent {
     foreach my $name (keys(%save)) {      foreach my $name (keys(%save)) {
         my @values = (ref($save{$name}) ? @{$save{$name}} : ($save{$name}));          my @values = (ref($save{$name}) ? @{$save{$name}} : ($save{$name}));
         # We handle array references, but not recursively.          # We handle array references, but not recursively.
         my $store = join(',', map { &Apache::lonnet::escape($_); } @values );          my $store = join(',', map { &escape($_); } @values );
         $persistent_db{$name} = $store;          $persistent_db{$name} = $store;
     }      }
     untie(%persistent_db);      untie(%persistent_db);
Line 1314  sub parse_advanced_search { Line 1315  sub parse_advanced_search {
     foreach ('mode','form','element') {      foreach ('mode','form','element') {
  # is this required?  Hmmm.   # is this required?  Hmmm.
  next if (! exists($env{'form.'.$_}));   next if (! exists($env{'form.'.$_}));
  $env{'form.'.$_}=&Apache::lonnet::unescape($env{'form.'.$_});   $env{'form.'.$_}=&unescape($env{'form.'.$_});
  $env{'form.'.$_}=~s/[^\w\/\s\(\)\=\-\"\']//g;   $env{'form.'.$_}=~s/[^\w\/\s\(\)\=\-\"\']//g;
     }      }
     # Preprocess the category form element.      # Preprocess the category form element.
Line 1582  sub parse_basic_search { Line 1583  sub parse_basic_search {
     foreach ('mode','form','element') {      foreach ('mode','form','element') {
  # is this required?  Hmmm.   # is this required?  Hmmm.
  next unless (exists($env{"form.$_"}));   next unless (exists($env{"form.$_"}));
  $env{"form.$_"}=&Apache::lonnet::unescape($env{"form.$_"});   $env{"form.$_"}=&unescape($env{"form.$_"});
  $env{"form.$_"}=~s/[^\w\/\s\(\)\=\-\"\']//g;   $env{"form.$_"}=~s/[^\w\/\s\(\)\=\-\"\']//g;
     }      }
     my ($libraries_to_query,$pretty_domains_string) = &parse_domain_restrictions();      my ($libraries_to_query,$pretty_domains_string) = &parse_domain_restrictions();
Line 2105  END Line 2106  END
     my $start_page = &Apache::loncommon::start_page('Results',$js,      my $start_page = &Apache::loncommon::start_page('Results',$js,
     {'only_body' => 1});      {'only_body' => 1});
     my $breadcrumbs=      my $breadcrumbs=
         &Apache::lonhtmlcommon::breadcrumbs          &Apache::lonhtmlcommon::breadcrumbs('Searching','Searching',
         (undef,'Searching','Searching',undef,undef,      $env{'form.catalogmode'} ne 'import');
          $env{'form.catalogmode'} ne 'groupsearch');  
   
     my $result = <<END;      my $result = <<END;
 $start_page  $start_page
 $breadcrumbs  $breadcrumbs
 <form name="statusform" action="" method="POST">  <form name="statusform" action="" method="post" target="_top">
   <input type="hidden" name="catalogmode" value="import" />
 <input type="hidden" name="Queue" value="" />  <input type="hidden" name="Queue" value="" />
 END  END
   
Line 2335  sub run_search { Line 2336  sub run_search {
     #      #
     my $start_page = &Apache::loncommon::start_page('Search Status',undef,      my $start_page = &Apache::loncommon::start_page('Search Status',undef,
     {'only_body' => 1});      {'only_body' => 1});
     my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs      my $breadcrumbs =
         (undef,'Searching','Searching',undef,undef,   &Apache::lonhtmlcommon::breadcrumbs('Searching','Searching',
          $env{'form.catalogmode'} ne 'groupsearch');      $env{'form.catalogmode'} ne 'import');
     $r->print(<<END);      $r->print(<<END);
 $start_page  $start_page
 $breadcrumbs  $breadcrumbs
Line 2527  END Line 2528  END
     # 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(&Apache::loncommon::end_page());
 #    if ($env{'form.catalogmode'} ne 'groupsearch') {  #    if ($env{'form.catalogmode'} ne 'import') {
         $r->print("<script>".          $r->print("<script>".
                       "window.location='/adm/searchcat?".                        "window.location='/adm/searchcat?".
                       "phase=sort&".                        "phase=sort&".
Line 2594  sub display_results { Line 2595  sub display_results {
     }      }
     ##      ##
     ## $checkbox_num is a count of the number of checkboxes output on the       ## $checkbox_num is a count of the number of checkboxes output on the 
     ## page this is used only during catalogmode=groupsearch.      ## page this is used only during catalogmode=import.
     my $checkbox_num = 0;      my $checkbox_num = 0;
     ##      ##
     ## Get the catalog controls setup      ## Get the catalog controls setup
     ##      ##
     my $action = "/adm/searchcat?phase=results";      my $action = "/adm/searchcat?phase=results";
     ##      ##
     ## Deal with groupsearch by opening the groupsearch db file.      ## Deal with import by opening the import db file.
     if ($env{'form.catalogmode'} eq 'groupsearch') {      if ($env{'form.catalogmode'} eq 'import') {
         if (! tie(%groupsearch_db,'GDBM_File',$diropendb,          if (! tie(%groupsearch_db,'GDBM_File',$diropendb,
                   &GDBM_WRCREAT(),0640)) {                    &GDBM_WRCREAT(),0640)) {
             $r->print('Unable to store import results.</form>'.              $r->print('Unable to store import results.</form>'.
Line 2825  onClick="javascript:select_data('$title' Line 2826  onClick="javascript:select_data('$title'
 </font>  </font>
 END  END
         }          }
     } elsif ($env{'form.catalogmode'} eq 'groupsearch') {      } elsif ($env{'form.catalogmode'} eq 'import') {
         $groupsearch_db{"pre_${fnum}_link"}=$url;          $groupsearch_db{"pre_${fnum}_link"}=$url;
         $groupsearch_db{"pre_${fnum}_title"}=$title;          $groupsearch_db{"pre_${fnum}_title"}=$title;
         $output.=<<END;          $output.=<<END;
Line 2857  sub parse_row { Line 2858  sub parse_row {
         &set_up_table_structure();          &set_up_table_structure();
     }      }
     for (my $i=0;$i<=$#Row;$i++) {      for (my $i=0;$i<=$#Row;$i++) {
         $Fields{$Datatypes[$i]->{'name'}}=&Apache::lonnet::unescape($Row[$i]);          $Fields{$Datatypes[$i]->{'name'}}=&unescape($Row[$i]);
     }      }
     $Fields{'language'} =       $Fields{'language'} = 
         &Apache::loncommon::languagedescription($Fields{'language'});          &Apache::loncommon::languagedescription($Fields{'language'});
Line 2894  sub parse_raw_result { Line 2895  sub parse_raw_result {
     # conclude from self to others regarding fields      # conclude from self to others regarding fields
     my %Fields=&LONCAPA::lonmetadata::metadata_col_to_hash      my %Fields=&LONCAPA::lonmetadata::metadata_col_to_hash
         (map {          (map {
             &Apache::lonnet::unescape($_);              &unescape($_);
         } (split(/\,/,$result)) );          } (split(/\,/,$result)) );
     return %Fields;      return %Fields;
 }  }
Line 2932  sub handle_custom_fields { Line 2933  sub handle_custom_fields {
         if ($result=~/^(custom\=.*)$/) { # grab all custom metadata          if ($result=~/^(custom\=.*)$/) { # grab all custom metadata
             my $tmp=$result;              my $tmp=$result;
             $tmp=~s/^custom\=//;              $tmp=~s/^custom\=//;
             my ($k,$v)=map {&Apache::lonnet::unescape($_);              my ($k,$v)=map {&unescape($_);
                         } split(/\,/,$tmp);                          } split(/\,/,$tmp);
             $customhash{$k}=$v;              $customhash{$k}=$v;
         }          }
Line 2964  The following environment variables are Line 2965  The following environment variables are
   
 =item 'form.catalogmode'   =item 'form.catalogmode' 
   
 Checked for 'interactive' and 'groupsearch'.  Checked for 'interactive' and 'import'.
   
 =item 'form.mode'  =item 'form.mode'
   
Line 3056  function changeURL(val) { Line 3057  function changeURL(val) {
 SCRIPT  SCRIPT
         }          }
     }      }
     $js.=<<SCRIPT if $env{'form.catalogmode'} eq 'groupsearch';      $js.=<<SCRIPT if $env{'form.catalogmode'} eq 'import';
 <script type="text/javascript">  <script type="text/javascript">
     function queue(checkbox_num,val) {      function queue(checkbox_num,val) {
         if (document.forms.results.returnvalues.length != "undefined" &&          if (document.forms.results.returnvalues.length != "undefined" &&
Line 3076  SCRIPT Line 3077  SCRIPT
     }      }
     function select_group() {      function select_group() {
  parent.window.location=   parent.window.location=
     "/adm/groupsort?mode=$env{'form.mode'}&catalogmode=groupsearch&acts="+      "/adm/groupsort?mode=$env{'form.mode'}&catalogmode=import&acts="+
     parent.statusframe.document.forms.statusform.elements.Queue.value;      parent.statusframe.document.forms.statusform.elements.Queue.value;
     }      }
 </script>  </script>
Line 3086  SCRIPT Line 3087  SCRIPT
      {'only_body' =>1});       {'only_body' =>1});
     my $result=<<END;      my $result=<<END;
 $start_page  $start_page
 <form name="results" method="post" action="/adm/searchcat" >  <form name="results" method="post" action="/adm/searchcat">
 <input type="hidden" name="Queue" value="" />  
 $importbutton  $importbutton
 END  END
     return $result;      return $result;
Line 3127  var targetwin = opener; Line 3127  var targetwin = opener;
 var queue = '';  var queue = '';
 </script>  </script>
 JS  JS
     my $html     = &Apache::lonxml::xmlbegin();  
     my $head     = &Apache::loncommon::head('LON-CAPA Digital Library Search Results',$js);      my $start_page =
           &Apache::loncommon::start_page('LON-CAPA Digital Library Search Results',
          $js,
          {'frameset'    => 1,
    'add_entries' => {
       'rows' => "150,*",},});
       my $end_page =
           &Apache::loncommon::end_page({'frameset' => 1});
   
     my $result = <<"ENDFRAMES";      my $result = <<"ENDFRAMES";
 $html  $start_page
 $head  
 <frameset rows="150,*">  
     <frame name="statusframe"  src="$run_search_link">      <frame name="statusframe"  src="$run_search_link">
     <frame name="resultsframe" src="$results_link">      <frame name="resultsframe" src="$results_link">
 </frameset>  $end_page
 </html>  
 ENDFRAMES  ENDFRAMES
   
     $r->print($result);      $r->print($result);
Line 3206  sub detailed_citation_view { Line 3211  sub detailed_citation_view {
     my $jumpurl=$values{'url'};      my $jumpurl=$values{'url'};
     $jumpurl=~s/^\/ext\//http\:\/\//;      $jumpurl=~s/^\/ext\//http\:\/\//;
     $result .= '<b>'.$prefix.      $result .= '<b>'.$prefix.
         '<img src="'.&Apache::loncommon::icon($values{'url'}).' " />'.'&nbsp;'.          '<img src="'.&Apache::loncommon::icon($values{'url'}).'" />'.'&nbsp;'.
         '<a href="'.$jumpurl.'" '.          '<a href="'.$jumpurl.'" '.
         'target="search_preview">'.$values{'title'}."</a></b>\n";          'target="search_preview">'.$values{'title'}."</a></b>\n";
     $result .= "<p>\n";      $result .= "<p>\n";
Line 3272  sub detailed_citation_view { Line 3277  sub detailed_citation_view {
         next if (! exists($values{$field->{'name'}}) ||          next if (! exists($values{$field->{'name'}}) ||
                  $values{$field->{'name'}} eq '');                   $values{$field->{'name'}} eq '');
         if (exists($field->{'type'}) && $field->{'type'} eq 'list') {          if (exists($field->{'type'}) && $field->{'type'} eq 'list') {
             $result .= '<b>'.&mt($field->{'translate'}).'</b><ul>';              $result .= '<b>'.&mt($field->{'translate'}).'</b>';
             foreach my $item (split(',',$values{$field->{'name'}})){              foreach my $item (split(',',$values{$field->{'name'}})){
                 $result .= '<li>'.                  $result .= 
                     '<a target="search_preview" '.    &Apache::lonhtmlcommon::crumbs($item,
                     'href="'.$jumpurl.'">'.$item.'</a></li>';    (($env{'form.catalogmode'} eq 'import')?'_top':'preview'),
     '/res',
     (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),1);
             }              }
             $result .= '</ul>';  
         } elsif (exists($field->{'format'}) && $field->{'format'} ne ''){          } elsif (exists($field->{'format'}) && $field->{'format'} ne ''){
             $result.= &mt($field->{'translate'},              $result.= &mt($field->{'translate'},
                           sprintf($field->{'format'},                            sprintf($field->{'format'},
                                   $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.=                   $result.=
                      &mt($field->{'translate'},    &Apache::lonhtmlcommon::crumbs($jumpurl,
                          '<a href="'.$jumpurl.'" '.    (($env{'form.catalogmode'} eq 'import')?'_top':'preview'),
                          'target="search_preview">'.    '',
                          $values{$field->{'name'}}.    (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),1);
                          '</a>');  
             } else {              } else {
                 $result.= &mt($field->{'translate'},                  $result.= &mt($field->{'translate'},
                               $values{$field->{'name'}});                                $values{$field->{'name'}});
Line 3347  sub summary_view { Line 3352  sub summary_view {
     }      }
     my $jumpurl=$values{'url'};      my $jumpurl=$values{'url'};
     $jumpurl=~s/^\/ext\//http\:\/\//;      $jumpurl=~s/^\/ext\//http\:\/\//;
       my $link=&Apache::lonhtmlcommon::crumbs($jumpurl,
     (($env{'form.catalogmode'} eq 'import')?'_top':'preview'),
     '',
     (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),1);
   
     $result.=<<END;      $result.=<<END;
 <a href="$jumpurl"   <a href="$jumpurl" 
    target='search_preview'>$values{'title'}</a><br />     target='search_preview'>$values{'title'}</a>$link
 $values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}<br />  $values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}<br />
 $values{'copyrighttag'}<br />  $values{'copyrighttag'}<br />
 $values{'extrashow'}  $values{'extrashow'}
Line 3384  sub compact_view { Line 3393  sub compact_view {
     my ($prefix,%values) = @_;      my ($prefix,%values) = @_;
     my $jumpurl=$values{'url'};      my $jumpurl=$values{'url'};
     $jumpurl=~s/^\/ext\//http\:\/\//;      $jumpurl=~s/^\/ext\//http\:\/\//;
       my $link=&Apache::lonhtmlcommon::crumbs($jumpurl,
     (($env{'form.catalogmode'} eq 'import')?'_top':'preview'),
     '',
     (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),1);
     my $result =       my $result = 
         $prefix.'<img src="'.&Apache::loncommon::icon($values{'url'}).'">';          $prefix.'<img src="'.&Apache::loncommon::icon($values{'url'}).'">';
     if (exists($env{'form.sortfield'}) &&       if (exists($env{'form.sortfield'}) && 
Line 3394  sub compact_view { Line 3406  sub compact_view {
         $result .= '&nbsp;'.$tmp.'&nbsp;';          $result .= '&nbsp;'.$tmp.'&nbsp;';
     }      }
     $result.='&nbsp;<a href="'.$jumpurl.'" target="search_preview">'.      $result.='&nbsp;<a href="'.$jumpurl.'" target="search_preview">'.
         $values{'title'}.'</a>'.('&nbsp;'x2).          $values{'title'}.'</a>'.('&nbsp;'x2).$link.
         '<b>'.$values{'author'}.'</b> ('.$values{'domain'}.')<br />';          '<b>'.$values{'author'}.'</b> ('.$values{'domain'}.')<br />';
     return $result;      return $result;
 }  }

Removed from v.1.260  
changed lines
  Added in v.1.268


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>