public function getroute() { $view = Jrequest::getCmd('view'); switch ($view) { case "matrix": $link = JoomleagueHelperRoute::getMatrixRoute(JRequest::getVar('p'), JRequest::getVar('division'), JRequest::getVar('r')); break; case "teaminfo": $link = JoomleagueHelperRoute::getTeamInfoRoute(JRequest::getVar('p'), JRequest::getVar('tid')); break; case "referees": $link = JoomleagueHelperRoute::getRefereesRoute(JRequest::getVar('p')); break; case "results": $link = JoomleagueHelperRoute::getResultsRoute(JRequest::getVar('p'), JRequest::getVar('r'), JRequest::getVar('division')); break; case "resultsranking": $link = JoomleagueHelperRoute::getResultsRankingRoute(JRequest::getVar('p')); break; case "rankingmatrix": $link = JoomleagueHelperRoute::getRankingMatrixRoute(JRequest::getVar('p'), JRequest::getVar('r'), JRequest::getVar('division')); break; case "resultsrankingmatrix": $link = JoomleagueHelperRoute::getResultsRankingMatrixRoute(JRequest::getVar('p'), JRequest::getVar('r'), JRequest::getVar('division')); break; case "teamplan": $link = JoomleagueHelperRoute::getTeamPlanRoute(JRequest::getVar('p'), JRequest::getVar('tid'), JRequest::getVar('division')); break; case "roster": $link = JoomleagueHelperRoute::getPlayersRoute(JRequest::getVar('p'), JRequest::getVar('tid'), null, JRequest::getVar('division')); break; case "eventsranking": $link = JoomleagueHelperRoute::getEventsRankingRoute(JRequest::getVar('p'), JRequest::getVar('division'), JRequest::getVar('tid')); break; case "curve": $link = JoomleagueHelperRoute::getCurveRoute(JRequest::getVar('p'), JRequest::getVar('tid'), 0, JRequest::getVar('division')); break; case "statsranking": $link = JoomleagueHelperRoute::getStatsRankingRoute(JRequest::getVar('p'), JRequest::getVar('division')); break; default: case "ranking": $link = JoomleagueHelperRoute::getRankingRoute(JRequest::getVar('p'), JRequest::getVar('r'), null, null, 0, JRequest::getVar('division')); } // echo json_encode($link); // Use the correct json mime-type header('Content-Type: application/json'); // Send the response. echo json_encode($link); JFactory::getApplication()->close(); }
function getroute() { $app =& JFactory::getApplication(); $view = Jrequest::getCmd('view'); switch ($view) { case "teaminfo": $link = JoomleagueHelperRoute::getTeamInfoRoute(JRequest::getVar('p'), JRequest::getVar('tid')); break; case "resultsranking": $link = JoomleagueHelperRoute::getResultsRankingRoute(JRequest::getVar('p')); break; case "rankingmatrix": $link = JoomleagueHelperRoute::getRankingMatrixRoute(JRequest::getVar('p')); break; case "resultsrankingmatrix": $link = JoomleagueHelperRoute::getResultsRankingMatrixRoute(JRequest::getVar('p')); break; case "teamplan": $link = JoomleagueHelperRoute::getTeamPlanRoute(JRequest::getVar('p'), JRequest::getVar('tid'), JRequest::getVar('division')); break; case "roster": $link = JoomleagueHelperRoute::getPlayersRoute(JRequest::getVar('p'), JRequest::getVar('tid')); break; case "eventsranking": $link = JoomleagueHelperRoute::getEventsRankingRoute(JRequest::getVar('p'), JRequest::getVar('division')); break; case "curve": $link = JoomleagueHelperRoute::getCurveRoute(JRequest::getVar('p'), 0, 0, JRequest::getVar('division')); break; case "statsranking": $link = JoomleagueHelperRoute::getStatsRankingRoute(JRequest::getVar('p'), JRequest::getVar('division')); break; default: case "ranking": $link = JoomleagueHelperRoute::getRankingRoute(JRequest::getVar('p'), null, null, null, 0, JRequest::getVar('division')); } echo json_encode($link); $app->close(); }
function getRoundSelectNavigation(&$rounds) { $options = array(); foreach ($rounds as $r) { $link = JoomleagueHelperRoute::getResultsRankingRoute($this->project->slug, $r->value); $options[] = JHTML::_('select.option', $link, $r->text); } return $options; }
/** * return link for specified view - allow seo consistency * * @param string $view * @return string url */ public function getLink($view) { if (!$this->_project_id) { return false; } // echo 'getLink <br>'; // echo 'round_id ->'.$this->_round_id.'<br>'; // echo 'project_id ->'.$this->_project_id.'<br>'; // echo 'division_id ->'.$this->_division_id.'<br>'; // echo 'team_id ->'.$this->_team_id.'<br>'; switch ($view) { case "calendar": $link = JoomleagueHelperRoute::getTeamPlanRoute($this->_project_id, $this->_team_id, $this->_division_id); break; case "curve": $link = JoomleagueHelperRoute::getCurveRoute($this->_project_id, $this->_team_id, 0, $this->_division_id); break; case "eventsranking": $link = JoomleagueHelperRoute::getEventsRankingRoute($this->_project_id, $this->_division_id, $this->_team_id); break; case "matrix": $link = JoomleagueHelperRoute::getMatrixRoute($this->_project_id, $this->_division_id); break; case "referees": $link = JoomleagueHelperRoute::getRefereesRoute($this->_project_id); break; case "results": $link = JoomleagueHelperRoute::getResultsRoute($this->_project_id, $this->_round_id, $this->_division_id); break; case "resultsmatrix": $link = JoomleagueHelperRoute::getResultsMatrixRoute($this->_project_id, $this->_round_id, $this->_division_id); break; case "resultsranking": $link = JoomleagueHelperRoute::getResultsRankingRoute($this->_project_id, $this->_round_id, $this->_division_id); break; case "rankingalltime": $link = JoomleagueHelperRoute::getRankingAllTimeRoute($this->_league_id, $this->getParam('show_alltimetable_points'), $this->_project_id); break; case "resultsrankingmatrix": $link = JoomleagueHelperRoute::getResultsRankingMatrixRoute($this->_project_id, $this->_round_id, $this->_division_id); break; case "roster": if (!$this->_team_id) { return false; } $link = JoomleagueHelperRoute::getPlayersRoute($this->_project_id, $this->_team_id); break; case "stats": $link = JoomleagueHelperRoute::getStatsRoute($this->_project_id, $this->_division_id); break; case "statsranking": $link = JoomleagueHelperRoute::getStatsRankingRoute($this->_project_id, $this->_division_id); break; case "teaminfo": if (!$this->_team_id) { return false; } $link = JoomleagueHelperRoute::getTeamInfoRoute($this->_project_id, $this->_team_id); break; case "teamplan": if (!$this->_team_id) { return false; } $link = JoomleagueHelperRoute::getTeamPlanRoute($this->_project_id, $this->_team_id, $this->_division_id); break; case "clubinfo": if (!$this->_team_id) { return false; } $this->getClubId(); $link = JoomleagueHelperRoute::getClubInfoRoute($this->_project_id, $this->_club_id); break; case "clubplan": if (!$this->_team_id) { return false; } $this->getClubId(); $link = JoomleagueHelperRoute::getClubPlanRoute($this->_project_id, $this->_club_id); break; case "teamstats": if (!$this->_team_id) { return false; } $link = JoomleagueHelperRoute::getTeamStatsRoute($this->_project_id, $this->_team_id); break; case "treetonode": $link = JoomleagueHelperRoute::getBracketsRoute($this->_project_id); break; case "jltournamenttree": $link = JoomleagueHelperRoute::getTournamentRoute($this->_project_id, $this->_round_id); break; case "separator": return false; default: case "ranking": $link = JoomleagueHelperRoute::getRankingRoute($this->_project_id, $this->_round_id, null, null, 0, $this->_division_id); } return $link; }
/** * return link for specified view - allow seo consistency * * @param string $view * @return string url */ public function getLink($view) { if (!$this->_project_id) { return false; } switch ($view) { case "calendar": $link = JoomleagueHelperRoute::getTeamPlanRoute($this->_project_id, $this->_team_id, $this->_division_id); break; case "curve": $link = JoomleagueHelperRoute::getCurveRoute($this->_project_id, $this->_team_id, 0, $this->_division_id); break; case "eventsranking": $link = JoomleagueHelperRoute::getEventsRankingRoute($this->_project_id, $this->_division_id, $this->_team_id); break; case "matrix": $link = JoomleagueHelperRoute::getMatrixRoute($this->_project_id, $this->_division_id); break; case "referees": $link = JoomleagueHelperRoute::getRefereesRoute($this->_project_id); break; case "results": $link = JoomleagueHelperRoute::getResultsRoute($this->_project_id, $this->_round_id, $this->_division_id); break; case "resultsmatrix": $link = JoomleagueHelperRoute::getResultsMatrixRoute($this->_project_id, $this->_round_id, $this->_division_id); break; case "resultsranking": $link = JoomleagueHelperRoute::getResultsRankingRoute($this->_project_id, $this->_round_id, $this->_division_id); break; case "resultsrankingmatrix": $link = JoomleagueHelperRoute::getResultsRankingMatrixRoute($this->_project_id, $this->_round_id, $this->_division_id); break; case "roster": if (!$this->_team_id) { return false; } $link = JoomleagueHelperRoute::getPlayersRoute($this->_project_id, $this->_team_id, null, $this->_division_id); break; case "stats": $link = JoomleagueHelperRoute::getStatsRoute($this->_project_id, $this->_division_id); break; case "statsranking": $link = JoomleagueHelperRoute::getStatsRankingRoute($this->_project_id, $this->_division_id); break; case "teaminfo": if (!$this->_team_id) { return false; } $link = JoomleagueHelperRoute::getTeamInfoRoute($this->_project_id, $this->_team_id); break; case "teamplan": if (!$this->_team_id) { return false; } $link = JoomleagueHelperRoute::getTeamPlanRoute($this->_project_id, $this->_team_id, $this->_division_id); break; case "teamstats": if (!$this->_team_id) { return false; } $link = JoomleagueHelperRoute::getTeamStatsRoute($this->_project_id, $this->_team_id); break; case "treetonode": $link = JoomleagueHelperRoute::getBracketsRoute($this->_project_id); break; case "separator": return false; default: case "ranking": $link = JoomleagueHelperRoute::getRankingRoute($this->_project_id, $this->_round_id, null, null, 0, $this->_division_id); } return $link; }