From 663d72e06306108d1b06ae0919c6bf8325c2a9f5 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 25 May 2011 09:01:55 +0000 Subject: bug 1786 fixed: ability to prefilter the synchronize screen with a specific album by clicking on the new "Synchronize" icon on album admin page or album admin list. This is not the solution proposed by Gotcha (ie a treeview to select the album on the synchronize screen) but it solves the same problem. git-svn-id: http://piwigo.org/svn/branches/2.2@11040 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/cat_list.php | 7 +++++++ admin/cat_modify.php | 9 +++++++++ admin/site_update.php | 10 +++++++++- admin/themes/clear/icon/synchronize.png | Bin 0 -> 1758 bytes admin/themes/default/icon/synchronize.png | Bin 0 -> 782 bytes admin/themes/default/template/cat_list.tpl | 3 +++ admin/themes/default/template/cat_modify.tpl | 3 +++ 7 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 admin/themes/clear/icon/synchronize.png create mode 100644 admin/themes/default/icon/synchronize.png diff --git a/admin/cat_list.php b/admin/cat_list.php index ae957792d..050b7c06a 100644 --- a/admin/cat_list.php +++ b/admin/cat_list.php @@ -307,6 +307,13 @@ foreach ($categories as $category) $tpl_cat['U_DELETE'] = $self_url.'&delete='.$category['id']; $tpl_cat['U_DELETE'].= '&pwg_token='.get_pwg_token(); } + else + { + if ($conf['enable_synchronization']) + { + $tpl_cat['U_SYNC'] = $base_url.'site_update&site=1&cat_id='.$category['id']; + } + } if ( array_key_exists($category['id'], $categories_with_images) ) { diff --git a/admin/cat_modify.php b/admin/cat_modify.php index 8f99a9155..3c944ce7b 100644 --- a/admin/cat_modify.php +++ b/admin/cat_modify.php @@ -270,6 +270,15 @@ else $category['cat_full_dir'] ) ) ); + + if ($conf['enable_synchronization']) + { + $template->assign( + 'U_SYNC', + $base_url.'site_update&site=1&cat_id='.$category['id'] + ); + } + } // representant management diff --git a/admin/site_update.php b/admin/site_update.php index 6b5ae775b..5b90729b8 100644 --- a/admin/site_update.php +++ b/admin/site_update.php @@ -809,8 +809,16 @@ else 'meta_all' => false, 'meta_empty_overrides' => false, ); - + $cat_selected = array(); + + if (isset($_GET['cat_id'])) + { + check_input_parameter('cat_id', $_GET, false, PATTERN_ID); + + $cat_selected = array($_GET['cat_id']); + $tpl_introduction['sync'] = 'files'; + } } $tpl_introduction['privacy_level_options'] = get_privacy_level_options(); diff --git a/admin/themes/clear/icon/synchronize.png b/admin/themes/clear/icon/synchronize.png new file mode 100644 index 000000000..72a8c0ec5 Binary files /dev/null and b/admin/themes/clear/icon/synchronize.png differ diff --git a/admin/themes/default/icon/synchronize.png b/admin/themes/default/icon/synchronize.png new file mode 100644 index 000000000..767bb3b6d Binary files /dev/null and b/admin/themes/default/icon/synchronize.png differ diff --git a/admin/themes/default/template/cat_list.tpl b/admin/themes/default/template/cat_list.tpl index 1917bb3fa..2a535c13a 100644 --- a/admin/themes/default/template/cat_list.tpl +++ b/admin/themes/default/template/cat_list.tpl @@ -74,6 +74,9 @@ jQuery(document).ready(function(){ldelim} {if isset($category.U_MANAGE_PERMISSIONS) }
  • {'Permissions'|@translate}
  • {/if} + {if isset($category.U_SYNC) } +
  • {'Synchronize'|@translate}
  • + {/if} {if isset($category.U_DELETE) }
  • {'delete album'|@translate}
  • {/if} diff --git a/admin/themes/default/template/cat_modify.tpl b/admin/themes/default/template/cat_modify.tpl index 8c51785e2..0e03aeacd 100644 --- a/admin/themes/default/template/cat_modify.tpl +++ b/admin/themes/default/template/cat_modify.tpl @@ -20,6 +20,9 @@ {if isset($U_MANAGE_PERMISSIONS) }
  • {'Permissions'|@translate}
  • {/if} + {if isset($U_SYNC) } +
  • {'Synchronize'|@translate}
  • + {/if} {if isset($U_DELETE) }
  • {'delete album'|@translate}
  • {/if} -- cgit v1.2.3