Skip to content

Commit

Permalink
Preference page not shown after update #1526
Browse files Browse the repository at this point in the history
  • Loading branch information
Fasse committed Nov 19, 2023
1 parent cdcac99 commit 658599b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 24 deletions.
56 changes: 33 additions & 23 deletions adm_program/modules/preferences/preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
* version of the file names are the values.
* @param $folder
* @return false|int[]|string[]
* @throws UnexpectedValueException
* @throws RuntimeException
*/
function getArrayFileNames($folder)
{
Expand Down Expand Up @@ -1385,18 +1387,22 @@ function getPreferencePanel($group, $id, $parentId, $title, $icon, $body)
array('type' => 'number', 'minNumber' => 1, 'maxNumber' => 9999, 'step' => 1, 'helpTextIdInline' => 'SYS_ECARD_MAX_PHOTO_SIZE_DESC')
);

$formEcards->addSelectBox(
'ecard_template',
$gL10n->get('SYS_TEMPLATE'),
getArrayFileNames(ADMIDIO_PATH . FOLDER_DATA . '/ecard_templates'),
array(
'defaultValue' => ucfirst(preg_replace('/[_-]/', ' ', str_replace('.tpl', '', $formValues['ecard_template']))),
'showContextDependentFirstEntry' => false,
'arrayKeyIsNotValue' => true,
'firstEntry' => $gL10n->get('SYS_NO_TEMPLATE'),
'helpTextIdInline' => 'SYS_TEMPLATE_DESC'
)
);
try {
$formEcards->addSelectBox(
'ecard_template',
$gL10n->get('SYS_TEMPLATE'),
getArrayFileNames(ADMIDIO_PATH . FOLDER_DATA . '/ecard_templates'),
array(
'defaultValue' => ucfirst(preg_replace('/[_-]/', ' ', str_replace('.tpl', '', $formValues['ecard_template']))),
'showContextDependentFirstEntry' => false,
'arrayKeyIsNotValue' => true,
'firstEntry' => $gL10n->get('SYS_NO_TEMPLATE'),
'helpTextIdInline' => 'SYS_TEMPLATE_DESC'
)
);
} catch (UnexpectedValueException $e) {
$gMessage->show($e->getMessage());
}
$formEcards->addSubmitButton(
'btn_save_ecards',
$gL10n->get('SYS_SAVE'),
Expand Down Expand Up @@ -1552,17 +1558,21 @@ function getPreferencePanel($group, $id, $parentId, $title, $icon, $body)
array('helpTextIdInline' => 'SYS_SHOW_CAPTCHA_DESC')
);

$formMessages->addSelectBox(
'mail_template',
$gL10n->get('SYS_EMAIL_TEMPLATE'),
getArrayFileNames(ADMIDIO_PATH . FOLDER_DATA . '/mail_templates'),
array(
'defaultValue' => ucfirst(preg_replace('/[_-]/', ' ', str_replace('.html', '', $formValues['mail_template']))),
'showContextDependentFirstEntry' => true,
'arrayKeyIsNotValue' => true,
'firstEntry' => $gL10n->get('SYS_NO_TEMPLATE'),
'helpTextIdInline' => array('SYS_EMAIL_TEMPLATE_DESC', array('adm_my_files/mail_templates', '<a href="https://www.admidio.org/dokuwiki/doku.php?id=en:2.0:e-mail-templates">', '</a>')))
);
try {
$formMessages->addSelectBox(
'mail_template',
$gL10n->get('SYS_EMAIL_TEMPLATE'),
getArrayFileNames(ADMIDIO_PATH . FOLDER_DATA . '/mail_templates'),
array(
'defaultValue' => ucfirst(preg_replace('/[_-]/', ' ', str_replace('.html', '', $formValues['mail_template']))),
'showContextDependentFirstEntry' => true,
'arrayKeyIsNotValue' => true,
'firstEntry' => $gL10n->get('SYS_NO_TEMPLATE'),
'helpTextIdInline' => array('SYS_EMAIL_TEMPLATE_DESC', array('adm_my_files/mail_templates', '<a href="https://www.admidio.org/dokuwiki/doku.php?id=en:2.0:e-mail-templates">', '</a>')))
);
} catch (UnexpectedValueException $e) {
$gMessage->show($e->getMessage());
}
$formMessages->addInput(
'mail_max_receiver',
$gL10n->get('SYS_MAX_RECEIVER'),
Expand Down
2 changes: 1 addition & 1 deletion adm_program/system/classes/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function show($content, $headline = '')
$this->inline = headers_sent();
}

if (!isset($page)) {
if (!isset($page) || !$this->inline) {
// create html page object
$page = new HtmlPage('admidio-message', $headline);
$page->hideBackLink();
Expand Down

0 comments on commit 658599b

Please sign in to comment.