# HG changeset patch # User devi # Date 1150310242 -10800 # Node ID 2c00c61f2d7bec98f2b0342a152449ff145d345b # Parent 05e99d32f1f5dc01382879cf24e913f040feaee6 Коммичу изменения, но сам не знаю зачем. Нужно l3-cgi переписать вообще с нуля. Он мерзкий. И продумать нужно, как он вообще должен работать. Понятно, приблизительно, как он должен показывать журнал, когда до него уже дошли, но вот если не дошли, то что делать не понятно. Короче, продумать систему навигации. diff -r 05e99d32f1f5 -r 2c00c61f2d7b l3-cgi --- a/l3-cgi Mon Jun 12 09:32:18 2006 +0300 +++ b/l3-cgi Wed Jun 14 21:37:22 2006 +0300 @@ -40,8 +40,7 @@ { my $training_file; - $training_file = $l3config::Config{"path_classes"}.$_[0].$l3config::Config{"class_suffix"} if $_[0]; - $training_file ||= $l3config::Config{"classfile"} || + $training_file = $_[0] || $l3config::Config{"classfile"} || $l3config::Config{"path_classes"}.$l3config::Config{"class"}.$l3config::Config{"class_suffix"}; my $XMLTraining = XMLin($training_file , ForceArray => [ 'student' ] ) @@ -123,8 +122,14 @@ if (!$host || $host eq "index") { # Нам неизвестен курс или явно указан просмотр индекса # Просматриваем его - - my $t = load_training($training); + my $t; + if ( -e "/var/lilalo/lablogs-xml/$training/class.xml" ) { + $t = load_training("/var/lilalo/lablogs-xml/$training/class.xml"); + } + else { + $l3config::Config{class}=$training; + $t = load_training; + } $training ||= "current"; my $prefix = "/cgi-bin/l3/$training/"; @@ -202,22 +207,33 @@ } else { - $l3config::Config{"class"}=$training if $training ne 'current'; - $XMLTraining = load_training; my @args=( "--output" => "-", "--show_comments" => "no", - "--course-center" => $XMLTraining->{center}, - "--course-trainer" => $XMLTraining->{instructor}->{firstname}." ".$XMLTraining->{instructor}->{surname}, - "--course-student" => $XMLTraining->{host}->{$host}->{firstname}." ".$XMLTraining->{host}->{$host}->{surname}, - "--course-code" => $XMLTraining->{course}, - "--course-date" => $XMLTraining->{date}, - "--encoding" => $XMLTraining->{host}->{$host}->{charset}, ); - if ($XMLTraining->{"course-name"}) { - push @args, ("--course-name" => $XMLTraining->{"course-name"}); - }; + + $l3config::Config{"class"}=$training if $training ne 'current'; + if ( -e "/var/lilalo/lablogs-xml/$training/class.xml" ) { + $XMLTraining = load_training("/var/lilalo/lablogs-xml/$training/class.xml"); + } + else { + $XMLTraining = load_training; + } + + if ($XMLTraining) { + my @args=( + "--course-center" => $XMLTraining->{center}, + "--course-trainer" => $XMLTraining->{instructor}->{firstname}." ".$XMLTraining->{instructor}->{surname}, + "--course-student" => $XMLTraining->{host}->{$host}->{firstname}." ".$XMLTraining->{host}->{$host}->{surname}, + "--course-code" => $XMLTraining->{course}, + "--course-date" => $XMLTraining->{date}, + "--encoding" => $XMLTraining->{host}->{$host}->{charset}, + ); + if ($XMLTraining->{"course-name"}) { + push @args, ("--course-name" => $XMLTraining->{"course-name"}); + }; + } if ($training ne 'current') { push @args, ("--backend_datafile" => "/var/lilalo/lablogs-xml/$training/$host/$user.xml"); } else {