Revision f51fdc2b
Von Moritz Bunkus vor etwa 14 Jahren hinzugefügt
SL/Template/OpenDocument.pm | ||
---|---|---|
109 | 109 |
$contents =~ m|^(.*?)(</table:table-row[^>]*>)|; |
110 | 110 |
my $table_row = $1; |
111 | 111 |
my $end_tag = $2; |
112 |
substr($contents, 0, length($1) + length($end_tag)) = ""; |
|
113 | 112 |
|
114 | 113 |
if ($table_row =~ m|\<\%foreachrow\s+(.*?)\%\>|) { |
115 | 114 |
my $var = $1; |
116 | 115 |
|
117 |
substr($table_row, length($`), length($&)) = ""; |
|
116 |
$contents =~ m|\<\%foreachrow\s+.*?\%\>|; |
|
117 |
substr($contents, length($`), length($&)) = ""; |
|
118 | 118 |
|
119 |
my ($t1, $t2) = $self->find_end($table_row, length($`));
|
|
120 |
if (!$t1) {
|
|
119 |
($table_row, $contents) = $self->find_end($contents, length($`));
|
|
120 |
if (!$table_row) {
|
|
121 | 121 |
$self->{"error"} = "Unclosed <\%foreachrow\%>." unless ($self->{"error"}); |
122 | 122 |
$main::lxdebug->leave_sub(); |
123 | 123 |
return undef; |
124 | 124 |
} |
125 | 125 |
|
126 |
my $new_text = $self->parse_foreach($var, $t1 . $t2, $tag, $end_tag, @indices); |
|
126 |
$contents =~ m|^(.*?)(</table:table-row[^>]*>)|; |
|
127 |
$table_row .= $1; |
|
128 |
$end_tag = $2; |
|
129 |
|
|
130 |
substr $contents, 0, length($&), ''; |
|
131 |
|
|
132 |
my $new_text = $self->parse_foreach($var, $table_row, $tag, $end_tag, @indices); |
|
127 | 133 |
if (!defined($new_text)) { |
128 | 134 |
$main::lxdebug->leave_sub(); |
129 | 135 |
return undef; |
... | ... | |
131 | 137 |
$new_contents .= $new_text; |
132 | 138 |
|
133 | 139 |
} else { |
140 |
substr($contents, 0, length($table_row) + length($end_tag)) = ""; |
|
134 | 141 |
my $new_text = $self->parse_block($table_row, @indices); |
135 | 142 |
if (!defined($new_text)) { |
136 | 143 |
$main::lxdebug->leave_sub(); |
Auch abrufbar als: Unified diff
Ermöglichen, dass <%foreachrow%> in OpenDocument über mehrere Zeilen geht
Hintergrund: Um Zwischenzummen zu ermöglichen, müss ein Konstrukt wie
folgt genutzt werden: