Improve labels for MJML settings #47

This commit is contained in:
grandeljay 2022-11-09 12:59:11 +01:00
parent 94b746d91e
commit 39626eef9f
3 changed files with 33 additions and 9 deletions

View file

@ -39,6 +39,13 @@ $page->navigation();
<div class="ui segment">
<h3 class="ui header"><?= __('Improved') ?></h3>
<ul>
<li>
<?php
/** TRANSLATORS: Changelog: Improved */
echo __('MJML settings page');
?>
<a href="https://github.com/grandeljay/wishthis/issues/47" target="_blank">#47</a>
</li>
<li>
<?php
/** TRANSLATORS: Changelog: Improved */

View file

@ -13,9 +13,9 @@ $page->header();
$page->bodyStart();
$page->navigation();
if (isset($_POST['mjml_api'], $_POST['api_key'], $_POST['api_secret'])) {
$options->setOption('mjml_api_key', $_POST['api_key']);
$options->setOption('mjml_api_secret', $_POST['api_secret']);
if (isset($_POST['mjml_api'], $_POST['api_application_id'], $_POST['mjml_api_secret_key'])) {
$options->setOption('mjml_api_application_id', $_POST['api_application_id']);
$options->setOption('mjml_api_secret_key', $_POST['mjml_api_secret_key']);
}
?>
@ -30,20 +30,20 @@ if (isset($_POST['mjml_api'], $_POST['api_key'], $_POST['api_secret'])) {
<h3 class="ui header"><?= __('API') ?></h3>
<form class="ui form" method="POST">
<div class="field">
<label><?= __('Key') ?></label>
<label><?= __('Application ID') ?></label>
<input type="text"
name="api_key"
name="api_application_id"
placeholder="01234567-89ab-cdef-0123-456789abcdef"
value="<?= $options->getOption('mjml_api_key'); ?>"
value="<?= $options->getOption('mjml_api_application_id'); ?>"
/>
</div>
<div class="field">
<label><?= __('Secret') ?></label>
<label><?= __('Secret Key') ?></label>
<input type="text"
name="api_secret"
name="mjml_api_secret_key"
placeholder="01234567-89ab-cdef-0123-456789abcdef"
value="<?= $options->getOption('mjml_api_secret'); ?>"
value="<?= $options->getOption('mjml_api_secret_key'); ?>"
/>
</div>

View file

@ -1,3 +1,20 @@
/**
* Options
*/
UPDATE
`options`
SET
`key` = 'mjml_api_application_id'
WHERE
`key` = 'mjml_api_key';
UPDATE
`options`
SET
`key` = 'mjml_api_secret_key'
WHERE
`key` = 'mjml_api_secret';
/**
* Sessions
*/