0) { $pendings_label.= ' ('.$page['community_nb_pendings'].')'; } $tabs = array( array( 'code' => 'permissions', 'label' => l10n('Upload Permissions'), ), array( 'code' => 'pendings', 'label' => $pendings_label, ), ); $tab_codes = array_map( create_function('$a', 'return $a["code"];'), $tabs ); if (isset($_GET['tab']) and in_array($_GET['tab'], $tab_codes)) { $page['tab'] = $_GET['tab']; } else { $page['tab'] = $tabs[0]['code']; } $tabsheet = new tabsheet(); foreach ($tabs as $tab) { $tabsheet->add( $tab['code'], $tab['label'], COMMUNITY_BASE_URL.'-'.$tab['code'] ); } $tabsheet->select($page['tab']); $tabsheet->assign(); // +-----------------------------------------------------------------------+ // | template init | // +-----------------------------------------------------------------------+ $template->set_filenames( array( 'photos_add' => 'photos_add_'.$page['tab'].'.tpl' ) ); // +-----------------------------------------------------------------------+ // | Load the tab | // +-----------------------------------------------------------------------+ include(COMMUNITY_PATH.'admin_'.$page['tab'].'.php'); ?>