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
This commit is contained in:
plegall
2010-12-31 15:06:36 +00:00
parent c811651769
commit 6495263fd4
4 changed files with 187 additions and 28 deletions
+43 -15
View File
@@ -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 |
@@ -267,23 +268,50 @@ else
$page['start'] = $_GET['start'];
}
// +-----------------------------------------------------------------------+
// | Tabs |
// +-----------------------------------------------------------------------+
$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
);
if (isset($_GET['mode']) and in_array($_GET['mode'], $tab_codes))
{
$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'].'&mode='.$tab['code']
);
}
$tabsheet->select($page['tab']);
$tabsheet->assign();
// +-----------------------------------------------------------------------+
// | open specific mode |
// +-----------------------------------------------------------------------+
$_GET['mode'] = !empty($_GET['mode']) ? $_GET['mode'] : 'global';
switch ($_GET['mode'])
{
case 'global' :
{
include(dirname(__FILE__).'/batch_manager_global.php');
break;
}
case 'unit' :
{
include(PHPWG_ROOT_PATH.'admin/element_set_unit.php');
break;
}
}
include(PHPWG_ROOT_PATH.'admin/batch_manager_'.$page['tab'].'.php');
?>