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/photos_add.php | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) (limited to 'admin/photos_add.php') diff --git a/admin/photos_add.php b/admin/photos_add.php index 92fd6b0bb..fbc7deeab 100644 --- a/admin/photos_add.php +++ b/admin/photos_add.php @@ -49,53 +49,17 @@ $upload_form_config = get_upload_form_config(); // +-----------------------------------------------------------------------+ // | Tabs | // +-----------------------------------------------------------------------+ - -$tabs = array( - array( - 'code' => 'direct', - 'label' => l10n('Web Form'), - ), - array( - 'code' => 'applications', - 'label' => l10n('Applications'), - ), - ); - -if ($conf['enable_synchronization']) -{ - array_push( - $tabs, - array( - 'code' => 'ftp', - 'label' => l10n('FTP + Synchronization'), - ) - ); -} - -$tab_codes = array_map( - create_function('$a', 'return $a["code"];'), - $tabs - ); - -if (isset($_GET['section']) and in_array($_GET['section'], $tab_codes)) +if (isset($_GET['section'])) { $page['tab'] = $_GET['section']; } else { - $page['tab'] = $tabs[0]['code']; + $page['tab'] = 'direct'; } $tabsheet = new tabsheet(); $tabsheet->set_id('photos_add'); -foreach ($tabs as $tab) -{ - $tabsheet->add( - $tab['code'], - $tab['label'], - PHOTOS_ADD_BASE_URL.'&section='.$tab['code'] - ); -} $tabsheet->select($page['tab']); $tabsheet->assign(); -- cgit v1.2.3