Diff for /rat/lonpageflip.pm between versions 1.65 and 1.66

version 1.65, 2006/03/06 23:35:43 version 1.66, 2006/03/06 23:41:07
Line 84  sub hash_src { Line 84  sub hash_src {
     return ($hash{'src_'.$id},$symb);      return ($hash{'src_'.$id},$symb);
 }  }
   
   # Inputs are a url, adn a hash ref of
   # form name => value pairs
   # takes care of properly adding the form name elements and values to the 
   # the url doing proper escaping of the values and joining with ? or & as 
   # needed
   
   sub add_get_param {
       my ($url,$form_data) = @_;
       my $needs_question_mark = ($url !~ /\?/);
   
       while (my ($name,$value) = each(%$form_data)) {
    if ($needs_question_mark) {
       $url.='?';
       $needs_question_mark = 0;
    } else { 
       $url.='&';
    }
    $url.=$name.'='.&Apache::lonnet::escape($form_data->{$name});
       }
       return $url;
   }
   
 sub move {  sub move {
     my ($rid,$mapurl,$direction)=@_;      my ($rid,$mapurl,$direction)=@_;
     my $startoutrid=$rid;      my $startoutrid=$rid;
Line 399  sub handler { Line 421  sub handler {
   
   &Apache::loncommon::content_type($r,'text/html');    &Apache::loncommon::content_type($r,'text/html');
   my $url='http://'.$ENV{'HTTP_HOST'}.$redirecturl;    my $url='http://'.$ENV{'HTTP_HOST'}.$redirecturl;
   if ($redirectsymb ne '') { $url.=($url=~/\?/?'&':'?').'symb='.&Apache::lonnet::escape($redirectsymb); }    $url = &add_get_param($url, { 'symb' => $redirectsymb});
                   $r->header_out(Location => $url);                    $r->header_out(Location => $url);
                   return REDIRECT;                    return REDIRECT;
       } else {        } else {
Line 433  ENDSTART Line 455  ENDSTART
                      foreach my $id (@possibilities) {                       foreach my $id (@possibilities) {
                         $r->print(                          $r->print(
                               '<tr><td><a href="'.                                '<tr><td><a href="'.
                               $multichoicehash{'src_'.$id}.($multichoicehash{'src_'.$id}=~/\?/?'&':'?').'symb=' .    &add_get_param($multichoicehash{'src_'.$id},
                                   Apache::lonnet::escape($multichoicehash{'symb_'.$id}).'">'.   {'symb' =>
         $multichoicehash{'symb_'.$id},
     }).'">'.
                               $multichoicehash{'title_'.$id}.                                $multichoicehash{'title_'.$id}.
                               '</a></td><td>'.$multichoicehash{'type_'.$id}.                                '</a></td><td>'.$multichoicehash{'type_'.$id}.
       '</td></tr>');        '</td></tr>');

Removed from v.1.65  
changed lines
  Added in v.1.66


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