|
Lines 379-391
sub parametrize {
Link Here
|
| 379 |
; |
379 |
; |
| 380 |
} elsif (defined $params[$i - 1]) { |
380 |
} elsif (defined $params[$i - 1]) { |
| 381 |
my $param = $params[$i - 1]; |
381 |
my $param = $params[$i - 1]; |
| 382 |
warn_normal("$fmt_0: $&: Expected a TMPL_VAR, but found a " |
382 |
warn_normal("$fmt_0: $&: Expected a TMPL_VAR, but found a " |
| 383 |
. $param->type->to_string . "\n", undef) |
383 |
. $param->type->to_string . "\n", undef) |
| 384 |
if $param->type != C4::TmplTokenType::DIRECTIVE; |
384 |
if $param->type != C4::TmplTokenType::DIRECTIVE; |
| 385 |
warn_normal("$fmt_0: $&: Unsupported " |
385 |
warn_normal("$fmt_0: $&: Unsupported " |
| 386 |
. "field width or precision\n", undef) |
386 |
. "field width or precision\n", undef) |
| 387 |
if defined $width || defined $prec; |
387 |
if defined $width || defined $prec; |
| 388 |
warn_normal("$fmt_0: $&: Parameter $i not known", undef) |
388 |
warn_normal("$fmt_0: $&: Parameter $i not known", undef) |
| 389 |
unless defined $param; |
389 |
unless defined $param; |
| 390 |
$it .= defined $f? &$f( $param ): $param->string; |
390 |
$it .= defined $f? &$f( $param ): $param->string; |
| 391 |
} |
391 |
} |
|
Lines 396-422
sub parametrize {
Link Here
|
| 396 |
|
396 |
|
| 397 |
my $param = $params[$i - 1]; |
397 |
my $param = $params[$i - 1]; |
| 398 |
if (!defined $param) { |
398 |
if (!defined $param) { |
| 399 |
warn_normal("$fmt_0: $&: Parameter $i not known", undef); |
399 |
warn_normal("$fmt_0: $&: Parameter $i not known", undef); |
| 400 |
} else { |
400 |
} else { |
| 401 |
if ($param->type == C4::TmplTokenType::TAG |
401 |
if ($param->type == C4::TmplTokenType::TAG |
| 402 |
&& $param->string =~ /^<input\b/is) { |
402 |
&& $param->string =~ /^<input\b/is) { |
| 403 |
my $type = defined $param->attributes? |
403 |
my $type = defined $param->attributes? |
| 404 |
lc($param->attributes->{'type'}->[1]): undef; |
404 |
lc($param->attributes->{'type'}->[1]): undef; |
| 405 |
if ($conv eq 'S') { |
405 |
if ($conv eq 'S') { |
| 406 |
warn_normal("$fmt_0: $&: Expected type=text, " |
406 |
warn_normal("$fmt_0: $&: Expected type=text, " |
| 407 |
. "but found type=$type", undef) |
407 |
. "but found type=$type", undef) |
| 408 |
unless $type eq 'text'; |
408 |
unless $type eq 'text'; |
| 409 |
} elsif ($conv eq 'p') { |
409 |
} elsif ($conv eq 'p') { |
| 410 |
warn_normal("$fmt_0: $&: Expected type=radio, " |
410 |
warn_normal("$fmt_0: $&: Expected type=radio, " |
| 411 |
. "but found type=$type", undef) |
411 |
. "but found type=$type", undef) |
| 412 |
unless $type eq 'radio'; |
412 |
unless $type eq 'radio'; |
| 413 |
} |
413 |
} |
| 414 |
} else { |
414 |
} else { |
| 415 |
warn_normal("$&: Expected an INPUT, but found a " |
415 |
warn_normal("$&: Expected an INPUT, but found a " |
| 416 |
. $param->type->to_string . "\n", undef) |
416 |
. $param->type->to_string . "\n", undef) |
| 417 |
} |
417 |
} |
| 418 |
warn_normal("$fmt_0: $&: Unsupported " |
418 |
warn_normal("$fmt_0: $&: Unsupported " |
| 419 |
. "field width or precision\n", undef) |
419 |
. "field width or precision\n", undef) |
| 420 |
if defined $width || defined $prec; |
420 |
if defined $width || defined $prec; |
| 421 |
$it .= defined $f? &$f( $param ): $param->string; |
421 |
$it .= defined $f? &$f( $param ): $param->string; |
| 422 |
} |
422 |
} |
|
Lines 439-445
sub parametrize {
Link Here
|
| 439 |
my $i = $1; |
439 |
my $i = $1; |
| 440 |
$fmt = $'; |
440 |
$fmt = $'; |
| 441 |
my $anchor = $anchors[$i - 1]; |
441 |
my $anchor = $anchors[$i - 1]; |
| 442 |
warn_normal("$&: Anchor $1 not found for msgid \"$fmt_0\"", undef) #FIXME |
442 |
warn_normal("$&: Anchor $1 not found for msgid \"$fmt_0\"", undef) #FIXME |
| 443 |
unless defined $anchor; |
443 |
unless defined $anchor; |
| 444 |
$it .= $anchor->string; |
444 |
$it .= $anchor->string; |
| 445 |
} else { |
445 |
} else { |