From 7e16092442561e847452065048d2b138eb8442e9 Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 2 Feb 2011 20:55:25 +0000 Subject: allow to include batch_manager with a mode <> than global/unit (don't create tabsheet and dont include global/unit.php); used by rv_gmaps to batch edit lat/lon git-svn-id: http://piwigo.org/svn/trunk@9068 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/batch_manager.php | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/admin/batch_manager.php b/admin/batch_manager.php index 602611a22..fa3720b27 100644 --- a/admin/batch_manager.php +++ b/admin/batch_manager.php @@ -50,7 +50,7 @@ check_input_parameter('selection', $_POST, true, PATTERN_ID); if (isset($_POST['submitFilter'])) { // echo '
'; print_r($_POST); echo '
'; - + $_SESSION['bulk_manager_filter'] = array(); if (isset($_POST['filter_prefilter_use'])) @@ -59,7 +59,7 @@ if (isset($_POST['submitFilter'])) if (in_array($_POST['filter_prefilter'], $prefilters)) { $_SESSION['bulk_manager_filter']['prefilter'] = $_POST['filter_prefilter']; - } + } } if (isset($_POST['filter_category_use'])) @@ -161,7 +161,7 @@ SELECT id FROM '.IMAGES_TABLE.' ;'; $all_elements = array_from_query($query, 'id'); - + $query = ' SELECT id FROM '.CATEGORIES_TABLE.' @@ -220,7 +220,7 @@ SELECT // we could use the group_concat MySQL function to retrieve the list of // image_ids but it would not be compatible with PostgreSQL, so let's // perform 2 queries instead. We hope there are not too many duplicates. - + $query = ' SELECT file FROM '.IMAGES_TABLE.' @@ -228,7 +228,7 @@ SELECT file HAVING COUNT(*) > 1 ;'; $duplicate_files = array_from_query($query, 'file'); - + $query = ' SELECT id FROM '.IMAGES_TABLE.' @@ -245,7 +245,7 @@ SELECT id if (isset($_SESSION['bulk_manager_filter']['category'])) { $categories = array(); - + if (isset($_SESSION['bulk_manager_filter']['category_recursive'])) { $categories = get_subcat_ids(array($_SESSION['bulk_manager_filter']['category'])); @@ -254,7 +254,7 @@ if (isset($_SESSION['bulk_manager_filter']['category'])) { $categories = array($_SESSION['bulk_manager_filter']['category']); } - + $query = ' SELECT DISTINCT(image_id) FROM '.IMAGE_CATEGORY_TABLE.' @@ -326,7 +326,7 @@ $tab_codes = array_map( $tabs ); -if (isset($_GET['mode']) and in_array($_GET['mode'], $tab_codes)) +if (isset($_GET['mode'])) { $page['tab'] = $_GET['mode']; } @@ -335,21 +335,24 @@ else $page['tab'] = $tabs[0]['code']; } -$tabsheet = new tabsheet(); -foreach ($tabs as $tab) +if (in_array($page['tab'], $tab_codes)) { - $tabsheet->add( - $tab['code'], - $tab['label'], - get_root_url().'admin.php?page='.$_GET['page'].'&mode='.$tab['code'] - ); -} -$tabsheet->select($page['tab']); -$tabsheet->assign(); + $tabsheet = new tabsheet(); + foreach ($tabs as $tab) + { + $tabsheet->add( + $tab['code'], + $tab['label'], + get_root_url().'admin.php?page='.$_GET['page'].'&mode='.$tab['code'] + ); + } + $tabsheet->select($page['tab']); + $tabsheet->assign(); // +-----------------------------------------------------------------------+ // | open specific mode | // +-----------------------------------------------------------------------+ -include(PHPWG_ROOT_PATH.'admin/batch_manager_'.$page['tab'].'.php'); -?> + include(PHPWG_ROOT_PATH.'admin/batch_manager_'.$page['tab'].'.php'); +} +?> \ No newline at end of file -- cgit v1.2.3