Example #1
0
 public static function profile($tid)
 {
     global $coach, $settings, $rules;
     $t = new self($tid);
     setupGlobalVars(T_SETUP_GLOBAL_VARS__LOAD_LEAGUE_SETTINGS, array('lid' => $t->f_lid));
     // Load correct $rules for league.
     /* Argument(s) passed to generating functions. */
     $ALLOW_EDIT = is_object($coach) && ($t->owned_by_coach_id == $coach->coach_id || $coach->mayManageObj(T_OBJ_TEAM, $tid)) && !$t->is_retired;
     # Show team action boxes?
     $DETAILED = isset($_GET['detailed']) && $_GET['detailed'] == 1;
     # Detailed roster view?
     /* Team pages consist of the output of these generating functions. */
     $t->_handleActions($ALLOW_EDIT);
     # Handles any actions/request sent.
     list($players, $players_backup) = $t->_loadPlayers($DETAILED);
     # Should come after _handleActions().
     $t->_roster($ALLOW_EDIT, $DETAILED, $players);
     $players = $players_backup;
     # Restore the $players array (_roster() manipulates the passed $players array).
     $t->_menu($ALLOW_EDIT, $DETAILED);
     switch (isset($_GET['subsec']) ? $_GET['subsec'] : 'man') {
         case 'hhmerc':
             $t->_HHMerc($DETAILED);
             break;
         case 'hhstar':
             $t->_HHStar($DETAILED);
             break;
         case 'man':
             $t->_actionBoxes($ALLOW_EDIT, $players);
             break;
         case 'about':
             $t->_about($ALLOW_EDIT);
             break;
         case 'news':
             $t->_news($ALLOW_EDIT);
             break;
         case 'games':
             $t->_games();
             break;
     }
     if (isset($_GET['subsec'])) {
         ?>
     <script language="JavaScript" type="text/javascript">
     window.location = "#anc";
     </script>
     <?php 
     }
 }