feature 2703: make it easy for plugins to add tabs in admin screens

centralize all core tabs in one file

git-svn-id: http://piwigo.org/svn/trunk@16928 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
mistic100 2012-07-23 11:50:41 +00:00
commit 9a4a9d846e
20 changed files with 170 additions and 180 deletions

View file

@ -350,22 +350,7 @@ else
// +-----------------------------------------------------------------------+
// | 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
);
$manager_link = get_root_url().'admin.php?page=batch_manager&mode=';
if (isset($_GET['mode']))
{
@ -373,23 +358,13 @@ if (isset($_GET['mode']))
}
else
{
$page['tab'] = $tabs[0]['code'];
$page['tab'] = 'global';
}
if (in_array($page['tab'], $tab_codes))
{
$tabsheet = new tabsheet();
$tabsheet->set_id('batch_manager');
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();
$tabsheet = new tabsheet();
$tabsheet->set_id('batch_manager');
$tabsheet->select($page['tab']);
$tabsheet->assign();
// +-----------------------------------------------------------------------+
// | tags |
@ -405,6 +380,5 @@ $template->assign('tags', get_taglist($query, false));
// | open specific mode |
// +-----------------------------------------------------------------------+
include(PHPWG_ROOT_PATH.'admin/batch_manager_'.$page['tab'].'.php');
}
include(PHPWG_ROOT_PATH.'admin/batch_manager_'.$page['tab'].'.php');
?>