/[BackupPC]/trunk/lib/BackupPC/SearchLib.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/BackupPC/SearchLib.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 225 by dpavlin, Mon Oct 24 14:02:00 2005 UTC revision 230 by dpavlin, Tue Oct 25 09:30:52 2005 UTC
# Line 480  sub displayBackupsGrid($) { Line 480  sub displayBackupsGrid($) {
480    
481          my $param = shift;          my $param = shift;
482    
483            my $max_archive_size = $Conf{MaxArchiveSize} || die "no MaxArchiveSize";
484            my $max_archive_file_size = $Conf{MaxArchiveFileSize}  || die "no MaxFileInSize";
485    
486          my $retHTML .= q{          my $retHTML .= q{
487                  <form id="forma" method="POST" action="}.$MyURL.q{?action=burn">                  <form id="forma" method="POST" action="}.$MyURL.q{?action=burn">
488          };          };
# Line 603  var debug_div = null; Line 606  var debug_div = null;
606  EOF3  EOF3
607    
608          # take maximum archive size from configuration          # take maximum archive size from configuration
609          $retHTML .= 'var media_size = '. $Conf{MaxArchiveSize} .';';          $retHTML .= qq{
610    var media_size = $max_archive_size ;
611    var max_file_size = $max_archive_file_size;
612    
613    };
614    
615          $retHTML .= <<'EOF3';          $retHTML .= <<'EOF3';
616    
# Line 683  function sumiraj(e) { Line 690  function sumiraj(e) {
690                  }                  }
691    
692                  var parts = parseInt( element_id("prt" + e.name.substr(3)).value);                  var parts = parseInt( element_id("prt" + e.name.substr(3)).value);
693                  if (suma > media_size && suma == size && parts > 1) {                  if (suma > max_file_size && suma == size && parts > 1) {
694                          element_id("parts").innerHTML = "This will take "+parts+" mediums!";                          element_id("parts").innerHTML = "This will take "+parts+" mediums!";
695                          element_id("parts").style.display = 'block';                          element_id("parts").style.display = 'block';
696                          update_sum(media_size, suma);                          update_sum(media_size, suma);
# Line 918  sub displayGrid($) { Line 925  sub displayGrid($) {
925          sub sort_header($$$$) {          sub sort_header($$$$) {
926                  my ($param, $display, $name, $align) = @_;                  my ($param, $display, $name, $align) = @_;
927    
928                  my ($sort_what, $sort_dir) = split(/_/,$param->{'sort'},2);                  my ($sort_what, $sort_direction) = split(/_/,$param->{'sort'},2);
929    
930                  my $old_sort = $param->{'sort'};                  my $old_sort = $param->{'sort'};
931    
932                  my $html = qq{<td align="$align"};                  my $html = qq{<td align="$align"};
933                    my $arrow = '';
934    
935                  if (lc($sort_what) eq lc($name)) {                  if (lc($sort_what) eq lc($name)) {
936                          my $dir = lc($sort_dir);                          my $direction = lc($sort_direction);
937                          $dir =~ tr/ad/da/;  
938                          $param->{'sort'} = $name . '_' . $dir;                          # swap direction or fallback to default
939                            $direction =~ tr/ad/da/;
940                            $direction = 'a' unless ($direction =~ /[ad]/);
941    
942                            $param->{'sort'} = $name . '_' . $direction;
943                          $html .= ' style="border: 1px solid #808080;"';                          $html .= ' style="border: 1px solid #808080;"';
944                    
945                            # add unicode arrow for direction
946                            $arrow .= '&nbsp;';
947                            $arrow .= $direction eq 'a'  ?  '&#9650;'
948                                    : $direction eq 'd'  ?  '&#9660;'
949                                    :                       ''
950                                    ;
951    
952                  } else {                  } else {
953                          $param->{'sort'} = $name . '_a';                          $param->{'sort'} = $name . '_a';
954                  }                  }
955                  $html .= '<a href="' . page_uri($param) . '">' . $display . '</a></td>';  
956                    $html .= '><a href="' . page_uri($param) . '">' . $display . '</a>' . $arrow . '</td>';
957                  $param->{'sort'} = $old_sort;                  $param->{'sort'} = $old_sort;
958    
959                  return $html;                  return $html;

Legend:
Removed from v.225  
changed lines
  Added in v.230

  ViewVC Help
Powered by ViewVC 1.1.26