Skip to content

Commit

Permalink
add form names
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasKrais committed Mar 24, 2023
1 parent 2ea4f4d commit 298ac5e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion install.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
6);
$d2u_multinewsletter_modules[] = new D2UModule('80-4',
'MultiNewsletter YForm Anmeldung',
5);
6);
$d2u_multinewsletter_modules[] = new D2UModule('80-5',
'MultiNewsletter YForm Abmeldung',
3);
Expand Down
2 changes: 1 addition & 1 deletion lib/module_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static function getD2UMultiNewsletterModules()
6);
$d2u_multinewsletter_modules[] = new D2UModule('80-4',
'MultiNewsletter YForm Anmeldung',
5);
6);
$d2u_multinewsletter_modules[] = new D2UModule('80-5',
'MultiNewsletter YForm Abmeldung',
3);
Expand Down
1 change: 1 addition & 0 deletions modules/80/4/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ function sendActivationMail($yform)
$yform->setObjectparams('form_action', rex_getUrl(rex_article::getCurrentId(), rex_clang::getCurrentId()));
$yform->setObjectparams('Error-occured', $addon->getConfig('lang_'. rex_clang::getCurrentId() .'_no_userdata', ''));
$yform->setObjectparams('real_field_names', true);
$yform->setObjectparams('form_name', 'multinewsletter_module_80_4_'. random_int(1, 100));

// action - showtext
$yform->setActionField('showtext', [$addon->getConfig('lang_'. rex_clang::getCurrentId() .'_confirmation_sent', '')]);
Expand Down
3 changes: 2 additions & 1 deletion modules/80/5/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function unsubscribe($email)
$cols_md = 0 === (int) 'REX_VALUE[19]' ? 12 : (int) 'REX_VALUE[19]'; /** @phpstan-ignore-line */
$cols_lg = 0 === (int) 'REX_VALUE[18]' ? 12 : (int) 'REX_VALUE[18]'; /** @phpstan-ignore-line */
$offset_lg = (int) 'REX_VALUE[17]' > 0 ? ' mr-lg-auto ml-lg-auto ' : ''; /** @phpstan-ignore-line */

echo '<div class="col-12 col-sm-'. $cols_sm .' col-md-'. $cols_md .' col-lg-'. $cols_lg . $offset_lg .' yform">';
echo '<h2>'. $addon->getConfig('lang_'. rex_clang::getCurrentId() .'_unsubscribe', '') .'</h2>';
echo '<br>';
Expand All @@ -83,6 +83,7 @@ function unsubscribe($email)
$yform->setObjectparams('form_action', rex_getUrl(rex_article::getCurrentId(), rex_clang::getCurrentId()));
$yform->setObjectparams('Error-occured', $addon->getConfig('lang_'. rex_clang::getCurrentId() .'_no_userdata', ''));
$yform->setObjectparams('real_field_names', true);
$yform->setObjectparams('form_name', 'multinewsletter_module_80_5_'. random_int(1, 100));

echo $yform->getForm();
}
Expand Down
3 changes: 2 additions & 1 deletion pages/help.changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<p>3.4.1</p>
<ul>
<li>Modul 80-5 "MultiNewsletter YForm Abmeldung": Einstellung der Breite des Blocks funktioniert jetzt korrekt.</li>
<li>Modul 80-4 "MultiNewsletter YForm Anmeldung": Formular mit Formularnamen versehen um bessere YForm Spamprotection Kompatibilität bei mehreren Formularen auf einer Seite herzustellen.</li>
<li>Modul 80-5 "MultiNewsletter YForm Abmeldung": Einstellung der Breite des Blocks funktioniert jetzt korrekt. Außerdem FOrmular mit Formularnamen versehen um bessere YForm Spamprotection Kompatibilität bei mehreren Formularen auf einer Seite herzustellen.</li>
</ul>
<p>3.4.0</p>
<ul>
Expand Down
12 changes: 6 additions & 6 deletions pages/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,26 +193,26 @@
<dt><label for="import_action"></label></dt>
<dd><input type="radio" value="overwrite" name="import_action"
<?php if ('' == filter_input(INPUT_POST, 'import_action') || 'overwrite' == filter_input(INPUT_POST, 'import_action')) {
echo 'checked="checked"';
} ?> />
echo 'checked="checked"';
} ?> />
<?= rex_i18n::msg('multinewsletter_import_overwrite')?>
</dd>
</dl>
<dl class="rex-form-group form-group">
<dt><label for="import_action"></label></dt>
<dd><input type="radio" value="delete" name="import_action"
<?php if ('delete' == filter_input(INPUT_POST, 'import_action')) {
echo 'checked="checked"';
} ?> />
echo 'checked="checked"';
} ?> />
<?= rex_i18n::msg('multinewsletter_import_delete')?>
</dd>
</dl>
<dl class="rex-form-group form-group">
<dt><label for="import_action"></label></dt>
<dd><input type="radio" value="add_new" name="import_action"
<?php if ('add_new' == filter_input(INPUT_POST, 'import_action')) {
echo 'checked="checked"';
} ?> />
echo 'checked="checked"';
} ?> />
<?= rex_i18n::msg('multinewsletter_import_add_new')?>
</dd>
</dl>
Expand Down

0 comments on commit 298ac5e

Please sign in to comment.