package II3562149e53818b6637b38680e87ba918::checkbox; use strict; use Zen::PerlHandler; sub get { my ($form, $f) = @_; my ($add_msg, $addon, $bs) = split ',', Zen::PerlHandler->getStatList; $addon .= qq( class="custom-control-input") if $bs; $add_msg = '' if $bs; my $name = $form->pfx . $f; my $checked = $form->getDecorated->{$f} ? 'checked' : ''; my $code = qq(<input id="chbox_$name" type="checkbox" name="$name" value="1" $checked $addon/><input type="hidden" name="$name" value=""/>); $code .= "<label for='chbox_$name' class='custom-control-label'>" . $form->message($add_msg) . "</label>" if $add_msg; $code; } sub set { my ($form, $f, $v) = @_; $form->getDecorated->{$f} = $v ? 1 : 0; } 1; 