aboutsummaryrefslogtreecommitdiffstats
path: root/admin/batch_manager.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-12-31 15:06:36 +0000
committerplegall <plg@piwigo.org>2010-12-31 15:06:36 +0000
commit6495263fd499ed6a9b9020865f84b1c0e4ca171e (patch)
treed883fcc5f6bb3cf9aa55268f0dd1d5c803858e6d /admin/batch_manager.php
parentc811651769f55a401f2d0f59657e2c5676382e94 (diff)
feature 2089: Batch Manager, switch from global to unit mode with tabs
git-svn-id: http://piwigo.org/svn/trunk@8413 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/batch_manager.php54
1 files changed, 41 insertions, 13 deletions
diff --git a/admin/batch_manager.php b/admin/batch_manager.php
index a608a9bf5..89a1b8bc1 100644
--- a/admin/batch_manager.php
+++ b/admin/batch_manager.php
@@ -33,6 +33,7 @@ if (!defined('PHPWG_ROOT_PATH'))
}
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok |
@@ -268,22 +269,49 @@ else
}
// +-----------------------------------------------------------------------+
-// | open specific mode |
+// | Tabs |
// +-----------------------------------------------------------------------+
-$_GET['mode'] = !empty($_GET['mode']) ? $_GET['mode'] : 'global';
+$tabs = array(
+ array(
+ 'code' => 'global',
+ 'label' => l10n('global mode'),
+ ),
+ array(
+ 'code' => 'unit',
+ 'label' => l10n('unit mode'),
+ ),
+ );
+
+$tab_codes = array_map(
+ create_function('$a', 'return $a["code"];'),
+ $tabs
+ );
-switch ($_GET['mode'])
+if (isset($_GET['mode']) and in_array($_GET['mode'], $tab_codes))
{
- case 'global' :
- {
- include(dirname(__FILE__).'/batch_manager_global.php');
- break;
- }
- case 'unit' :
- {
- include(PHPWG_ROOT_PATH.'admin/element_set_unit.php');
- break;
- }
+ $page['tab'] = $_GET['mode'];
+}
+else
+{
+ $page['tab'] = $tabs[0]['code'];
}
+
+$tabsheet = new tabsheet();
+foreach ($tabs as $tab)
+{
+ $tabsheet->add(
+ $tab['code'],
+ $tab['label'],
+ get_root_url().'admin.php?page='.$_GET['page'].'&amp;mode='.$tab['code']
+ );
+}
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+// +-----------------------------------------------------------------------+
+// | open specific mode |
+// +-----------------------------------------------------------------------+
+
+include(PHPWG_ROOT_PATH.'admin/batch_manager_'.$page['tab'].'.php');
?>