public function OnPrePageLoad()
 {
     # set up page
     $this->SetPageTitle("Players for " . $this->team->GetName() . ' stoolball team');
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
     $this->SetContentCssClass("playersPage");
 }
 function OnPrePageLoad()
 {
     if ($this->query instanceof SearchQuery) {
         $this->SetPageTitle("Search for '" . htmlentities($this->query->GetOriginalTerm(), ENT_QUOTES, "UTF-8", false) . "'");
     } else {
         $this->SetPageTitle("Search");
     }
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
 function OnPrePageLoad()
 {
     if (is_object($this->data_object)) {
         $this->SetPageTitle('Delete role: ' . $this->data_object->getRoleName());
     } else {
         $this->SetPageTitle("Delete role");
     }
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
 function OnPrePageLoad()
 {
     if (!is_null($this->user)) {
         $this->SetPageTitle($this->user->GetName() . "'s profile at " . $this->GetSettings()->GetSiteName());
     } else {
         $this->SetPageTitle("Page not found");
     }
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
 public function OnPrePageLoad()
 {
     # set page title
     if ($this->player instanceof Player) {
         $this->SetPageTitle('Delete player: ' . $this->player->GetName());
         $this->SetContentConstraint(StoolballPage::ConstrainColumns());
     } else {
         $this->SetPageTitle('Player already deleted');
     }
 }
 function OnPrePageLoad()
 {
     # set page title
     $this->SetPageTitle(wp_title('', false) . ' – ' . get_bloginfo('name', 'display'));
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle('Stoolball clubs and schools');
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
 function OnPrePageLoad()
 {
     $this->SetOpenGraphType("sports_league");
     $this->SetPageTitle($this->season->GetCompetitionName());
     require_once "search/competition-search-adapter.class.php";
     $adapter = new CompetitionSearchAdapter($this->competition);
     $this->SetPageDescription($adapter->GetSearchDescription());
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
    public function OnPrePageLoad()
    {
        if ($this->not_found) {
            $this->SetPageTitle("Page not found");
            return;
        }
        if ($this->regenerating) {
            require_once "stoolball/statistics/regenerating-control.class.php";
            $this->regenerating_control = new \Stoolball\Statistics\RegeneratingControl();
            $title = $this->regenerating_control->GetPageTitle();
        } else {
            $title = $this->player->GetPlayerRole() == Player::PLAYER ? ", a player for " : " conceded by ";
            $title = $this->player->GetName() . $title . $this->player->Team()->GetName() . " stoolball team";
            if ($this->player->GetPlayerRole() == Player::PLAYER) {
                $this->SetOpenGraphTitle($this->player->GetName() . ", " . $this->player->Team()->GetName() . " stoolball team");
            }
            if ($this->filter) {
                $this->filter = ", " . $this->filter;
                $title .= $this->filter;
            }
            $this->SetPageDescription($this->player_unfiltered->GetPlayerDescription());
        }
        $this->SetPageTitle($title);
        $this->SetOpenGraphType("athlete");
        $this->SetContentConstraint(StoolballPage::ConstrainColumns());
        $this->SetContentCssClass("playerStats");
        $this->LoadClientScript("/scripts/lib/jquery-ui-1.8.11.custom.min.js");
        $this->LoadClientScript("/play/statistics/statistics-filter.js");
        $this->LoadClientScript("/scripts/lib/chart.min.js");
        $this->LoadClientScript("/scripts/chart.js?v=2");
        $this->LoadClientScript("/scripts/lib/Chart.StackedBar.js");
        $this->LoadClientScript("/play/statistics/player-batting.js");
        ?>
<link rel="stylesheet" href="/css/custom-theme/jquery-ui-1.8.11.custom.css" media="screen" />
<!--[if lte IE 8]><script src="/scripts/lib/excanvas.compiled.js"></script><![endif]-->
		<?php 
    }
 function OnPrePageLoad()
 {
     $this->SetOpenGraphType("sport");
     $match_or_tournament = $this->match->GetMatchType() == MatchType::TOURNAMENT ? 'tournament' : 'match';
     $match_title = $this->match->GetTitle();
     if ($this->match->GetMatchType() == MatchType::TOURNAMENT_MATCH) {
         $match_title .= " in the " . $this->match->GetTournament()->GetTitle();
     }
     $this->SetPageTitle($match_title . ' - ' . $this->match->GetStartTimeFormatted() . ' - stoolball ' . $match_or_tournament);
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
     require_once "search/match-search-adapter.class.php";
     $adapter = new MatchSearchAdapter($this->match);
     $this->SetPageDescription($adapter->GetSearchDescription());
     $this->LoadClientScript("match.js", true);
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle($this->ground->GetNameAndTown());
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
     $this->LoadClientScript('/scripts/maps-3.js');
     $this->LoadClientScript('ground.js', true);
     $description = $this->ground->GetNameAndTown();
     $teams = $this->ground->Teams()->GetItems();
     $teams_count = count($teams);
     if ($teams_count) {
         $description .= " is home to ";
         for ($i = 0; $i < $teams_count; $i++) {
             $description .= $teams[$i]->GetName();
             if ($i < $teams_count - 2) {
                 $description .= ", ";
             }
             if ($i == $teams_count - 2) {
                 $description .= " and ";
             }
         }
         $description .= ".";
     } else {
         $description .= " is not currently home to any teams.";
     }
     $this->SetPageDescription($description);
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle(is_object($this->o_category) ? $this->o_category->GetName() . ': Edit category' : 'New category');
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
    function OnPrePageLoad()
    {
        $this->SetOpenGraphType("sports_team");
        $this->SetPageTitle($this->team->GetName() . ' stoolball team');
        require_once "search/team-search-adapter.class.php";
        $adapter = new TeamSearchAdapter($this->team);
        $this->SetPageDescription($adapter->GetSearchDescription());
        $this->SetContentConstraint(StoolballPage::ConstrainColumns());
        if (!$this->is_one_time_team) {
            $this->LoadClientScript("/scripts/lib/chart.min.js");
            $this->LoadClientScript("/scripts/chart.js?v=2");
            $this->LoadClientScript("team.js", true);
            ?>
<!--[if lte IE 8]><script src="/scripts/lib/excanvas.compiled.js"></script><![endif]--><?php 
        }
    }
    /**
     * Fires immediately after the body element is opened
     *
     */
    protected function OnBodyOpened()
    {
        $mobile_logo = '<img src="' . $this->resource_root . '/images/logos/138x40-trans.png" width="138" height="40" alt="Go to the Stoolball England home page" class="small screen logo-small" />
                        <img src="' . $this->resource_root . '/images/logos/210x61-trans.png" width="210" height="61" alt="Go to the Stoolball England home page" class="print logo" />';
        if (SiteContext::IsWordPress() and is_home()) {
            echo $mobile_logo;
        } else {
            echo '<a href="/">' . $mobile_logo . '</a>';
        }
        ?>
<form id="handle" action="/search/" method="get" class="large"><div><input id="search" type="search" name="q" value="<?php 
        if (isset($_GET['q'])) {
            echo htmlentities($_GET['q'], ENT_QUOTES, "UTF-8", false);
        }
        ?>
" />
	<input type="submit" value="Search" id="go" /></div>
</form>
<div id="bat1"></div>
		<?php 
        if ($this->GetContentCssClass()) {
            echo '<div id="board" class="' . $this->GetContentCssClass() . '">';
        } else {
            echo '<div id="board">';
        }
        ?>
<div id="boardLeft">
	<div id="boardRight">
		<?php 
        # build navbar and add to control tree
        $o_current = $this->GetContext()->GetByHierarchyLevel(2);
        $b_got_category = is_object($o_current);
        $b_section_home = ($this->GetContext()->GetDepth() == 2 and str_replace("/", "", $_SERVER['REQUEST_URI']) == $o_current->GetUrl());
        $o_news = new XhtmlElement('a', 'News');
        $o_rules = new XhtmlElement('a', 'Rules');
        $o_play = new XhtmlElement('a', 'Play!');
        $schools = new XhtmlElement('a', 'Schools');
        $o_about = new XhtmlElement('a', 'About <span class="large"> Us</span>');
        $search = new XhtmlElement('a', 'Search');
        if ($b_got_category and $o_current->GetUrl() == 'news' or SiteContext::IsWordPress() and (is_single() or is_archive() and !is_category())) {
            if (!$b_section_home) {
                $o_news->AddAttribute('href', '/news');
                $o_news->AddAttribute('role', 'menuitem');
                $o_news->SetCssClass('current');
            } else {
                $o_news->SetElementName('em');
            }
        } else {
            $o_news->AddAttribute('href', '/news');
        }
        if ($b_got_category and $o_current->GetUrl() == 'rules') {
            if (!$b_section_home) {
                $o_rules->AddAttribute('href', '/rules');
                $o_rules->AddAttribute('role', 'menuitem');
                $o_rules->SetCssClass('current');
            } else {
                $o_rules->SetElementName('em');
            }
        } else {
            $o_rules->AddAttribute('href', '/rules');
        }
        if ($b_got_category and $o_current->GetUrl() == 'play') {
            if (!$b_section_home) {
                $o_play->AddAttribute('href', '/play');
                $o_play->AddAttribute('role', 'menuitem');
                $o_play->SetCssClass('current');
            } else {
                $o_play->SetElementName('em');
            }
        } else {
            $o_play->AddAttribute('href', '/play');
        }
        if ($b_got_category and $o_current->GetUrl() == 'schools') {
            if (!$b_section_home) {
                $schools->AddAttribute('href', '/schools');
                $schools->AddAttribute('role', 'menuitem');
                $schools->SetCssClass('current');
            } else {
                $schools->SetElementName('em');
            }
        } else {
            $schools->AddAttribute('href', '/schools');
        }
        if ($b_got_category and $o_current->GetUrl() == 'about') {
            if (!$b_section_home) {
                $o_about->AddAttribute('href', '/about');
                $o_about->AddAttribute('role', 'menuitem');
                $o_about->SetCssClass('current');
            } else {
                $o_about->SetElementName('em');
            }
        } else {
            $o_about->AddAttribute('href', '/about');
        }
        if ($b_got_category and $o_current->GetUrl() == 'search') {
            if (!$b_section_home) {
                $search->AddAttribute('href', '/search');
                $search->AddAttribute('role', 'menuitem');
                $search->SetCssClass('current');
            } else {
                $search->SetElementName('em');
            }
        } else {
            $search->AddAttribute('href', '/search');
        }
        ?>
        <nav>
        <ul class="menu screen" role="menubar">
        <?php 
        echo '';
        echo '<li id="news">' . $o_news . '</li>';
        echo '<li id="rules">' . $o_rules . '</li>';
        echo '<li id="play">' . $o_play . '</li>';
        echo '<li id="schools">' . $schools . '</li>';
        echo '<li id="about">' . $o_about . '</li>';
        echo '<li class="search small">' . $search . '</li>';
        echo '';
        ?>
		</ul>
        </nav>
	   <div id="bat2" class="large">
			<div id="involved"></div>
			<ul>
				<li><a href="/rules/what-is-stoolball">What is stoolball?</a></li>
				<li><a href="/rules">Learn the rules</a></li>
				<li><a href="/teams/map">Map of teams</a></li>
			</ul>
		</div>

		<div id="content" class="content">
		<?php 
        # add content
        if ($this->i_constraint_type != StoolballPage::ConstrainNone()) {
            switch ($this->i_constraint_type) {
                case StoolballPage::ConstrainText():
                    echo '<div id="constraint" class="constrainText">';
                    break;
                case StoolballPage::ConstrainColumns():
                case StoolballPage::ConstrainBox():
                    echo '<div id="constraint" class="constrainColumns">';
                    break;
            }
        }
        if ($this->i_constraint_type == StoolballPage::ConstrainColumns()) {
            echo '<div class="supportedContentContainer"><div class="supportedContent">';
            $this->b_col1_open = true;
        }
        $this->Render();
    }
 function OnPrePageLoad()
 {
     # set page title
     if ($this->match instanceof Match) {
         $this->SetPageTitle('Delete ' . $this->match_or_tournament . ': ' . $this->match->GetTitle());
         $this->SetContentConstraint(StoolballPage::ConstrainColumns());
     } else {
         $this->SetPageTitle(ucfirst($this->match_or_tournament) . ' already deleted');
     }
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle(wp_title('', false) . ' &#8211; ' . get_bloginfo('name', 'display'));
     $this->SetPageDescription(get_post_meta(get_the_ID(), "Description", true));
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle('Stoolball categories');
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle('Delete club: ' . $this->data_object->GetName());
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
 function OnPrePageLoad()
 {
     # set up page
     $this->SetPageTitle("Stoolball statistics for all teams");
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle("Sign out");
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle($this->club->GetName());
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }