/[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 227 by dpavlin, Mon Oct 24 15:04:45 2005 UTC revision 229 by dpavlin, Tue Oct 25 09:30:51 2005 UTC
# Line 918  sub displayGrid($) { Line 918  sub displayGrid($) {
918          sub sort_header($$$$) {          sub sort_header($$$$) {
919                  my ($param, $display, $name, $align) = @_;                  my ($param, $display, $name, $align) = @_;
920    
921                  my ($sort_what, $sort_dir) = split(/_/,$param->{'sort'},2);                  my ($sort_what, $sort_direction) = split(/_/,$param->{'sort'},2);
922    
923                  my $old_sort = $param->{'sort'};                  my $old_sort = $param->{'sort'};
924    
925                  my $html = qq{<td align="$align"};                  my $html = qq{<td align="$align"};
926                    my $arrow = '';
927    
928                  if (lc($sort_what) eq lc($name)) {                  if (lc($sort_what) eq lc($name)) {
929                          my $dir = lc($sort_dir);                          my $direction = lc($sort_direction);
930                          $dir =~ tr/ad/da/;  
931                          $param->{'sort'} = $name . '_' . $dir;                          # swap direction or fallback to default
932                            $direction =~ tr/ad/da/;
933                            $direction = 'a' unless ($direction =~ /[ad]/);
934    
935                            $param->{'sort'} = $name . '_' . $direction;
936                          $html .= ' style="border: 1px solid #808080;"';                          $html .= ' style="border: 1px solid #808080;"';
937                    
938                            # add unicode arrow for direction
939                            $arrow .= '&nbsp;';
940                            $arrow .= $direction eq 'a'  ?  '&#9650;'
941                                    : $direction eq 'd'  ?  '&#9660;'
942                                    :                       ''
943                                    ;
944    
945                  } else {                  } else {
946                          $param->{'sort'} = $name . '_a';                          $param->{'sort'} = $name . '_a';
947                  }                  }
948                  $html .= '><a href="' . page_uri($param) . '">' . $display . '</a></td>';  
949                    $html .= '><a href="' . page_uri($param) . '">' . $display . '</a>' . $arrow . '</td>';
950                  $param->{'sort'} = $old_sort;                  $param->{'sort'} = $old_sort;
951    
952                  return $html;                  return $html;

Legend:
Removed from v.227  
changed lines
  Added in v.229

  ViewVC Help
Powered by ViewVC 1.1.26