Diff for /loncom/interface/lonsearchcat.pm between versions 1.113 and 1.119

version 1.113, 2001/12/17 00:56:48 version 1.119, 2002/05/22 16:21:50
Line 29 Line 29
 # 3/8, 3/12, 3/13, 3/14, 3/15, 3/19 Scott Harrison  # 3/8, 3/12, 3/13, 3/14, 3/15, 3/19 Scott Harrison
 # 3/20, 3/21, 3/22, 3/26, 3/27, 4/2, 8/15, 8/24, 8/25 Scott Harrison  # 3/20, 3/21, 3/22, 3/26, 3/27, 4/2, 8/15, 8/24, 8/25 Scott Harrison
 # 10/12,10/14,10/15,10/16,11/28,11/29,12/10,12/12,12/16 Scott Harrison  # 10/12,10/14,10/15,10/16,11/28,11/29,12/10,12/12,12/16 Scott Harrison
   # YEAR=2002
   # 1/17 Scott Harrison
 #  #
 ###  ###
   
Line 66  my %hitcount; # stores number of hits pe Line 68  my %hitcount; # stores number of hits pe
 # -- dynamically rendered interface components  # -- dynamically rendered interface components
 my $closebutton; # button that closes the search window  my $closebutton; # button that closes the search window
 my $importbutton; # button to take the selected results and go to group sorting  my $importbutton; # button to take the selected results and go to group sorting
   my $hidden;
   
 # -- miscellaneous variables  # -- miscellaneous variables
 my $scrout; # string that holds portions of the screen output  my $scrout; # string that holds portions of the screen output
Line 95  my $advancedviewselect=<<END; Line 98  my $advancedviewselect=<<END;
 END  END
   
 # ----------------------------------------------------------------------- BEGIN  # ----------------------------------------------------------------------- BEGIN
 sub BEGIN {  BEGIN {
     {      {
  my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}.   my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}.
  '/hosts.tab');   '/hosts.tab');
Line 109  sub BEGIN { Line 112  sub BEGIN {
     }      }
 }  }
   
   #------------------------------------------------------------- global variables
 my $diropendb = "";  my $diropendb = "";
 my $domain = "";  my $domain = "";
   
Line 116  my $domain = ""; Line 120  my $domain = "";
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
     untie %hash;      untie %hash;
     &get_unprocessed_cgi();  
   
     $r->content_type('text/html');      $r->content_type('text/html');
     $r->send_http_header;      $r->send_http_header;
     return OK if $r->header_only;      return OK if $r->header_only;
   
     $domain  = $r->dir_config('lonDefDomain');      $domain  = $r->dir_config('lonDefDomain');
   
     $diropendb= "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_searchcat.db";      $diropendb= "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_searchcat.db";
   
       &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                ['catalogmode','launch','acts','mode','form','element']);
   
     if ($ENV{'form.launch'} eq '1') {      if ($ENV{'form.launch'} eq '1') {
  if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) {   if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) {
     &start_fresh_session();      &start_fresh_session();
Line 138  sub handler { Line 143  sub handler {
  }   }
     }      }
   
   # --------------------------- Produce some output, so people know it is working
   
       $r->print("\n");
       $r->rflush;
   
 # ----------------------------------- configure dynamic components of interface  # ----------------------------------- configure dynamic components of interface
     my $hidden='';  
     if ($ENV{'form.catalogmode'} eq 'interactive') {      if ($ENV{'form.catalogmode'} eq 'interactive') {
  $hidden="<input type='hidden' name='catalogmode' value='interactive'>".   $hidden="<input type='hidden' name='catalogmode' value='interactive'>".
     "\n";      "\n";
Line 158  END Line 168  END
 onClick='javascript:select_group()'>  onClick='javascript:select_group()'>
 END  END
     }      }
       $hidden .= <<END;
   <input type='hidden' name='mode'    value='$ENV{'form.mode'}'>
   <input type='hidden' name='form'    value='$ENV{'form.form'}'>
   <input type='hidden' name='element' value='$ENV{'form.element'}'>
   <input type='hidden' name='date' value='2'>
   END
 # ------------------------------------------------------ Determine current user  # ------------------------------------------------------ Determine current user
     $yourself=$ENV{'user.name'}.'@'.$ENV{'user.domain'};      $yourself=$ENV{'user.name'}.'@'.$ENV{'user.domain'};
   
Line 303  $scrout.=' <i>initial users of this syst Line 318  $scrout.=' <i>initial users of this syst
 <script type="text/javascript">  <script type="text/javascript">
     function openhelp(val) {      function openhelp(val) {
  openhelpwin=open('/adm/help/searchcat.html','helpscreen',   openhelpwin=open('/adm/help/searchcat.html','helpscreen',
      'scrollbars=1,width=400,height=300');       'scrollbars=1,width=600,height=300');
  openhelpwin.focus();   openhelpwin.focus();
     }      }
 </script>  </script>
Line 353  ENDDOCUMENT Line 368  ENDDOCUMENT
     return OK;      return OK;
 }   } 
   
 # ----------- grab unprocessed CGI variables that may have been appended to URL  
 sub get_unprocessed_cgi {  
     foreach (split(/&/,$ENV{'QUERY_STRING'})) {  
        my ($name, $value) = split(/=/,$_);  
        $value =~ tr/+/ /;  
        $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;  
        if ($name eq 'catalogmode' or $name eq 'launch' or $name eq 'acts') {  
    $ENV{'form.'.$name}=$value;  
        }  
     }  
 }  
   
 # ------------------------------------------------------------- make persistent  # ------------------------------------------------------------- make persistent
 sub make_persistent {  sub make_persistent {
     my $persistent='';      my $persistent='';
Line 414  sub dateboxes { Line 417  sub dateboxes {
     my ($name,$defaultmonth,$defaultday,$defaultyear,      my ($name,$defaultmonth,$defaultday,$defaultyear,
  $currentmonth,$currentday,$currentyear)=@_;   $currentmonth,$currentday,$currentyear)=@_;
     ($defaultmonth,$defaultday,$defaultyear)=('','','');      ($defaultmonth,$defaultday,$defaultyear)=('','','');
     my $month=<<END;      #
 <select name="${name}_month">      # Day
 <option value='$defaultmonth'> </option>  
 <option value="1">January</option>  
 <option value="2">February</option>  
 <option value="3">March</option>  
 <option value="4">April</option>  
 <option value="5">May</option>  
 <option value="6">June</option>  
 <option value="7">July</option>  
 <option value="8">August</option>  
 <option value="9">September</option>  
 <option value="10">October</option>  
 <option value="11">November</option>  
 <option value="12">December</option>  
 </select>  
 END  
     $month=~s/(\"$currentmonth\")/$1 SELECTED/ if length($currentmonth);  
     my $day=<<END;      my $day=<<END;
 <select name="${name}_day">  <select name="${name}_day">
 <option value='$defaultday'> </option>  <option value='$defaultday'> </option>
 <option value="1">1</option>  
 <option value="2">2</option>  
 <option value="3">3</option>  
 <option value="4">4</option>  
 <option value="5">5</option>  
 <option value="6">6</option>  
 <option value="7">7</option>  
 <option value="8">8</option>  
 <option value="9">9</option>  
 <option value="10">10</option>  
 <option value="11">11</option>  
 <option value="12">12</option>  
 <option value="13">13</option>  
 <option value="14">14</option>  
 <option value="15">15</option>  
 <option value="16">16</option>  
 <option value="17">17</option>  
 <option value="18">18</option>  
 <option value="19">19</option>  
 <option value="20">20</option>  
 <option value="21">21</option>  
 <option value="22">22</option>  
 <option value="23">23</option>  
 <option value="24">24</option>  
 <option value="25">25</option>  
 <option value="26">26</option>  
 <option value="27">27</option>  
 <option value="28">28</option>  
 <option value="29">29</option>  
 <option value="30">30</option>  
 <option value="31">31</option>  
 </select>  
 END  END
       for (my $i = 1; $i<=31; $i++) {
    $day.="<option value=\"$i\">$i</option>\n";
       }
       $day.="</select>\n";
     $day=~s/(\"$currentday\")/$1 SELECTED/ if length($currentday);      $day=~s/(\"$currentday\")/$1 SELECTED/ if length($currentday);
       #
       # Month
       my $month=<<END;
   <select name="${name}_month">
   <option value='$defaultmonth'> </option>
   END
       my $i = 1;
       foreach (qw/January February March April May June 
        July August September October November December /){
    $month .="<option value=\"$i\">$_</option>\n";
    $i++;
       }
       $month.="</select>\n";
       $month=~s/(\"$currentmonth\")/$1 SELECTED/ if length($currentmonth);
       #
       # Year (obviously)
     my $year=<<END;      my $year=<<END;
 <select name="${name}_year">  <select name="${name}_year">
 <option value='$defaultyear'> </option>  <option value='$defaultyear'> </option>
 <option value="1976">1976</option>  
 <option value="1977">1977</option>  
 <option value="1978">1978</option>  
 <option value="1979">1979</option>  
 <option value="1980">1980</option>  
 <option value="1981">1981</option>  
 <option value="1982">1982</option>  
 <option value="1983">1983</option>  
 <option value="1984">1984</option>  
 <option value="1985">1985</option>  
 <option value="1986">1986</option>  
 <option value="1987">1987</option>  
 <option value="1988">1988</option>  
 <option value="1989">1989</option>  
 <option value="1990">1990</option>  
 <option value="1991">1991</option>  
 <option value="1992">1992</option>  
 <option value="1993">1993</option>  
 <option value="1994">1994</option>  
 <option value="1995">1995</option>  
 <option value="1996">1996</option>  
 <option value="1997">1997</option>  
 <option value="1998">1998</option>  
 <option value="1999">1999</option>  
 <option value="2000">2000</option>  
 <option value="2001">2001</option>  
 <option value="2002">2002</option>  
 <option value="2003">2003</option>  
 <option value="2004">2004</option>  
 <option value="2005">2005</option>  
 <option value="2006">2006</option>  
 <option value="2007">2007</option>  
 <option value="2008">2008</option>  
 <option value="2009">2009</option>  
 <option value="2010">2010</option>  
 <option value="2011">2011</option>  
 <option value="2012">2012</option>  
 <option value="2013">2013</option>  
 <option value="2014">2014</option>  
 <option value="2015">2015</option>  
 <option value="2016">2016</option>  
 <option value="2017">2017</option>  
 <option value="2018">2018</option>  
 <option value="2019">2019</option>  
 <option value="2020">2020</option>  
 <option value="2021">2021</option>  
 <option value="2022">2022</option>  
 <option value="2023">2023</option>  
 <option value="2024">2024</option>  
 <option value="2025">2025</option>  
 <option value="2026">2026</option>  
 <option value="2027">2027</option>  
 <option value="2028">2028</option>  
 <option value="2029">2029</option>  
 <option value="2030">2030</option>  
 <option value="2031">2031</option>  
 <option value="2032">2032</option>  
 <option value="2033">2033</option>  
 <option value="2034">2034</option>  
 <option value="2035">2035</option>  
 <option value="2036">2036</option>  
 <option value="2037">2037</option>  
 <option value="2038">2038</option>  
 <option value="2039">2039</option>  
 <option value="2040">2040</option>  
 <option value="2041">2041</option>  
 <option value="2042">2042</option>  
 <option value="2043">2043</option>  
 <option value="2044">2044</option>  
 <option value="2045">2045</option>  
 <option value="2046">2046</option>  
 <option value="2047">2047</option>  
 <option value="2048">2048</option>  
 <option value="2049">2049</option>  
 <option value="2050">2050</option>  
 <option value="2051">2051</option>  
 </select>  
 END  END
       my $maxyear = 2051; 
       for (my $i = 1976; $i<=$maxyear; $i++) {
    $year.="<option value=\"$i\">$i</option>\n";
       }
       $year.="</select>\n";
     $year=~s/(\"$currentyear\")/$1 SELECTED/ if length($currentyear);      $year=~s/(\"$currentyear\")/$1 SELECTED/ if length($currentyear);
     return "$month$day$year";      return "$month$day$year";
 }  }
Line 572  sub selectbox { Line 475  sub selectbox {
     return $selout.'</select>';      return $selout.'</select>';
 }  }
   
 sub testf {  
     return @_[0];  
 }  
   
 # ----------------------------------------------- Performing an advanced search  # ----------------------------------------------- Performing an advanced search
 sub advancedsearch {  sub advancedsearch {
     my ($r,$envhash)=@_;      my ($r,$envhash)=@_;
Line 594  sub advancedsearch { Line 493  sub advancedsearch {
    'custommetadata','customshow') {     'custommetadata','customshow') {
  $ENV{"form.$field"}=~s/[^\w\/\s\(\)\=\-\"\']//g;   $ENV{"form.$field"}=~s/[^\w\/\s\(\)\=\-\"\']//g;
     }      }
       foreach ('mode','form','element') {
    # is this required?  Hmmm.
    next unless (exists($ENV{"form.$_"}));
    $ENV{"form.$_"}=&Apache::lonnet::unescape($ENV{"form.$_"});
    $ENV{"form.$_"}=~s/[^\w\/\s\(\)\=\-\"\']//g;
       }
     # Check to see if enough information was filled in      # Check to see if enough information was filled in
     for my $field ('title','author','subject','keywords','url','version',      for my $field ('title','author','subject','keywords','url','version',
    'notes','abstract','mime','language','owner',     'notes','abstract','mime','language','owner',
Line 701  sub basicsearch { Line 605  sub basicsearch {
     for my $field ('basicexp') {      for my $field ('basicexp') {
  $ENV{"form.$field"}=~s/[^\w\s\(\)\-]//g;   $ENV{"form.$field"}=~s/[^\w\s\(\)\-]//g;
     }      }
       foreach ('mode','form','element') {
    # is this required?  Hmmm.
    next unless (exists($ENV{"form.$_"}));
    $ENV{"form.$_"}=&Apache::lonnet::unescape($ENV{"form.$_"});
    $ENV{"form.$_"}=~s/[^\w\/\s\(\)\=\-\"\']//g;
       }
   
     # Check to see if enough is filled in      # Check to see if enough is filled in
     unless (&filled($ENV{'form.basicexp'})) {      unless (&filled($ENV{'form.basicexp'})) {
Line 864  BEGINNING Line 774  BEGINNING
   
     # conditional output of script functions dependent on the mode in      # conditional output of script functions dependent on the mode in
     # which the search was invoked      # which the search was invoked
         $r->print(<<SCRIPT) if $ENV{'form.catalogmode'} eq 'interactive';      if ($ENV{'form.catalogmode'} eq 'interactive'){
    if (! exists($ENV{'form.mode'}) || $ENV{'form.mode'} ne 'edit') {
               $r->print(<<SCRIPT) 
 <script type="text/javascript">  <script type="text/javascript">
     function select_data(title,url) {      function select_data(title,url) {
  changeTitle(title);   changeTitle(title);
Line 883  BEGINNING Line 795  BEGINNING
     }      }
 </script>  </script>
 SCRIPT  SCRIPT
         $r->print(<<SCRIPT) if $ENV{'form.catalogmode'} eq 'groupsearch';          } elsif ($ENV{'form.mode'} eq 'edit') {
               my $form = $ENV{'form.form'};
               my $element = $ENV{'form.element'};
               $r->print(<<SCRIPT) 
   <script type="text/javascript">
   function select_data(title,url) {
       changeURL(url);
       self.close();
   }
   function changeTitle(val) {
   }
   function changeURL(val) {
       if (window.opener.document) {
           window.opener.document.forms["$form"].elements["$element"].value=val;
       } else {
    var url = 'forms[\"$form\"].elements[\"$element\"].value';
           alert("Unable to transfer data to "+url);
       }
   }
   </script>
   SCRIPT
           }
       }
       $r->print(<<SCRIPT) if $ENV{'form.catalogmode'} eq 'groupsearch';
 <script type="text/javascript">  <script type="text/javascript">
     function select_data(title,url) {      function select_data(title,url) {
 // alert('DEBUG: Should be storing '+title+' and '+url);  // alert('DEBUG: Should be storing '+title+' and '+url);
Line 897  SCRIPT Line 832  SCRIPT
  }   }
     }      }
     function select_group() {      function select_group() {
  window.location="/adm/groupsort?catalogmode=groupsearch&acts="+   window.location=
       "/adm/groupsort?mode=$ENV{'form.mode'}&catalogmode=groupsearch&acts="+
     document.forms.results.acts.value;      document.forms.results.acts.value;
     }      }
 </script>  </script>
 SCRIPT  SCRIPT
         $r->print(<<SCRIPT);      $r->print(<<SCRIPT);
 <script type="text/javascript">  <script type="text/javascript">
     function displayinfo(val) {      function displayinfo(val) {
  popwin.document.forms.popremain.sdetails.value=val;   popwin.document.forms.popremain.sdetails.value=val;
Line 913  SCRIPT Line 849  SCRIPT
  openhelpwin.focus();   openhelpwin.focus();
     }      }
     function abortsearch(val) {      function abortsearch(val) {
  openhelpwin=open('/adm/help/searchcat.html','helpscreen',   popwin.close();
      'scrollbars=1,width=400,height=300');  
  openhelpwin.focus();  
     }      }
 </script>  </script>
 SCRIPT  SCRIPT
Line 930  SCRIPT Line 864  SCRIPT
 CATALOGBEGIN  CATALOGBEGIN
         $r->print(<<CATALOGCONTROLS);          $r->print(<<CATALOGCONTROLS);
 <form name='results' method="post" action="/adm/searchcat">  <form name='results' method="post" action="/adm/searchcat">
   $hidden
 <input type='hidden' name='acts' value='' />  <input type='hidden' name='acts' value='' />
 <input type='button' value='Revise search request'  <input type='button' value='Revise search request'
 onClick='this.form.submit();' />  onClick='this.form.submit();' />
Line 973  RESULTS Line 908  RESULTS
  $grid.=$sk;   $grid.=$sk;
  my $hc;   my $hc;
  if ($rhash{$sk} eq 'con_lost') {   if ($rhash{$sk} eq 'con_lost') {
     $hc="!!!BAD CONNECTION, CONTACT SYSTEM ADMINISTRATOR!!!";      $hc="BAD CONNECTION, CONTACT SYSTEM ADMINISTRATOR ";
  }   }
  else {   else {
     $hc="'+\"'\"+\"+hc['$sk']+\"+\"'\"+'";      $hc="'+\"'\"+\"+hc['$sk']+\"+\"'\"+'";
Line 992  RESULTS Line 927  RESULTS
     }      }
     $r->print(<<ENDPOP);      $r->print(<<ENDPOP);
 <script type="text/javascript">  <script type="text/javascript">
     popwin=open('','popwin','scrollbars=1,width=400,height=200');      popwin=open('','popwin','scrollbars=1,width=400,height=220');
     popwin.focus();      popwin.focus();
     popwin.document.writeln('<'+'html>');      popwin.document.writeln('<'+'html>');
     popwin.document.writeln('<'+'head>');      popwin.document.writeln('<'+'head>');
Line 1020  RESULTS Line 955  RESULTS
         $grid          $grid
         '<'+'br />'+          '<'+'br />'+
  'Server details '+   'Server details '+
  '<'+'input type="text" size="25" name="sdetails"'+   '<'+'input type="text" size="35" name="sdetails"'+
  ' value="" />'+   ' value="" />'+
  '<'+'br />'+   '<'+'br />'+
  ' <'+'input type="button" name="button"'+   ' <'+'input type="button" name="button"'+
  ' value="abort search and view current results" '+   ' value="close this window" '+
  ' onClick="javascript:opener.abortsearch()" />'+   ' onClick="javascript:opener.abortsearch()" />'+
  ' <'+'input type="button" name="button"'+   ' <'+'input type="button" name="button"'+
  ' value="help" onClick="javascript:opener.openhelp()" />'+   ' value="help" onClick="javascript:opener.openhelp()" />'+
Line 1057  ENDPOP Line 992  ENDPOP
  my $replyfile='';   my $replyfile='';
   
  if ($reply eq 'con_lost') {   if ($reply eq 'con_lost') {
     $r->print('<script type="text/javascript">popwin.document.img'.      &popwin_imgupdate($r,$sn,"srvbad.gif");
       $sn.'.'.  
       'src="/adm/lonIcons/srvbad.gif";</script>'.  
       "\n");  
     $r->rflush();  
     $bloop--;      $bloop--;
     $orkey{$rkey}=1;      $orkey{$rkey}=1;
  }   }
Line 1073  ENDPOP Line 1004  ENDPOP
  my $temp=0;   my $temp=0;
       WLOOP: while (1) {        WLOOP: while (1) {
   if (-e $replyfile && $tflag) {    if (-e $replyfile && $tflag) {
       $r->print('<script type="text/javascript">'.        &popwin_imgupdate($r,$sn,"srvhalf.gif");
  'popwin.document.img'.$sn.'.'.        &popwin_js($r,'popwin.hc["'.$rkey.'"]='.
  'src="/adm/lonIcons/srvhalf.gif";</script>'.   '"still transferring..."'.';');
  "\n");  
       $r->rflush();  
       $r->print('<script type="text/javascript">'.  
  'popwin.hc["'.$rkey.'"]='.  
  '"still transferring..."'.';</script>'.  
  "\n");  
       $r->rflush();  
       $tflag=0;        $tflag=0;
   }    }
   if (-e "$replyfile.end") {    if (-e "$replyfile.end") {
       $bloop--;        $bloop--;
       $orkey{$rkey}=1;        $orkey{$rkey}=1;
       if (-s $replyfile) {        if (-s $replyfile) {
   $r->print('<script type="text/javascript">'.    &popwin_imgupdate($r,$sn,"srvgood.gif");
     'popwin.document.img'.$sn.'.'.  
     'src="/adm/lonIcons/srvgood.gif";'.  
     '</script>'."\n");  
   $r->rflush();  
   my $fh=Apache::File->new($replyfile) or     my $fh=Apache::File->new($replyfile) or 
       ($r->print('ERROR: file '.        ($r->print('ERROR: file '.
  $replyfile.' cannot be opened') and   $replyfile.' cannot be opened') and
        return OK);         return OK);
   @results=<$fh> if $fh;    @results=<$fh> if $fh;
   $hitcount{$rkey}=@results+0;    $hitcount{$rkey}=@results+0;
   $r->print('<script type="text/javascript">'.    &popwin_js($r,'popwin.hc["'.$rkey.'"]='.
     'popwin.hc["'.$rkey.'"]='.      $hitcount{$rkey}.';');
     $hitcount{$rkey}.';</script>'.  
     "\n");  
   $r->rflush();  
   $hitcountsum+=$hitcount{$rkey};    $hitcountsum+=$hitcount{$rkey};
   $r->print('<script type="text/javascript">'.    &popwin_js($r,'popwin.document.forms.popremain.'.
     'popwin.document.forms.popremain.'.      'numhits.value='.$hitcountsum.';');
     'numhits.value='.$hitcountsum.  
     ';</script>'.  
     "\n");  
   $r->rflush();  
       }        }
       else {        else {
   $r->print('<script type="text/javascript">'.    &popwin_imgupdate($r,$sn,"srvempty.gif");
     'popwin.document.img'.$sn.'.'.    &popwin_js($r,'popwin.hc["'.$rkey.'"]=0;');
     'src="/adm/lonIcons/srvempty.gif";'.  
     '</script>'.  
     "\n");  
   $r->rflush();  
   $r->print('<script type="text/javascript">'.  
     'popwin.hc["'.$rkey.'"]=0'.  
     ';</script>'.  
     "\n");  
   $r->rflush();  
       }        }
       last WLOOP;        last WLOOP;
   }    }
Line 1138  ENDPOP Line 1042  ENDPOP
   sleep 1;    sleep 1;
   $timeremain--;    $timeremain--;
   $elapsetime++;    $elapsetime++;
   $r->print('<script type="text/javascript">'.    &popwin_js($r,"popwin.document.popremain.".
     'popwin.document.popremain.elapsetime.'.         "elapsetime.value=$elapsetime;");
     'value="'.$elapsetime.'";</script>'."\n");  
   $r->rflush();  
   $temp++;    $temp++;
       }        }
     }      }
     $r->print('<script type="text/javascript">'.      &popwin_js($r,'popwin.document.whirly.'.
       'popwin.document.whirly.'.         'src="/adm/lonIcons/lonanimend.gif";');
       'src="'.'/adm/lonIcons/lonanimend.gif'.  
       '";</script>'."\n");  
     $r->rflush();  
  }   }
  my $customshow='';   my $customshow='';
  my $extrashow='';   my $extrashow='';
Line 1193  ENDPOP Line 1092  ENDPOP
     $notes,$abstract,$mime,$lang,      $notes,$abstract,$mime,$lang,
     $creationdate,$lastrevisiondate,$owner,$copyright)=@fields;      $creationdate,$lastrevisiondate,$owner,$copyright)=@fields;
   
                   unless ($title) { $title='<i>Untitled</i>'; }
  unless ($ENV{'user.adv'}) {   unless ($ENV{'user.adv'}) {
     $keywords='<i>- not displayed -</i>';      $keywords='<i>- not displayed -</i>';
     $fields[4]=$keywords;      $fields[4]=$keywords;
Line 1228  END Line 1128  END
                 $compiledresult.=<<END;                  $compiledresult.=<<END;
 <p>  <p>
 END  END
                 $compiledresult.=<<END if $ENV{'form.catalogmode'} eq 'interactive';                 if ($ENV{'form.catalogmode'} eq 'interactive') {
      my $titleesc=$title;
      $titleesc=~s/\'/\\'/; # '
   
                      $compiledresult.=<<END if ($ENV{'form.catalogmode'} eq 'interactive');
 <font size='-1'><INPUT TYPE="button" NAME="returnvalues" VALUE="SELECT"  <font size='-1'><INPUT TYPE="button" NAME="returnvalues" VALUE="SELECT"
 onClick="javascript:select_data('$title','$url')">  onClick="javascript:select_data('$titleesc','$url')">
 </font>  </font>
 <br />  <br />
 END  END
                   }
                 if ($ENV{'form.catalogmode'} eq 'groupsearch') {                  if ($ENV{'form.catalogmode'} eq 'groupsearch') {
     $fnum+=0;      $fnum+=0;
     $hash{"pre_${fnum}_link"}=$url;      $hash{"pre_${fnum}_link"}=$url;
     $hash{"pre_${fnum}_title"}=$title;      $hash{"pre_${fnum}_title"}=$title;
     $compiledresult.=<<END;      $compiledresult.=<<END;
 <font size='-1'><input type="checkbox" name="returnvalues" value="SELECT"  <font size='-1'>
   <input type="checkbox" name="returnvalues" value="SELECT"
 onClick="javascript:queue($fnum)" />  onClick="javascript:queue($fnum)" />
 </font>  </font>
 <br />  <br />
Line 1523  sub start_fresh_session { Line 1429  sub start_fresh_session {
     }      }
 }  }
   
   # ----------------------------------------------- send javascript to popwin
   sub popwin_js {
       # Print javascript out to popwin, but make sure we dont generate
       # any javascript errors in doing so.
       my ($r,$text) = @_;
       $r->print(<<"END");
   <script type="text/javascript">
       if (! popwin.closed) {
    $text
       }
   </script>
   END
       $r->rflush();
   }
   
   sub popwin_imgupdate {
       my ($r,$imgnum,$icon) = @_;
       &popwin_js($r,'popwin.document.img'.$imgnum.'.'.
          'src="/adm/lonIcons/'.$icon.'";');
   }    
   
 1;  1;
   
 __END__  __END__

Removed from v.1.113  
changed lines
  Added in v.1.119


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