public function getTemplateParameters()
 {
     $clubId = $this->_websoccer->getUser()->getClubId($this->_websoccer, $this->_db);
     // next match
     $matchinfo = YouthMatchesDataService::getYouthMatchinfoById($this->_websoccer, $this->_db, $this->_i18n, $this->_websoccer->getRequestParameter("matchid"));
     // check if home or guest team (or else it is an invalid match)
     if ($matchinfo["home_team_id"] == $clubId) {
         $teamPrefix = "home";
     } elseif ($matchinfo["guest_team_id"] == $clubId) {
         $teamPrefix = "guest";
     } else {
         // ID has been entered manually, hence message not important
         throw new Exception($this->_i18n->getMessage(MSG_KEY_ERROR_PAGENOTFOUND));
     }
     // check if expired
     if ($matchinfo["matchdate"] <= $this->_websoccer->getNowAsTimestamp() || $matchinfo["simulated"]) {
         throw new Exception($this->_i18n->getMessage("youthformation_err_matchexpired"));
     }
     // get team players
     $players = null;
     if ($clubId > 0) {
         $players = YouthPlayersDataService::getYouthPlayersOfTeamByPosition($this->_websoccer, $this->_db, $clubId, "DESC");
     }
     // get previously saved formation and tactic
     $formation = $this->_getFormation($teamPrefix, $matchinfo);
     // override by request parameters
     for ($benchNo = 1; $benchNo <= 5; $benchNo++) {
         if ($this->_websoccer->getRequestParameter("bench" . $benchNo)) {
             $formation["bench" . $benchNo] = $this->_websoccer->getRequestParameter("bench" . $benchNo);
         } else {
             if (!isset($formation["bench" . $benchNo])) {
                 $formation["bench" . $benchNo] = "";
             }
         }
     }
     $setup = $this->getFormationSetup($formation);
     for ($playerNo = 1; $playerNo <= 11; $playerNo++) {
         // set player from request
         if ($this->_websoccer->getRequestParameter("player" . $playerNo)) {
             $formation["player" . $playerNo] = $this->_websoccer->getRequestParameter("player" . $playerNo);
             $formation["player" . $playerNo . "_pos"] = $this->_websoccer->getRequestParameter("player" . $playerNo . "_pos");
             // set to 0 if no previous formation is available
         } else {
             if (!isset($formation["player" . $playerNo])) {
                 $formation["player" . $playerNo] = "";
                 $formation["player" . $playerNo . "_pos"] = "";
             }
         }
     }
     return array("matchinfo" => $matchinfo, "players" => $players, "formation" => $formation, "setup" => $setup, "youthFormation" => TRUE);
 }