From 58977351dd282cd14b53bbf04494acbddc185900 Mon Sep 17 00:00:00 2001 From: patdenice Date: Mon, 1 Oct 2007 15:46:04 +0000 Subject: 0000749: Add an option to add new elements to caddie when synchronize database. Add a redirection on index.php after "add to caddie action" (like on picture.php) git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2113 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/site_update.php | 16 ++++++++++++++++ index.php | 2 +- language/en_UK.iso-8859-1/admin.lang.php | 1 + language/fr_FR.iso-8859-1/admin.lang.php | 1 + template/yoga/admin/site_update.tpl | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/admin/site_update.php b/admin/site_update.php index 7e83d62fb..2c3a4eebe 100644 --- a/admin/site_update.php +++ b/admin/site_update.php @@ -485,6 +485,8 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id 'info' => l10n('update_research_added') ) ); + + $caddiables[] = $insert['id']; } else { @@ -530,6 +532,8 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id 'info' => l10n('update_research_added') ) ); + + $caddiables[] = $insert['id']; } } @@ -550,6 +554,12 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id array_keys($insert_links[0]), $insert_links ); + + // add new elements to caddie + if (isset($_POST['add_to_caddie']) and $_POST['add_to_caddie'] == 1) + { + fill_caddie($caddiables); + } } $counts['new_elements'] = count($inserts); } @@ -959,6 +969,12 @@ if (!isset($_POST['submit']) or (isset($simulate) and $simulate)) array('DISPLAY_INFO_CHECKED'=>'checked="checked"')); } + if (isset($_POST['add_to_caddie']) and $_POST['add_to_caddie'] == 1) + { + $template->assign_vars( + array('ADD_TO_CADDIE_CHECKED'=>'checked="checked"')); + } + if (isset($_POST['subcats-included']) and $_POST['subcats-included'] == 1) { $template->assign_vars( diff --git a/index.php b/index.php index f3edd49de..52dd517b0 100644 --- a/index.php +++ b/index.php @@ -86,7 +86,7 @@ else if (isset($_GET['caddie'])) { fill_caddie($page['items']); - // redirect(); + redirect(duplicate_index_url()); } //----------------------------------------------------- template initialization diff --git a/language/en_UK.iso-8859-1/admin.lang.php b/language/en_UK.iso-8859-1/admin.lang.php index cab5c4646..2acba6795 100644 --- a/language/en_UK.iso-8859-1/admin.lang.php +++ b/language/en_UK.iso-8859-1/admin.lang.php @@ -638,4 +638,5 @@ $lang['c13y_webmaster_non_existent'] = 'Main "webmaster" user don\'t exist any m $lang['c13y_bad_webmaster_status'] = 'Main "webmaster" user status is incorrect'; $lang['c13y_user_created'] = 'User "%s" created with "%s" like password'; $lang['c13y_user_status_updated'] = 'Status of user "%s" updated'; +$lang['add new elements to caddie'] = 'add new elements to caddie'; ?> diff --git a/language/fr_FR.iso-8859-1/admin.lang.php b/language/fr_FR.iso-8859-1/admin.lang.php index 748d722f1..58893f1f1 100644 --- a/language/fr_FR.iso-8859-1/admin.lang.php +++ b/language/fr_FR.iso-8859-1/admin.lang.php @@ -639,4 +639,5 @@ $lang['c13y_webmaster_non_existent'] = 'L\'utilisateur "webmestre" principal n\' $lang['c13y_bad_webmaster_status'] = 'Le statut de l\'utilisateur "webmestre" principal est incorrect'; $lang['c13y_user_created'] = 'Utilisateur "%s" créé avec comme mot de passe "%s"'; $lang['c13y_user_status_updated'] = 'Statut de l\'utilisateur "%s" mis à jour'; +$lang['add new elements to caddie'] = 'ajouter les nouveaux éléments au panier'; ?> diff --git a/template/yoga/admin/site_update.tpl b/template/yoga/admin/site_update.tpl index 31152ef35..471f98e4e 100644 --- a/template/yoga/admin/site_update.tpl +++ b/template/yoga/admin/site_update.tpl @@ -67,6 +67,7 @@
  • +
  • -- cgit v1.2.3