Copyright (C) 2005 James Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> array( 'label' => 'Fair Information', 'types' => array('fair'), 'file' => 'fair_info.php', ), 'fairstatsgathering' => array( 'label' => 'Fair Stats Gathering', 'types' => array('fair'), 'file' => 'fair_stats_select.php', ), 'account' => array( 'label' => 'Account/Login', 'name' => 'Account/Login/Password', 'types' => array('student','judge','committee','volunteer','sponsor','fair'), 'file' => 'user_account.php', 'status_func' => 'user_account_status', ), 'personal' => array( 'label' => 'Personal', 'name' => 'Personal Information', 'types' => array('student','judge','committee','volunteer','sponsor','fair'), 'file' => 'user_personal.php', 'status_func' => 'user_personal_info_status', ), 'organization' => array( 'label' => 'Organization', 'name' => 'Organization Information', 'types' => array('judge','volunteer','sponsor'), 'file' => 'user_organization.php', 'status_func' => 'user_organization_status', ), 'roles' => array( 'label' => 'Roles', 'types' => array('student','judge','committee','volunteer','sponsor','fair'), 'file' => 'user_roles.php', 'status_func' => 'user_roles_status', ), 'judgeother' => array( 'label' => 'Judge Other', 'types' => array('judge'), 'file' => 'judge_other.php', ), 'judgeexpertise' => array( 'label' => 'Expertise', 'types' => array('judge'), 'file' => 'judge_expertise.php', ), 'judgeavailability' => array( 'label' => 'Time Avail.', 'types' => array('judge'), 'file' => 'judge_availability.php', ), 'judgesa' => array( 'label' => 'Special Awards', 'types' => array('judge'), 'file' => 'judge_special_awards.php', ), 'volunteerpos' => array( 'label' => 'Volunteer Positions', 'types' => array('volunteer'), 'file' => 'volunteer_position.php', ), 'fairstats' => array( 'label' => 'Fair Statistics and Information', 'types' => array('fair'), 'file' => 'fair_stats.php', ), ); $u = user_load($edit_id); $types = array_keys($u['roles']); $selected = $_GET['tab']; if(!array_key_exists($selected, $tabs)) { if(in_array('fair', $types) ) $selected = 'fairinfo'; else $selected = 'personal'; } $fields = array(); $required = array(); foreach(array_keys($u['roles']) as $r) { $fields = array_merge($fields, user_fields_enabled($r)); $required = array_merge($required, user_fields_required($r)); } /* Disable some of the tabs */ if($config['judges_availability_enable'] != 'yes') $tabs['judgeavailability']['disabled'] = true; $a = array_intersect(array('organization','phonework','fax'), $fields); if(count($a) == 0) { /* No organization stuff is enabled */ $tabs['organization']['disabled'] = true; } send_header(i18n("User Editor").": {$u['name']}"); /* Setup tabs */ echo '
'; echo '


$t) { /* Enabled has been modified now for this user */ if($t['disabled'] == true) continue; /* Get the status */ if(is_callable($t['status_func'])) { $s = call_user_func($t['status_func'], $u); $tabs[$k]['status'] = ($s == 'complete') ? 'complete' : 'incomplete'; } else { $tabs[$k]['status'] = 'incomplete'; } /* Link to switch to the tab */ $n = ($t['name'] != '') ? $t['name'] : $t['label']; ?>