lilalo
diff l3-frontend @ 145:2c9ea8e4fa14
mass upload
author | igor@book.xt.vpn |
---|---|
date | Tue Dec 16 00:12:54 2008 +0200 (2008-12-16) |
parents | c48bd05dca85 |
children | f4008c71ab92 |
line diff
1.1 --- a/l3-frontend Mon Jul 21 16:44:11 2008 +0300 1.2 +++ b/l3-frontend Tue Dec 16 00:12:54 2008 +0200 1.3 @@ -10,6 +10,7 @@ 1.4 our %Commands_Description; 1.5 our %Args_Description; 1.6 our %Sessions; 1.7 +our %Uploads; 1.8 1.9 our $debug_output=""; # Используйте эту переменную, если нужно передать отладочную информацию 1.10 1.11 @@ -42,6 +43,7 @@ 1.12 sub make_new_entries_table; 1.13 sub load_command_lines_from_xml; 1.14 sub load_sessions_from_xml; 1.15 +sub load_uploads; 1.16 sub sort_command_lines; 1.17 sub process_command_lines; 1.18 sub init_variables; 1.19 @@ -61,6 +63,7 @@ 1.20 sub print_footer_html; 1.21 sub tigra_hints_generate; 1.22 1.23 + 1.24 #### mywi 1.25 # 1.26 sub mywi_init; 1.27 @@ -88,6 +91,7 @@ 1.28 mywi_init(); 1.29 1.30 load_command_lines_from_xml($Config{"backend_datafile"}); 1.31 + load_uploads($Config{"upload_dir"}); 1.32 load_sessions_from_xml($Config{"backend_datafile"}); 1.33 sort_command_lines; 1.34 process_command_lines; 1.35 @@ -345,6 +349,21 @@ 1.36 } 1.37 } 1.38 1.39 +sub load_uploads($) 1.40 +{ 1.41 + $dir=$_[0]; 1.42 + for $i (glob("$dir/*.png")) { 1.43 + $i =~ s@.*/(([0-9-]+)_([0-9]+).*)@$1@; 1.44 + $Uploads{$2}{$3}=$i; 1.45 + } 1.46 +} 1.47 + 1.48 +#for $key (sort keys %session) { 1.49 +# for $t (sort { $a <=> $b } keys %{ $session{$key} }) { 1.50 +# print $session{$key}{$t}."\n"; 1.51 +# } 1.52 +#} 1.53 +#} 1.54 1.55 # sort_command_lines 1.56 # In: @Command_Lines 1.57 @@ -614,6 +633,7 @@ 1.58 1.59 my $cl=$Command_Lines[$Command_Lines_Index[$current_command++]]; 1.60 next unless $cl; 1.61 + my $next_cl=$Command_Lines[$Command_Lines_Index[$current_command+1]]; 1.62 1.63 next if $current_command < $Config{"start_from_command"}; 1.64 last if $current_command > $Config{"start_from_command"} + $Config{"commands_to_show_at_a_go"}; 1.65 @@ -813,6 +833,15 @@ 1.66 $this_day_result .= "<pre class='diff'>".$cl->{"diff"}."</pre>" 1.67 if ( $Config{"show_diffs"} =~ /^y/i && $cl->{"diff"}); 1.68 # SHOT 1.69 + #for $t (sort { $a <=> $b } keys %{ $Uploads{$cl->{"local_session_id"}} }) { 1.70 + # if ($t > $cl->{"time"} && $t < $next_cl->{"time"}) { 1.71 + $this_day_result .= "<img src='" 1.72 + .$Config{l3shot_path} 1.73 + .$Uploads{$cl->{"local_session_id"}} 1.74 + ."' alt ='screenshot id ".$cl->{"screenshot"} 1.75 + ."'/>" 1.76 + #} 1.77 + 1.78 $this_day_result .= "<img src='" 1.79 .$Config{l3shot_path} 1.80 .$cl->{"screenshot"}