lilalo

diff l3-frontend @ 84:2cb912bff2ea

* В журнале выводится имя курса, а не только его код
* Исправлена ошибка с фильтром при чтении журнала из XML-репозитория
Теперь всё ок
author devi
date Sat Feb 25 08:02:25 2006 +0200 (2006-02-25)
parents bdc1f02d3f87
children c70be67ed3d4
line diff
     1.1 --- a/l3-frontend	Fri Feb 24 18:43:35 2006 +0200
     1.2 +++ b/l3-frontend	Sat Feb 25 08:02:25 2006 +0200
     1.3 @@ -11,6 +11,7 @@
     1.4  our %Args_Description;
     1.5  our $Mywi_Socket;
     1.6  our %Sessions;
     1.7 +our %filter;
     1.8  
     1.9  our %Files;
    1.10  
    1.11 @@ -255,12 +256,13 @@
    1.12      my $data = <CLASS>;
    1.13      close(CLASS);
    1.14  
    1.15 -    for my $session ($data =~ m@<session>(.*?)</session>@sg) {
    1.16 -        my %session;
    1.17 +    my $i=0;
    1.18 +    for my $session ($data =~ m@<session>(.*?)</session>@msg) {
    1.19 +        my %session_hash;
    1.20          while ($session =~ m@<([^>]*?)>(.*?)</\1>@sg) {
    1.21 -            $session{$1} = $2;
    1.22 +            $session_hash{$1} = $2;
    1.23          }
    1.24 -        $Sessions{$session{local_session_id}} = \%session;
    1.25 +        $Sessions{$session_hash{local_session_id}} = \%session_hash;
    1.26      }
    1.27  }
    1.28  
    1.29 @@ -409,7 +411,6 @@
    1.30  
    1.31      my @known_commands;
    1.32  
    1.33 -    my %filter;
    1.34  
    1.35      if ($Config{filter}) {
    1.36          # Инициализация фильтра
    1.37 @@ -455,9 +456,9 @@
    1.38              #$result .= "undefined local session id<br/>\n" if !defined($cl->{local_session_id});
    1.39              #$result .= "undefined filter key $filter_key <br/>\n" if !defined($Sessions{$cl->{local_session_id}}->{$filter_key});
    1.40              #$result .= $Sessions{$cl->{local_session_id}}->{$filter_key}." != ".$filter{$filter_key};
    1.41 -            next COMMAND_LINE if 
    1.42 -                defined($cl->{local_session_id}) 
    1.43 -                && defined($Sessions{$cl->{local_session_id}}->{$filter_key}) 
    1.44 +            next COMMAND_LINE 
    1.45 +                if defined($cl->{local_session_id})
    1.46 +                && defined($Sessions{$cl->{local_session_id}}->{$filter_key})
    1.47                  && $Sessions{$cl->{local_session_id}}->{$filter_key} ne $filter{$filter_key};
    1.48          }
    1.49  
    1.50 @@ -688,7 +689,7 @@
    1.51          my $hint = make_comment($cl->{"cline"});
    1.52  
    1.53          my $cline;
    1.54 -        $prompt_hint = join ("&#10;", map("$_=$cl->{$_}", grep (!/^output$/, sort(keys(%{$cl})))));
    1.55 +        $prompt_hint = join ("&#10;", map("$_=$cl->{$_}", grep (!/^(output|diff)$/, sort(keys(%{$cl})))));
    1.56          $cline = "<span title='$prompt_hint'>".$cl->{"prompt"}."</span>".$cl->{"cline"};
    1.57          $cline =~ s/\n//;
    1.58  
    1.59 @@ -836,6 +837,14 @@
    1.60      my $files_section         = print_files;
    1.61  
    1.62      $result = print_header($toc);
    1.63 +
    1.64 +
    1.65 +#    $result.= join " <br/>", keys %Sessions;
    1.66 +#    for my $sess (keys %Sessions) {
    1.67 +#            $result .= join " ", keys (%{$Sessions{$sess}});
    1.68 +#            $result .= "<br/>";
    1.69 +#    }
    1.70 +
    1.71      $result.= "<h2 id='log'>Журнал</h2>"       . $command_lines;
    1.72      $result.= "<h2 id='files'>Файлы</h2>"      . $files_section if $files_section;
    1.73      $result.= "<h2 id='stat'>Статистика</h2>"  . print_stat;
    1.74 @@ -944,6 +953,7 @@
    1.75              $result .= "($course_code)"                 if $course_code;
    1.76              $result .= ", $course_date<br/>"            if $course_date;
    1.77              $result .= "Учебный центр $course_center <br/>" if $course_center;
    1.78 +            $result .= "Фильтр ".join(" ", map("$filter{$_}=$_", keys %filter))."<br/>" if %filter;
    1.79              $result .= "</p>";
    1.80      }
    1.81