aboutsummaryrefslogtreecommitdiffstats
path: root/admin/help.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2012-07-23 11:50:41 +0000
committermistic100 <mistic@piwigo.org>2012-07-23 11:50:41 +0000
commit9a4a9d846e6bd74a61d1ab390ea4deb3224f4170 (patch)
treed3a40b94d272493fa02cf78434509d678c49ef91 /admin/help.php
parent7b181f067bd2a02e118e57b4c2fc44e2319ca734 (diff)
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
Diffstat (limited to '')
-rw-r--r--admin/help.php44
1 files changed, 5 insertions, 39 deletions
diff --git a/admin/help.php b/admin/help.php
index ec4a1fc45..e47740ca9 100644
--- a/admin/help.php
+++ b/admin/help.php
@@ -29,54 +29,20 @@ include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
// +-----------------------------------------------------------------------+
check_status(ACCESS_ADMINISTRATOR);
-$link = get_root_url().'admin.php?page=help&section=';
+$help_link = get_root_url().'admin.php?page=help&section=';
$selected = null;
-$help_section_title = null;
-
-$tabs = array();
-$tabs[] = array(
- 'code' => 'add_photos',
- 'label' => l10n('Add Photos'),
- );
-$tabs[] = array(
- 'code' => 'permissions',
- 'label' => l10n('Permissions'),
- );
-$tabs[] = array(
- 'code' => 'groups',
- 'label' => l10n('Groups'),
- );
-$tabs[] = array(
- 'code' => 'virtual_links',
- 'label' => l10n('Virtual Links'),
- );
-$tabs[] = array(
- 'code' => 'misc',
- 'label' => l10n('Miscellaneous'),
- );
if (!isset($_GET['section']))
{
- $section = $tabs[0]['code'];
+ $selected = 'add_photos';
}
else
{
- $section = $_GET['section'];
+ $selected = $_GET['section'];
}
$tabsheet = new tabsheet();
$tabsheet->set_id('help');
-foreach ($tabs as $tab)
-{
- if ($tab['code'] == $section)
- {
- $selected_tab = $tab['code'];
- $help_section_title = $tab['label'];
- }
-
- $tabsheet->add($tab['code'], $tab['label'], $link.$tab['code']);
-}
-$tabsheet->select($selected_tab);
$tabsheet->assign();
$template->set_filenames(array('help' => 'help.tpl'));
@@ -84,11 +50,11 @@ $template->set_filenames(array('help' => 'help.tpl'));
$template->assign(
array(
'HELP_CONTENT' => load_language(
- 'help/help_'.$selected_tab.'.html',
+ 'help/help_'.$tabsheet->selected.'.html',
'',
array('return'=>true)
),
- 'HELP_SECTION_TITLE' => $help_section_title,
+ 'HELP_SECTION_TITLE' => $tabsheet->sheets[ $tabsheet->selected ]['caption'],
)
);