¿Alguien podría ayudarme a entender este pedazo de código?
En especial yo necesito imprimir los valores de los atributos por separado... y no logro entender dónde él hace la operación para que se llene el valor.
Using perl Syntax Highlighting
## additional attribute handling ##
my @additional_attr = ();
my @additionalAttributes = getRequiredList('ADDITIONAL_REQUEST_ATTRIBUTES');
my @additionalAttributesStringType = getRequiredList('ADDITIONAL_REQUEST_ATTRIBUTES_STRING_TYPE');
my @additionalAttributesDisplayValue = getRequiredList('ADDITIONAL_ATTRIBUTES_DISPLAY_VALUE');
my $counter = 0;
foreach my $attribute (@additionalAttributes)
{
## determine the attribute
my $attVar;
if($additionalAttributesDisplayValue[$counter])
{
$attVar = gettext ($additionalAttributesDisplayValue[$counter]) ;
} else {
generalError(gettext ("The number of ADDITIONAL_REQUEST_ATTRIBUTES must equal the number of ADDITIONAL_ATTRIBUTES_DISPLAY_VALUE in the configuration."));
}
my $tempAttribute = uc $attribute;
## determine the content type
my $stringType = "LATIN1_LETTERS";
if ( $additionalAttributesStringType[$counter])
{
$stringType = $additionalAttributesStringType[$counter];
}
## build the attribute list
push @additional_attr , [
$attVar, $query->newInput ( -regx => $stringType,
-intype => 'textfield',
-size => 30,
-name => 'ADDITIONAL_ATTRIBUTE_'.$tempAttribute,
-optional => 1,
-check => 'fill',
-default => $query->param ('ADDITIONAL_ATTRIBUTE_'.$tempAttribute)
)
];
$counter ++;
}
my @additional_attr = ();
my @additionalAttributes = getRequiredList('ADDITIONAL_REQUEST_ATTRIBUTES');
my @additionalAttributesStringType = getRequiredList('ADDITIONAL_REQUEST_ATTRIBUTES_STRING_TYPE');
my @additionalAttributesDisplayValue = getRequiredList('ADDITIONAL_ATTRIBUTES_DISPLAY_VALUE');
my $counter = 0;
foreach my $attribute (@additionalAttributes)
{
## determine the attribute
my $attVar;
if($additionalAttributesDisplayValue[$counter])
{
$attVar = gettext ($additionalAttributesDisplayValue[$counter]) ;
} else {
generalError(gettext ("The number of ADDITIONAL_REQUEST_ATTRIBUTES must equal the number of ADDITIONAL_ATTRIBUTES_DISPLAY_VALUE in the configuration."));
}
my $tempAttribute = uc $attribute;
## determine the content type
my $stringType = "LATIN1_LETTERS";
if ( $additionalAttributesStringType[$counter])
{
$stringType = $additionalAttributesStringType[$counter];
}
## build the attribute list
push @additional_attr , [
$attVar, $query->newInput ( -regx => $stringType,
-intype => 'textfield',
-size => 30,
-name => 'ADDITIONAL_ATTRIBUTE_'.$tempAttribute,
-optional => 1,
-check => 'fill',
-default => $query->param ('ADDITIONAL_ATTRIBUTE_'.$tempAttribute)
)
];
$counter ++;
}
Coloreado en 0.004 segundos, usando GeSHi 1.0.8.4
Será en la parte que dice ## build the attribute list... nosotros hemos probado colocando la opción -values => $query->param ('parametro') pero no sale nada en la impresión...
Ese mismo método lo utilicé para las otras variables y sí me funciona...
Bueno, espero sus comentarios.