function OnPageLoad() { echo "<h1>Statistics for " . htmlentities($this->season->GetCompetitionName(), ENT_QUOTES, "UTF-8", false) . "</h1>"; require_once "_summary-data-found.php"; require_once 'xhtml/navigation/tabs.class.php'; $tabs = array('Summary' => $this->season->GetNavigateUrl()); if ($this->season->MatchTypes()->Contains(MatchType::LEAGUE)) { $tabs['Table'] = $this->season->GetTableUrl(); } if (count($this->season->GetTeams())) { $tabs['Map'] = $this->season->GetMapUrl(); } $tabs['Statistics'] = ''; echo new Tabs($tabs); ?> <div class="box tab-box"> <div class="dataFilter"></div> <div class="box-content"> <?php if (!$has_player_stats) { echo "<p>There aren't any statistics for the " . htmlentities($this->season->GetCompetitionName(), ENT_QUOTES, "UTF-8", false) . ' yet.</p> <p>To find out how to add them, see <a href="/play/manage/website/matches-and-results-why-you-should-add-yours/">Matches and results - why you should add yours</a>.</p>' . "<p>You can also view the <a href=\"" . htmlentities($this->season->GetNavigateUrl(), ENT_QUOTES, "UTF-8", false) . "\">" . htmlentities($this->season->GetCompetitionName(), ENT_QUOTES, "UTF-8", false) . " page</a>.</p>"; } else { require_once "_summary-controls.php"; } # Check for other seasons. Check is >2 becuase current season is there twice - added above if (count($this->competition->GetSeasons()) > 2) { require_once "stoolball/season-list-control.class.php"; echo new XhtmlElement('h2', htmlentities('More statistics for the ' . $this->competition->GetName(), ENT_QUOTES, "UTF-8", false)); $season_list = new SeasonListControl($this->competition->GetSeasons()); $season_list->SetExcludedSeasons(array($this->season)); $season_list->SetUrlMethod('GetStatisticsUrl'); # Override XHTML to add link to competition stats $season_list_xhtml = $season_list->__toString(); $season_list_xhtml = str_replace("<ul>", "<ul><li><a href=\"" . htmlentities($this->competition->GetStatisticsUrl(), ENT_QUOTES, "UTF-8", false) . "\">All seasons</a></li>", (string) $season_list_xhtml); echo $season_list_xhtml; } ?> </div> </div> <?php }