function OnPostback() { # get object $this->o_club = $this->o_edit->GetDataObject(); # save data if valid if ($this->IsValid()) { $i_id = $this->o_club_manager->Save($this->o_club); $this->o_club->SetId($i_id); $this->Redirect($this->o_club->GetNavigateUrl()); } }
function OnPostback() { $this->school = $this->edit->GetDataObject(); # save data if valid if ($this->IsValid()) { require_once "stoolball/clubs/club-manager.class.php"; $club_manager = new ClubManager($this->GetSettings(), $this->GetDataConnection()); $id = $club_manager->Save($this->school); $this->school->SetId($id); $this->Redirect($this->school->GetNavigateUrl() . "/edit"); } }
function OnPageLoad() { echo new XhtmlElement('h1', Html::Encode('Delete club: ' . $this->data_object->GetName())); if ($this->deleted) { ?> <p>The club has been deleted.</p> <p><a href="/play/clubs/">View all clubs</a></p> <?php } else { if ($this->has_permission) { ?> <p>Deleting a club cannot be undone.</p> <p>Are you sure you want to delete this club?</p> <form action="<?php echo Html::Encode($this->data_object->GetDeleteClubUrl()); ?> " method="post" class="deleteButtons"> <div> <input type="submit" value="Delete club" name="delete" /> <input type="submit" value="Cancel" name="cancel" /> </div> </form> <?php $this->AddSeparator(); require_once 'stoolball/user-edit-panel.class.php'; $panel = new UserEditPanel($this->GetSettings(), 'this club'); $panel->AddLink('view this club', $this->data_object->GetNavigateUrl()); $panel->AddLink('edit this club', $this->data_object->GetEditClubUrl()); echo $panel; } else { ?> <p>Sorry, you're not allowed to delete this club.</p> <p><a href="<?php echo Html::Encode($this->data_object->GetNavigateUrl()); ?> ">Go back to the club</a></p> <?php } } }