fixes #2306 move save buttons to bottom of page (PR #2346)

For these pages :
 picture modify, album notification, category permission, comments, menubar, all configurations, site update, element set ranks, notification by mail

Change how success and errors messages are displayed and handled
This commit is contained in:
HWFord
2025-03-21 16:28:37 +01:00
committed by GitHub
parent 4a539bdfb7
commit 41d5c8a258
30 changed files with 492 additions and 148 deletions

View File

@@ -36,7 +36,11 @@ if (!empty($_POST))
{
if (empty($_POST['comments']))
{
$page['errors'][] = l10n('Select at least one comment');
$template->assign(
array(
'save_warning' => l10n('Select at least one comment')
)
);
}
else
{
@@ -47,20 +51,28 @@ if (!empty($_POST))
{
validate_user_comment($_POST['comments']);
$page['infos'][] = l10n_dec(
'%d user comment validated', '%d user comments validated',
count($_POST['comments'])
);
$template->assign(
array(
'save_success' => l10n_dec(
'%d user comment validated', '%d user comments validated',
count($_POST['comments'])
)
)
);
}
if (isset($_POST['reject']))
{
delete_user_comment($_POST['comments']);
$page['infos'][] = l10n_dec(
'%d user comment rejected', '%d user comments rejected',
count($_POST['comments'])
);
$template->assign(
array(
'save_error' => l10n_dec(
'%d user comment rejected', '%d user comments rejected',
count($_POST['comments'])
)
)
);
}
}
}