From 41d5c8a2585f9b937e8e756bebcfdaf0289f3dd2 Mon Sep 17 00:00:00 2001 From: HWFord <54360213+HWFord@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:28:37 +0100 Subject: [PATCH] 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 --- admin/album_notification.php | 19 +++-- admin/cat_perm.php | 7 +- admin/comments.php | 30 ++++--- admin/configuration.php | 14 +++- admin/element_set_ranks.php | 12 ++- .../configuration_sizes_process.inc.php | 7 +- .../configuration_watermark_process.inc.php | 7 +- admin/menubar.php | 7 +- admin/notification_by_mail.php | 12 ++- admin/picture_modify.php | 7 +- admin/site_update.php | 7 +- admin/themes/clear/theme.css | 31 ++++++++ .../default/template/album_notification.tpl | 24 ++++-- .../default/template/batch_manager_unit.tpl | 2 +- admin/themes/default/template/cat_perm.tpl | 38 ++++++--- admin/themes/default/template/comments.tpl | 36 ++++++++- .../template/configuration_comments.tpl | 23 ++++-- .../template/configuration_display.tpl | 24 ++++-- .../default/template/configuration_main.tpl | 23 ++++-- .../default/template/configuration_sizes.tpl | 23 ++++-- .../template/configuration_watermark.tpl | 23 ++++-- .../default/template/element_set_ranks.tpl | 41 +++++++--- admin/themes/default/template/menubar.tpl | 21 +++-- .../default/template/notification_by_mail.tpl | 38 +++++++-- .../default/template/picture_modify.tpl | 37 ++++++--- admin/themes/default/template/site_update.tpl | 29 ++++++- admin/themes/default/theme.css | 79 +++++++++++++------ admin/themes/roma/theme.css | 16 ++-- language/en_UK/admin.lang.php | 2 + language/fr_FR/admin.lang.php | 1 + 30 files changed, 492 insertions(+), 148 deletions(-) diff --git a/admin/album_notification.php b/admin/album_notification.php index 444fa1a68..3a56bac19 100644 --- a/admin/album_notification.php +++ b/admin/album_notification.php @@ -150,7 +150,11 @@ SELECT $message = l10n_dec('%d mail was sent.', '%d mails were sent.', count($users)); $message.= ' ('.implode(', ', $usernames).')'; - $page['infos'][] = $message; + $template->assign( + array( + 'save_success' =>$message, + ) + ); } elseif ('group' == $_POST['who'] and !empty($_POST['group'])) { @@ -166,7 +170,11 @@ SELECT ;'; list($group_name) = pwg_db_fetch_row(pwg_query($query)); - $page['infos'][] = l10n('An information email was sent to group "%s"', $group_name); + $template->assign( + array( + 'save_success' =>l10n('An information email was sent to group "%s"', $group_name), + ) + ); } unset_make_full_url(); @@ -224,6 +232,8 @@ else { if ('private' == $category['status']) { + $template->assign('permission_url', $admin_album_base_url.'-permissions'); + $query = ' SELECT group_id @@ -231,11 +241,6 @@ SELECT WHERE cat_id = '.$category['id'].' ;'; $group_ids = array_from_query($query, 'group_id'); - - if (count($group_ids) == 0) - { - $template->assign('permission_url', $admin_album_base_url.'-permissions'); - } } else { diff --git a/admin/cat_perm.php b/admin/cat_perm.php index 5fbf894f5..7478da5e1 100644 --- a/admin/cat_perm.php +++ b/admin/cat_perm.php @@ -158,8 +158,13 @@ DELETE add_permission_on_category($page['cat'], $grant_users); } } + + $template->assign( + array( + 'save_success' =>l10n('Album updated successfully'), + ) + ); - $page['infos'][] = l10n('Album updated successfully'); } // +-----------------------------------------------------------------------+ diff --git a/admin/comments.php b/admin/comments.php index 795e9bd0f..2cd6b313b 100644 --- a/admin/comments.php +++ b/admin/comments.php @@ -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']) + ) + ) + ); } } } diff --git a/admin/configuration.php b/admin/configuration.php index 928ebcac0..0c3f00303 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -306,7 +306,12 @@ WHERE param = \''.$row['param'].'\' pwg_query($query); } } - $page['infos'][] = l10n('Your configuration settings are saved'); + $template->assign( + array( + 'save_success' => l10n('Your configuration settings are saved'), + ) + ); + pwg_activity('system', ACTIVITY_SYSTEM_CORE, 'config', array('config_section'=>$page['section'])); } @@ -321,7 +326,12 @@ if ('sizes' == $page['section'] and isset($_GET['action']) and 'restore_settings pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param = \'disabled_derivatives\''); clear_derivative_cache(); - $page['infos'][] = l10n('Your configuration settings are saved'); + $template->assign( + array( + 'save_success' => l10n('Your configuration settings are saved'), + ) + ); + pwg_activity('system', ACTIVITY_SYSTEM_CORE, 'config', array('config_section'=>$page['section'],'config_action'=>$_GET['action'])); } diff --git a/admin/element_set_ranks.php b/admin/element_set_ranks.php index f097cc4e5..b2128c5ab 100644 --- a/admin/element_set_ranks.php +++ b/admin/element_set_ranks.php @@ -47,8 +47,6 @@ if (isset($_POST['submit'])) $page['category_id'], array_keys($_POST['rank_of_image']) ); - - $page['infos'][] = l10n('Images manual order was saved'); } if (!empty($_POST['image_order_choice']) @@ -57,6 +55,8 @@ if (isset($_POST['submit'])) $image_order_choice = $_POST['image_order_choice']; } + $message = l10n('Album updated successfully'); + $image_order = null; if ($image_order_choice=='user_define') { @@ -72,6 +72,8 @@ if (isset($_POST['submit'])) elseif ($image_order_choice=='rank') { $image_order = '`rank` ASC'; + + $message = l10n('Images manual order was saved'); } $query = ' UPDATE '.CATEGORIES_TABLE.' @@ -90,7 +92,11 @@ UPDATE '.CATEGORIES_TABLE.' pwg_query($query); } - $page['infos'][] = l10n('Your configuration settings are saved'); + $template->assign( + array( + 'save_success' => $message, + ) + ); } // +-----------------------------------------------------------------------+ diff --git a/admin/include/configuration_sizes_process.inc.php b/admin/include/configuration_sizes_process.inc.php index 7820308b4..f79a7c975 100644 --- a/admin/include/configuration_sizes_process.inc.php +++ b/admin/include/configuration_sizes_process.inc.php @@ -243,8 +243,13 @@ if (count($errors) == 0) { clear_derivative_cache($changed_types); } + + $template->assign( + array( + 'save_success' => l10n('Your configuration settings are saved'), + ) + ); - $page['infos'][] = l10n('Your configuration settings are saved'); pwg_activity('system', ACTIVITY_SYSTEM_CORE, 'config', array('config_section'=>'sizes')); } else diff --git a/admin/include/configuration_watermark_process.inc.php b/admin/include/configuration_watermark_process.inc.php index 083ab64e8..b9d976d1f 100644 --- a/admin/include/configuration_watermark_process.inc.php +++ b/admin/include/configuration_watermark_process.inc.php @@ -194,8 +194,13 @@ if (count($errors) == 0) { clear_derivative_cache($changed_types); } + + $template->assign( + array( + 'save_success' => l10n('Your configuration settings are saved'), + ) + ); - $page['infos'][] = l10n('Your configuration settings are saved'); pwg_activity('system', ACTIVITY_SYSTEM_CORE, 'config', array('config_section'=>'watermark')); } else diff --git a/admin/menubar.php b/admin/menubar.php index 9cd8a1d62..58aaf6830 100644 --- a/admin/menubar.php +++ b/admin/menubar.php @@ -136,7 +136,12 @@ UPDATE '.CONFIG_TABLE.' '; pwg_query($query); - $page['infos'][] = l10n('Order of menubar items has been updated successfully.'); + $template->assign( + array( + 'save_success' => l10n('Order of menubar items has been updated successfully.'), + ) + ); + } make_consecutive( $mb_conf ); diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php index 19f0bd8df..17d126d40 100644 --- a/admin/notification_by_mail.php +++ b/admin/notification_by_mail.php @@ -526,10 +526,14 @@ switch ($page['mode']) } } - $page['infos'][] = l10n_dec( - '%d parameter was updated.', '%d parameters were updated.', - $updated_param_count - ); + $template->assign( + array( + 'save_success' => l10n_dec( + '%d parameter was updated.', '%d parameters were updated.', + $updated_param_count + ) + ) + ); } } case 'subscribe' : diff --git a/admin/picture_modify.php b/admin/picture_modify.php index 2252a246c..61b137e54 100644 --- a/admin/picture_modify.php +++ b/admin/picture_modify.php @@ -181,7 +181,12 @@ UPDATE '.CATEGORIES_TABLE.' $represented_albums = $_POST['represent']; - $page['infos'][] = l10n('Photo informations updated'); + $template->assign( + array( + 'save_success' => l10n('Photo informations updated'), + ) + ); + pwg_activity('photo', $_GET['image_id'], 'edit'); // refresh page cache diff --git a/admin/site_update.php b/admin/site_update.php index 8b4e3a893..0478ad2cd 100644 --- a/admin/site_update.php +++ b/admin/site_update.php @@ -69,7 +69,12 @@ else if (isset($page['no_md5sum_number'])) { - $page['messages'][] = ''.l10n('Some checksums are missing.').''; + $template->assign( + array( + 'save_error' => ''.l10n('Some checksums are missing.').'', + ) + ); + } // +-----------------------------------------------------------------------+ diff --git a/admin/themes/clear/theme.css b/admin/themes/clear/theme.css index d5e2a76c9..8dca852ef 100644 --- a/admin/themes/clear/theme.css +++ b/admin/themes/clear/theme.css @@ -877,6 +877,37 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; background-color:#FFA646; } + +.cat-modify-footer, +.savebar-footer { + border-color: #ececec; + background: white; +} + +.cat-modify-footer-see-out, +.savebar-see-out, +.buttonSecond { + background-color: #ECECEC!important; + color: #3C3C3C!important; +} + +.cat-modify-footer-see-out:hover, +.savebar-see-out:hover, +.buttonSecond:hover { + background-color: #F29F4B!important; + color: #3C3C3C!important; +} + +.cat-modify-footer-see-out:focus { + border: 2px solid #F4AB4F; + background: #ECECEC; +} + +.cat-modify-footer-see-out.disabled { + background-color: #ECECEC; + color: #B8B8B8; + .RenameTagPopInContainer { background-color:#fff; + } \ No newline at end of file diff --git a/admin/themes/default/template/album_notification.tpl b/admin/themes/default/template/album_notification.tpl index 7a4024203..b97fa3304 100644 --- a/admin/themes/default/template/album_notification.tpl +++ b/admin/themes/default/template/album_notification.tpl @@ -117,12 +117,24 @@ span.errors {
{/if} -- -
+ diff --git a/admin/themes/default/template/batch_manager_unit.tpl b/admin/themes/default/template/batch_manager_unit.tpl index ccfc2cdd8..e10f95b2e 100644 --- a/admin/themes/default/template/batch_manager_unit.tpl +++ b/admin/themes/default/template/batch_manager_unit.tpl @@ -330,7 +330,7 @@ pluginValues = []; diff --git a/admin/themes/default/template/cat_perm.tpl b/admin/themes/default/template/cat_perm.tpl index 6049ef8ed..816ffcf6b 100644 --- a/admin/themes/default/template/cat_perm.tpl +++ b/admin/themes/default/template/cat_perm.tpl @@ -168,17 +168,33 @@ jQuery("#selectStatus").change(function() { *} - -- +
- diff --git a/admin/themes/default/template/comments.tpl b/admin/themes/default/template/comments.tpl index 334b21830..9fda8f142 100644 --- a/admin/themes/default/template/comments.tpl +++ b/admin/themes/default/template/comments.tpl @@ -80,10 +80,38 @@ jQuery(document).ready(function(){ {'Invert'|@translate} -- - -
+ + {/if} diff --git a/admin/themes/default/template/configuration_comments.tpl b/admin/themes/default/template/configuration_comments.tpl index 2bdfc881c..bddfd7fef 100644 --- a/admin/themes/default/template/configuration_comments.tpl +++ b/admin/themes/default/template/configuration_comments.tpl @@ -150,11 +150,22 @@ -- -
+ - \ No newline at end of file diff --git a/admin/themes/default/template/configuration_display.tpl b/admin/themes/default/template/configuration_display.tpl index 85feaab28..fe31f857d 100644 --- a/admin/themes/default/template/configuration_display.tpl +++ b/admin/themes/default/template/configuration_display.tpl @@ -318,11 +318,23 @@ -- -
+ + - \ No newline at end of file diff --git a/admin/themes/default/template/configuration_main.tpl b/admin/themes/default/template/configuration_main.tpl index 3ae6869a8..19910ecb9 100644 --- a/admin/themes/default/template/configuration_main.tpl +++ b/admin/themes/default/template/configuration_main.tpl @@ -291,11 +291,22 @@ jQuery("input[name='email_admin_on_new_user_filter']").change(function() { -- -
+ - \ No newline at end of file diff --git a/admin/themes/default/template/configuration_sizes.tpl b/admin/themes/default/template/configuration_sizes.tpl index 28ef39a47..9df0cff92 100644 --- a/admin/themes/default/template/configuration_sizes.tpl +++ b/admin/themes/default/template/configuration_sizes.tpl @@ -221,11 +221,22 @@ $(".restore-settings-button").each(function() { -- -
+ - \ No newline at end of file diff --git a/admin/themes/default/template/configuration_watermark.tpl b/admin/themes/default/template/configuration_watermark.tpl index 084f49d82..8ea6f187e 100644 --- a/admin/themes/default/template/configuration_watermark.tpl +++ b/admin/themes/default/template/configuration_watermark.tpl @@ -129,11 +129,22 @@ -- -
+ - \ No newline at end of file diff --git a/admin/themes/default/template/element_set_ranks.tpl b/admin/themes/default/template/element_set_ranks.tpl index ac86099ca..3fe8eeb11 100644 --- a/admin/themes/default/template/element_set_ranks.tpl +++ b/admin/themes/default/template/element_set_ranks.tpl @@ -41,9 +41,8 @@ jQuery('.thumbnail').tipTip({ }); {/footer_script} - diff --git a/admin/themes/default/template/menubar.tpl b/admin/themes/default/template/menubar.tpl index c6d399710..fc5ce8132 100644 --- a/admin/themes/default/template/menubar.tpl +++ b/admin/themes/default/template/menubar.tpl @@ -61,10 +61,21 @@ jQuery(document).ready(function(){ {/foreach} - + diff --git a/admin/themes/default/template/notification_by_mail.tpl b/admin/themes/default/template/notification_by_mail.tpl index cecf84007..5158de45f 100644 --- a/admin/themes/default/template/notification_by_mail.tpl +++ b/admin/themes/default/template/notification_by_mail.tpl @@ -69,10 +69,7 @@ jQuery(document).ready(function(){ -- - -
+ {/if}{* isset $param*} {if isset($subscribe)} @@ -141,4 +138,35 @@ jQuery(document).ready(function(){ {/if} {/if}{* isset $send*} - + {if isset($param)} + + {/if} + + \ No newline at end of file diff --git a/admin/themes/default/template/picture_modify.tpl b/admin/themes/default/template/picture_modify.tpl index 7012481ca..bfcd55496 100644 --- a/admin/themes/default/template/picture_modify.tpl +++ b/admin/themes/default/template/picture_modify.tpl @@ -107,19 +107,11 @@ const str_assoc_album_ab = '{'Associate to album'|translate|escape:javascript}'; {/if} - {if isset($U_JUMPTO)} - -{'Open in gallery'|@translate}
- {else} - -{'Open in gallery'|translate}
- {/if} {if $INTRO.is_svg}+
+- -
+