Merged revision(s) 16928 from trunk:

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/branches/2.4@16929 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
mistic100
2012-07-23 11:52:18 +00:00
parent 798de81516
commit 18bf888d16
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');
?>