Make subscribe buttons ie proof.
This commit is contained in:
parent
3ffb43bd68
commit
efb7a004ac
1 changed files with 27 additions and 7 deletions
|
|
@ -203,12 +203,32 @@ sub appendSubscriptionFormVars {
|
|||
WebGUI::Form::formHeader( $session, { action => $self->getUrl } )
|
||||
. WebGUI::Form::hidden( $session, { name => 'func', value => 'processSubscription' } )
|
||||
;
|
||||
my $subscribeButton =
|
||||
sprintf '<button type="submit" name="action" value="subscribe">%s</button>', $i18n->get('subscribe');
|
||||
my $unsubscribeButton =
|
||||
sprintf '<button type="submit" name="action" value="unsubscribe">%s</button>', $i18n->get('unsubscribe');
|
||||
my $emailBox = WebGUI::Form::email( $session, { name => 'email', value => '' } );
|
||||
my $formFooter = WebGUI::Form::formFooter( $session );
|
||||
my $subscribeButton =
|
||||
$formHeader
|
||||
. WebGUI::Form::hidden( $session, { name => 'action', value => 'subscribe' } )
|
||||
. WebGUI::Form::submit( $session, { value => $i18n->get('subscribe') } )
|
||||
. $formFooter
|
||||
;
|
||||
my $unsubscribeButton =
|
||||
$formHeader
|
||||
. WebGUI::Form::hidden( $session, { name => 'action', value => 'unsubscribe' } )
|
||||
. WebGUI::Form::submit( $session, { value => $i18n->get('unsubscribe') } )
|
||||
. $formFooter
|
||||
;
|
||||
my $emailBox =
|
||||
$formHeader
|
||||
. WebGUI::Form::email( $session, { name => 'email', value => '' } )
|
||||
. WebGUI::Form::radioList( $session, {
|
||||
name => 'action',
|
||||
options => {
|
||||
subscribe => $i18n->get('subscribe'),
|
||||
unsubscribe => $i18n->get('unsubscribe'),
|
||||
}
|
||||
} )
|
||||
. WebGUI::Form::submit( $session )
|
||||
. $formFooter
|
||||
;
|
||||
|
||||
# Compose default subscription form for current user
|
||||
my $form = '';
|
||||
|
|
@ -217,11 +237,11 @@ sub appendSubscriptionFormVars {
|
|||
$form .= $unsubscribeButton if $self->canUnsubscribe;
|
||||
}
|
||||
elsif ( $self->get('allowAnonymousSubscription') ) {
|
||||
$form = $emailBox . $subscribeButton . $unsubscribeButton;
|
||||
$form = $emailBox;
|
||||
}
|
||||
|
||||
# Setup tmpl_vars
|
||||
$var->{ subscriptionForm_form } = "$formHeader $form $formFooter" if $form;
|
||||
$var->{ subscriptionForm_form } = $form if $form;
|
||||
$var->{ subscriptionForm_header } = $formHeader;
|
||||
$var->{ subscriptionForm_footer } = $formFooter;
|
||||
$var->{ subscriptionForm_subscribeButton } = $subscribeButton;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue