From 9a4a9d846e6bd74a61d1ab390ea4deb3224f4170 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Mon, 23 Jul 2012 11:50:41 +0000 Subject: 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 --- admin/help.php | 44 +++++--------------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-) (limited to 'admin/help.php') 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§ion='; +$help_link = get_root_url().'admin.php?page=help§ion='; $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'], ) ); -- cgit v1.2.3