- foreach my $i ( $view->backupList($share, $dir) ) {
- push(@otherDirs, $i);
- }
- if ( @otherDirs ) {
- my $otherDirs = join(",\n", @otherDirs);
- my $inc = 0;
- foreach my $value (@otherDirs) {
- my $selected = undef;
- my $showDate = timeStamp2($Backups[$inc]{startTime});
- $selected = " selected" if ($value == $num);
- $otherDirs .= "<option value=\"$MyURL?action=browse&host=${EscURI($host)}&num=$value\"$selected>#$value - ($showDate)</option>\n";
- $inc++;
+ if ( my @otherDirs = $view->backupList($share, $dir) ) {
+ my $otherDirs;
+ foreach my $i ( @otherDirs ) {
+ my $selected;
+ my $showDate = timeStamp2($Backups[$i]{startTime});
+ my $backupNum = $Backups[$i]{num};
+ $selected = " selected" if ( $backupNum == $num );
+ $otherDirs .= "<option value=\"$MyURL?action=browse&host=${EscURI($host)}&num=$backupNum&share=$shareURI&dir=$pathURI\"$selected>#$backupNum - ($showDate)</option>\n";