Example #1
0
 public static function profile($cid)
 {
     global $lng, $coach;
     $c = new self($cid);
     $ALLOW_EDIT = is_object($coach) && ($c->coach_id == $coach->coach_id || $coach->mayManageObj(T_OBJ_COACH, $c->coach_id));
     # Coach (or admin) visting own profile?
     title($c->name);
     echo "<hr>";
     $c->_menu($ALLOW_EDIT);
     switch (isset($_GET['subsec']) ? $_GET['subsec'] : 'teams') {
         case 'profile':
             $c->_CCprofile($ALLOW_EDIT);
             break;
         case 'stats':
             $c->_stats();
             break;
         case 'newteam':
             $c->_newTeam($ALLOW_EDIT);
             break;
         case 'teams':
             $c->_teams($ALLOW_EDIT);
             break;
         case 'recentmatches':
             $c->_recentGames();
             break;
     }
 }
Example #2
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 
     }
 }