
| Current Path : /var/www/web-klick.de/dsh/90_akt/DivBasicF/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/web-klick.de/dsh/90_akt/DivBasicF/COMText.pm |
package DivBasicF::COMText;
use strict;
use vars qw(@ISA);
use DivBasicF::COM;
@ISA = qw(DivBasicF::COM);
#**************************************************************
sub choose {
my $self = shift;
my $mode = shift;
my $text = shift;
my @pars = @_;
$text = $self->c1($text);
my $o;
foreach $o (@pars) { $o = $self->c1($o); }
$text = $self->{'OBJ'}->query(["choose".$mode,$text,@pars]);
foreach $o (@$text) { $o = $self->c2($o); }
return($text);
}
#**************************************************************
sub form {
my $self = shift;
my $mode = shift;
my $text = shift;
my @pars = @_;
$text = $self->c1($text);
my $o;
foreach $o (@pars) { $o = $self->c1($o); }
$text = $self->query($self->{'OBJ'},["form".$mode,$text,@pars]);
foreach $o (@$text) { $o = $self->c2($o); }
my $pp = {};
my $zaehler = 1;
foreach $o (@$text) {
if ($o =~ /^p(\d+)\=(.*)/) {
$pp->{$1} = $2;
}
}
my $zaehler = 1;
$text = [];
while (0 == 0) {
last if (!%$pp);
}
return($text);
}
#**************************************************************
sub export1 {
my $self = shift;
my $mode = shift;
my $o = join("X---SEPAR---X",@_);
my $text = "";
while ($o =~ s/X---SEPAR---XX---SEPAR---X/X---SEPAR---X/g) { 1; }
if (!$o or $o =~ /[^\-\=]\n([^ \-\=])/s) {
$o =~ s/X---SEPAR---X/\n\n\n/gs;
$text = $text . $o . "\n\n";
} else {
$o =~ s/X---SEPAR---X/\n/gs;
$text = $text . $o . "\n";
}
return([$self->c1($text)]);
}
#**************************************************************
sub textlist {
my $self = shift;
my $mode = shift;
my $text = shift;
$text = $self->{'OBJ'}->query(["edit".$mode,$text])->[0];
return([$text]);
}
#**************************************************************
sub import1 {
my $self = shift;
my $mode = shift;
my $text1 = shift;
$text1 = $self->c2($text1);
if ($text1 =~ /([A-Z][a-z], \d\d\.\d\d\.\d\d)/) { # Kalender-Format
while ($text1 =~ s/\n *\n/\n/gs) { 1; }
$text1 =~ s/^([\n ]*)(.*?)([\n ]*)/$2/gs;
}
if ($text1 =~ /\n *\n/ or $text1 =~ /\=\>/) {
$text1 =~ s/\n[\n ]*\n/\n\n/gs;
$text1 =~ s/^\n*(.*?)\n*$/$1/s;
$text1 = [split(/\s*\n\s*\n\s*/,$text1)];
} else {
$text1 = "\n" . $text1;
$text1 =~ s/[\n ]*\n/\n/gs;
$text1 =~ s/\n(\S)/X---SEPAR---X$1/gs;
$text1 =~ s/([\-\=]+)X---SEPAR---X/$1\n/gs;
$text1 =~ s/^\n*(.*?)\n*$/$1/s;
$text1 = [split(/X---SEPAR---X/,$text1)];
}
while (!($text1->[0]) and @$text1) { shift(@$text1); }
return($text1);
}
#**************************************************************
1;