public function OnPrePageLoad()
 {
     $this->SetPageTitle('Add a school');
     $this->SetContentConstraint(StoolballPage::ConstrainText());
     $this->LoadClientScript("/schools.json");
     $this->LoadClientScript("/play/schools/add-school.js");
 }
 public function OnPrePageLoad()
 {
     $this->SetPageTitle('Edit ' . $this->school->GetName());
     $this->SetContentConstraint(StoolballPage::ConstrainText());
     $this->LoadClientScript('/scripts/maps-3.js');
     $this->LoadClientScript("/play/schools/edit-school.js");
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle('Delete category: ' . $this->data_object->GetName());
     $this->SetContentConstraint(StoolballPage::ConstrainText());
 }
 public function OnPrePageLoad()
 {
     $this->SetPageTitle('Reset password - ' . $this->GetSettings()->GetSiteName());
     $this->SetContentConstraint(StoolballPage::ConstrainText());
 }
 function OnPrePageLoad()
 {
     /* @var $match Match */
     # set page title
     if ($this->tournament instanceof Match) {
         $action = "Edit ";
         $this->SetPageTitle($action . $this->tournament->GetTitle() . ', ' . Date::BritishDate($this->tournament->GetStartTime()));
     } else {
         $this->SetPageTitle('Page not found');
     }
     $this->SetContentCssClass('matchEdit');
     $this->SetContentConstraint(StoolballPage::ConstrainText());
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle(is_object($this->team) ? $this->team->GetName() . ': Edit stoolball team' : 'New stoolball team');
     $this->SetContentConstraint(StoolballPage::ConstrainText());
     $this->LoadClientScript("/scripts/tiny_mce/jquery.tinymce.js");
     $this->LoadClientScript("/scripts/tinymce.js");
     $this->LoadClientScript("edit-team.js", true);
 }
    public function OnPrePageLoad()
    {
        /* @var $match Match */
        $this->SetContentConstraint(StoolballPage::ConstrainText());
        if ($this->page_not_found) {
            $this->SetPageTitle('Page not found');
            return;
            # Don't load any JS
        }
        # Set page title
        $edit_or_update = ($this->b_user_is_match_admin or $this->b_user_is_match_owner) ? "Edit" : "Update";
        $this->SetPageTitle("{$edit_or_update} " . $this->match->GetTitle() . ', ' . Date::BritishDate($this->match->GetStartTime()) . ", step 4 of 4");
        # Load JavaScript
        $this->LoadClientScript("/scripts/tiny_mce/jquery.tinymce.js");
        $this->LoadClientScript("/scripts/tinymce.js");
        $autocomplete_team_ids = array();
        if ($this->match->GetHomeTeamId()) {
            $autocomplete_team_ids[] = $this->match->GetHomeTeamId();
        }
        if ($this->match->GetAwayTeamId()) {
            $autocomplete_team_ids[] = $this->match->GetAwayTeamId();
        }
        if (count($autocomplete_team_ids)) {
            $this->LoadClientScript("/scripts/lib/jquery-ui-1.8.11.custom.min.js");
            $this->LoadClientScript("/play/playersuggest.js.php?v=2&team=" . implode(",", $autocomplete_team_ids));
            // . "&time=" . time());
            ?>
<link rel="stylesheet" type="text/css" href="/css/custom-theme/jquery-ui-1.8.11.custom.css" media="all" />
			<?php 
        }
        $this->LoadClientScript('highlights.js', true);
    }
 function OnPrePageLoad()
 {
     $this->SetPageTitle('Register with ' . $this->GetSettings()->GetSiteName());
     $this->SetContentConstraint(StoolballPage::ConstrainText());
 }
 public function OnPrePageLoad()
 {
     /* @var $match Match */
     $this->SetContentConstraint(StoolballPage::ConstrainText());
     if ($this->page_not_found) {
         $this->SetPageTitle('Page not found');
         return;
         # Don't load any JS
     }
     # Set page title
     $edit_or_update = ($this->b_user_is_match_admin or $this->b_user_is_match_owner) ? "Edit" : "Update";
     if ($this->match->GetStartTime() > gmdate('U') and !$this->b_user_is_match_admin and !$this->b_user_is_match_owner) {
         $step = "";
         # definitely only this step because match in future and can't change date
     } else {
         $step = ", step 1 of 4";
     }
     $this->SetPageTitle("{$edit_or_update} " . $this->match->GetTitle() . ', ' . Date::BritishDate($this->match->GetStartTime()) . $step);
     # Load JavaScript
     if ($this->b_user_is_match_admin or $this->b_user_is_match_owner) {
         $this->LoadClientScript('/scripts/match-fixture-edit-control-5.js');
     }
     if ($this->b_user_is_match_admin) {
         $this->LoadClientScript('matchedit-admin-3.js', true);
     }
     $this->LoadClientScript('matchedit.js', true);
 }
 function OnPrePageLoad()
 {
     /* @var $match Match */
     # set page title
     if ($this->tournament instanceof Match) {
         $this->SetPageTitle('Edit ' . $this->tournament->GetTitle() . ', ' . Date::BritishDate($this->tournament->GetStartTime()));
     } else {
         $this->SetPageTitle('Page not found');
     }
     $this->SetContentCssClass('matchEdit');
     $this->SetContentConstraint(StoolballPage::ConstrainText());
     $this->LoadClientScript('/scripts/tournament-edit-control-3.js');
 }
 function OnPrePageLoad()
 {
     if ($this->team instanceof Team) {
         $this->SetPageTitle('New tournament for ' . $this->team->GetName());
     } else {
         $this->SetPageTitle('New stoolball tournament');
     }
     $this->SetContentCssClass('matchEdit');
     $this->SetContentConstraint(StoolballPage::ConstrainText());
     $this->LoadClientScript('/scripts/tournament-edit-control-3.js');
 }
    /**
     * 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();
    }
 public function OnPrePageLoad()
 {
     # Different page title for add and edit
     if ($this->player->GetId() and !$this->add_player_already_exists) {
         $this->SetPageTitle("Rename " . $this->player->GetName());
     } else {
         $this->SetPageTitle("Add player for " . $this->player->Team()->GetName());
     }
     $this->SetContentConstraint(StoolballPage::ConstrainText());
     $this->LoadClientScript("playeredit.js", true);
 }
 function OnPrePageLoad()
 {
     /* @var $match Match */
     # set page title
     if ($this->tournament instanceof Match) {
         $action = $this->adding ? "Add " : "Edit ";
         $this->SetPageTitle($action . $this->tournament->GetTitle() . ', ' . Date::BritishDate($this->tournament->GetStartTime()));
     } else {
         $this->SetPageTitle('Page not found');
     }
     $this->SetContentCssClass('matchEdit');
     $this->SetContentConstraint(StoolballPage::ConstrainText());
     $except = array();
     if ($this->tournament instanceof Match) {
         foreach ($this->tournament->GetAwayTeams() as $team) {
             $except[] = $team->GetId();
         }
     }
     $this->LoadClientScript("/scripts/lib/jquery-ui-1.8.11.custom.min.js");
     $this->LoadClientScript("/play/teams/suggest-teams.js.php?except=" . trim(implode(",", $except), ","));
     ?>
     <link rel="stylesheet" type="text/css" href="/css/custom-theme/jquery-ui-1.8.11.custom.css" media="all" />
     <?php 
 }
 function OnPrePageLoad()
 {
     if (isset($this->i_season_id)) {
         $this->SetPageTitle('New ' . MatchType::Text($this->i_match_type) . ' in ' . $this->season->GetCompetitionName());
     } else {
         if ($this->team instanceof Team) {
             $this->SetPageTitle('New ' . MatchType::Text($this->i_match_type) . ' for ' . $this->team->GetName());
         }
     }
     $this->SetContentConstraint(StoolballPage::ConstrainText());
     $this->SetContentCssClass('matchEdit');
     $this->LoadClientScript('/scripts/match-fixture-edit-control-5.js');
 }