package II3562149e53818b6637b38680e87ba918::dynamicStatesList; use strict; use Zen::Config; sub get { my ($form, $f) = @_; my ($countriesSelId, $statesSelId, $addon) = split ',', Zen::PerlHandler->getStatList, 3; my $object = $form->getDecorated; my $cfg = Zen::Config->get('lists::states'); my $pfx = $form->pfx; $addon .= qq( class="custom-select"); my $sys_uri = II982446f8950cc3dc59e487adba22df54::IIllllIlIIllIIII($II720d6e18aa34327713eb014408fc9144::IllIllllIIIlIIlI{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IllIIlIlIlIlIIIl},47,$II720d6e18aa34327713eb014408fc9144::IllIllllIIIlIIlI{$II982446f8950cc3dc59e487adba22df54::llIlIIIIllllIIII})->getURI; my $code; $code .= qq(<script src="$sys_uri/suppl/dynamic_addr.js"></script>) unless Zen->getRequest->getRequestCache->{DynamicStatesJSPrinted}; Zen->getRequest->getRequestCache->{DynamicStatesJSPrinted} = 1; $code .= <<END_CODE;
<script>
dynamicAddrAddOnLoad(function() { dynamicAddrSetup("$countriesSelId", "$statesSelId"); });
</script>
END_CODE
my %sel; $sel{$object->{$f}} = 'selected'; $code .= qq(<select name="$pfx$f" id="$statesSelId" $addon>\n); $code .= qq(<option class="" value="">State / Province\n); my $hint = $form->message('dynamic_states.hint'); $code .= qq(<option class="HINT" value=""> $hint\n); for my $st (keys %{$cfg->{main}}) { my $cn = substr $st, 0, 2; $code .= qq(<option class="$cn" value="$st" $sel{$st}> $cfg->{main}{$st}\n); } $code .= qq(</select>\n); } sub set { my ($form, $f, $v) = @_; my ($type, $list, $par, $addon) = split ',', Zen::PerlHandler->getStatList, 4; my $object = $form->getDecorated; $object->{$f} = $v; return; } 1; 