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 OnSiteInit()
 {
     parent::OnSiteInit();
     # check parameters
     if (isset($_GET['team']) and is_numeric($_GET['team'])) {
         $this->i_team_id = (int) $_GET['team'];
     } else {
         if (isset($_POST['team']) and is_numeric($_POST['team'])) {
             $this->i_team_id = (int) $_POST['team'];
         } else {
             if (isset($_GET['season']) and is_numeric($_GET['season'])) {
                 $this->i_season_id = (int) $_GET['season'];
             } else {
                 if (isset($_POST['season']) and is_numeric($_POST['season'])) {
                     $this->i_season_id = (int) $_POST['season'];
                 } else {
                     if (isset($_GET['tournament']) and is_numeric($_GET['tournament'])) {
                         $this->tournament_id = (int) $_GET['tournament'];
                     } else {
                         if (isset($_POST['tournament']) and is_numeric($_POST['tournament'])) {
                             $this->tournament_id = (int) $_POST['tournament'];
                         } else {
                             $this->Redirect();
                         }
                     }
                 }
             }
         }
     }
 }
 function OnPageLoad()
 {
     echo new XhtmlElement('h1', $this->GetPageTitle());
     $this->editor->SetDataObject($this->user);
     echo $this->editor;
     parent::OnPageLoad();
 }
 public function OnPrePageLoad()
 {
     # set up page
     $this->SetPageTitle("Players for " . $this->team->GetName() . ' stoolball team');
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
     $this->SetContentCssClass("playersPage");
 }
 public function OnSiteInit()
 {
     # check parameter
     if (isset($_GET['match']) and is_numeric($_GET['match'])) {
         $this->i_match_id = (int) $_GET['match'];
         $this->s_matches = 'match';
     } else {
         if (isset($_GET['team']) and is_numeric($_GET['team'])) {
             $this->i_team_id = (int) $_GET['team'];
             $this->s_matches = 'matches';
         } else {
             if (isset($_GET['season']) and is_numeric($_GET['season'])) {
                 $this->i_season_id = (int) $_GET['season'];
                 $this->s_matches = 'matches';
             } else {
                 if (isset($_GET['tournaments']) and $_GET['tournaments']) {
                     $this->tournament_player_type = preg_replace('/[^a-z]/', "", $_GET['tournaments']);
                 } else {
                     header('Location: /play/');
                     exit;
                 }
             }
         }
     }
     parent::OnSiteInit();
 }
 public function OnPrePageLoad()
 {
     $this->SetPageTitle('Add a school');
     $this->SetContentConstraint(StoolballPage::ConstrainText());
     $this->LoadClientScript("/schools.json");
     $this->LoadClientScript("/play/schools/add-school.js");
 }
 function OnPrePageLoad()
 {
     /* @var $competition Competition */
     # set up page
     $this->SetPageTitle("Statistics for " . $this->competition->GetName() . ", All seasons");
     $this->SetContentConstraint(StoolballPage::ConstrainBox());
 }
 function OnPageInit()
 {
     parent::OnPageInit();
     $a_reasons = array($this->GetSettings()->GetWebEditorEmail() => "It's about this website", $this->GetSettings()->GetEnquiriesEmail() => "I have a question about stoolball or Stoolball England", $this->GetSettings()->GetSalesEmail() => "I want to buy something");
     $this->o_form = new ContactForm($this->GetSettings(), $a_reasons);
     $this->RegisterControlForValidation($this->o_form);
 }
 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 OnPageLoad()
 {
     echo new XhtmlElement('h1', Html::Encode($this->GetPageTitle()));
     # display the club
     $o_club = is_object($this->o_club) ? $this->o_club : new Club($this->GetSettings());
     $this->o_edit->SetDataObject($o_club);
     echo $this->o_edit;
     parent::OnPageLoad();
 }
 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 OnPageLoad()
 {
     echo new XhtmlElement('h1', $this->GetPageTitle());
     # display the ground
     $ground = is_object($this->ground) ? $this->ground : new Ground($this->GetSettings());
     $this->editor->SetDataObject($ground);
     echo $this->editor;
     parent::OnPageLoad();
 }
 function OnPageLoad()
 {
     echo new XhtmlElement('h1', Html::Encode($this->GetPageTitle()));
     # display the competition
     $o_competition = is_object($this->o_competition) ? $this->o_competition : new Competition($this->GetSettings());
     $this->o_edit->SetDataObject($o_competition);
     echo $this->o_edit;
     parent::OnPageLoad();
 }
 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());
 }
 function OnPrePageLoad()
 {
     $title = "Statistics at " . $this->ground->GetNameAndTown() . ' stoolball ground';
     if ($this->season) {
         $title .= " in the {$this->season} season";
     }
     $this->SetPageTitle($title);
     $this->SetContentConstraint(StoolballPage::ConstrainBox());
     $this->SetContentCssClass('stats');
 }
 function OnPageLoad()
 {
     echo new XhtmlElement('h1', Html::Encode($this->GetPageTitle()));
     if (!is_object($this->role)) {
         $this->role = new Role();
     }
     $this->editor->SetDataObject($this->role);
     echo $this->editor;
     parent::OnPageLoad();
 }
 function OnPrePageLoad()
 {
     $this->content = new XhtmlElement("div");
     $category = $this->DisplayCompetitions($this->content);
     if (!$category) {
         $category = "Stoolball ";
     }
     $this->SetPageTitle("{$category} leagues and competitions");
     $this->SetContentConstraint(StoolballPage::ConstrainBox());
 }
 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 up page
     $this->SetOpenGraphType("sports_league");
     $this->SetPageTitle("League table for the " . $this->season->GetCompetitionName());
     require_once "search/competition-search-adapter.class.php";
     $adapter = new CompetitionSearchAdapter($this->competition);
     $this->SetPageDescription($adapter->GetSearchDescription());
     $this->SetContentConstraint(StoolballPage::ConstrainBox());
     $this->SetContentCssClass("season-table");
 }
 function OnPageInit()
 {
     $this->SetHasGoogleMap(true);
     if (isset($_GET['competition']) and is_numeric($_GET['competition'])) {
         $this->competition_id = (int) $_GET['competition'];
     }
     if (isset($_GET['season']) and is_numeric($_GET['season'])) {
         $this->season_id = (int) $_GET['season'];
     }
     parent::OnPageInit();
 }
 function OnPrePageLoad()
 {
     if ($this->page_not_found) {
         $this->SetPageTitle('Page not found');
         return;
     }
     $title = "Statistics for the " . $this->tournament->GetTitle() . ", " . Date::BritishDate($this->tournament->GetStartTime());
     $this->SetPageTitle($title);
     $this->SetContentConstraint(StoolballPage::ConstrainBox());
     $this->SetContentCssClass('stats');
 }
    function OnCloseHead()
    {
        $this->rss_url = htmlentities("http://" . trim($_SERVER['HTTP_HOST'] . str_replace("/map", "", $_SERVER['REQUEST_URI']), "/") . ".rss", ENT_QUOTES, "UTF-8", false);
        ?>
<link rel="alternate" type="application/rss+xml" title="<?php 
        echo htmlentities($this->GetPageTitle(), ENT_QUOTES, "UTF-8", false);
        ?>
 RSS feed" href="<?php 
        echo $this->rss_url;
        ?>
" />
        <?php 
        parent::OnCloseHead();
    }
 function OnPageInit()
 {
     $this->o_review_item = new ReviewItem($this->GetSettings());
     $this->o_review_item->SetId($_GET['item']);
     $this->o_review_item->SetType($_GET['type']);
     if (isset($_GET['title'])) {
         $this->o_review_item->SetTitle($_GET['title']);
     }
     // data already sanitised in OnSiteInit
     if (isset($_GET['page'])) {
         $this->o_review_item->SetNavigateUrl($_GET['page']);
     } elseif (isset($_SERVER['HTTP_REFERER'])) {
         $this->o_review_item->SetNavigateUrl($_SERVER['HTTP_REFERER']);
     }
     parent::OnPageInit();
 }
    function OnPrePageLoad()
    {
        $title = "Team statistics for " . $this->team->GetNameAndType() . ' stoolball team';
        if ($this->season) {
            $title .= " in the {$this->season} season";
        }
        $this->SetPageTitle($title);
        $this->SetContentConstraint(StoolballPage::ConstrainBox());
        $this->SetContentCssClass('stats');
        $this->LoadClientScript("/scripts/lib/chart.min.js");
        $this->LoadClientScript("/scripts/chart.js?v=2");
        $this->LoadClientScript("/scripts/lib/Chart.StackedBar.js");
        $this->LoadClientScript("team.js", true);
        ?>
<!--[if lte IE 8]><script src="/scripts/lib/excanvas.compiled.js"></script><![endif]--><?php 
    }
    function OnCloseHead()
    {
        ?>
		<link rel="alternate" type="application/rss+xml" title="<?php 
        bloginfo('name');
        ?>
 RSS Feed" href="<?php 
        bloginfo('rss2_url');
        ?>
" />
		<link rel="pingback" href="<?php 
        bloginfo('pingback_url');
        ?>
" />
		<?php 
        parent::OnCloseHead();
    }
 function OnPrePageLoad()
 {
     if ($this->page_not_found) {
         $this->SetPageTitle('Page not found');
         return;
     }
     $title = "Statistics for " . $this->match->GetTitle() . ", " . Date::BritishDate($this->match->GetStartTime(), false);
     $this->SetPageTitle($title);
     $this->SetContentConstraint(StoolballPage::ConstrainBox());
     if ($this->has_statistics) {
         $this->LoadClientScript("/scripts/lib/chart.min.js");
         $this->LoadClientScript("/scripts/chart.js?v=2");
         $this->LoadClientScript("/play/statistics/match.js");
         ?>
         <!--[if lte IE 8]><script src="/scripts/lib/excanvas.compiled.js"></script><![endif]-->
         <?php 
     }
 }
 function OnPageInit()
 {
     parent::OnPageInit();
     $this->form = new EmailForm($this->GetSettings());
     $this->RegisterControlForValidation($this->form);
     $this->valid = isset($_GET['to']);
     if ($this->valid) {
         $protector = new EmailAddressProtector($this->GetSettings());
         $this->address = $protector->DecryptProtectedEmail($_GET['to']);
         $email = new EmailAddress($this->address);
         $this->valid = $email->IsValid();
     }
     if ($this->valid) {
         $this->address_display = HTML::Encode(substr($this->address, 0, strpos($this->address, "@"))) . "@&#8230; (protected address)";
     } else {
         header($_SERVER["SERVER_PROTOCOL"] . " 400 Bad Request");
     }
 }
 function OnPrePageLoad()
 {
     if ($this->player_type === null) {
         $title = 'Stoolball teams';
     }
     if ($this->player_type === PlayerType::LADIES) {
         $title = "Ladies' stoolball teams";
     }
     if ($this->player_type === PlayerType::MIXED) {
         $title = 'Mixed stoolball teams';
     }
     if ($this->player_type === PlayerType::JUNIOR_MIXED) {
         $title = "Junior stoolball teams";
     }
     if ($this->player_type === 0) {
         $title = 'Past stoolball teams';
     }
     if (is_array($this->teams) and count($this->teams)) {
         $title .= " in " . $this->teams[0]->GetGround()->GetAddress()->GetAdministrativeArea();
     }
     $this->SetPageTitle($title);
     $this->SetContentConstraint(StoolballPage::ConstrainBox());
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle("Sign out");
     $this->SetContentConstraint(StoolballPage::ConstrainColumns());
 }
 function OnPrePageLoad()
 {
     $this->SetPageTitle('Delete category: ' . $this->data_object->GetName());
     $this->SetContentConstraint(StoolballPage::ConstrainText());
 }