function OnPageLoad() { if (!$this->tournament instanceof Match or !$this->b_is_tournament) { http_response_code(404); require_once $_SERVER['DOCUMENT_ROOT'] . "/wp-content/themes/stoolball/section-404.php"; return; } echo new XhtmlElement('h1', htmlentities($this->GetPageTitle(), ENT_QUOTES, "UTF-8", false)); # check permission if (!$this->b_user_is_match_admin and !$this->b_user_is_match_owner) { ?> <p>Sorry, you can't edit a tournament unless you added it.</p> <p><a href="<?php echo htmlentities($this->tournament->GetNavigateUrl(), ENT_QUOTES, "UTF-8", false); ?> ">Go back to tournament</a></p> <?php return; } # OK to edit the match $o_match = is_object($this->tournament) ? $this->tournament : new Match($this->GetSettings()); $this->editor->SetDataObject($o_match); echo $this->editor; echo '<p class="facebook-tournaments">You can also list your tournament on the <a href="https://www.facebook.com/groups/1451559361817258/">Sussex Stoolball tournaments Facebook group</a>.</p>'; parent::OnPageLoad(); }
function OnPageLoad() { if (!$this->tournament instanceof Match or !$this->b_is_tournament) { http_response_code(404); require_once $_SERVER['DOCUMENT_ROOT'] . "/wp-content/themes/stoolball/section-404.php"; return; } echo new XhtmlElement('h1', Html::Encode($this->GetPageTitle())); # check permission if (!$this->b_user_is_match_admin and !$this->b_user_is_match_owner) { ?> <p>Sorry, you can't edit a tournament unless you added it.</p> <p><a href="<?php echo Html::Encode($this->tournament->GetNavigateUrl()); ?> ">Go back to tournament</a></p> <?php return; } # OK to edit the match $o_match = is_object($this->tournament) ? $this->tournament : new Match($this->GetSettings()); $this->editor->SetDataObject($o_match); echo $this->editor; parent::OnPageLoad(); }