/** * Initializes the confirm element * @return boolean Returns true if redirect happens */ protected function Init() { $this->confirm = ContentRegisterConfirm::Schema()->ByContent($this->Content()); $this->confirmer = new Confirmer(); $this->isValid = $this->confirmer->Check(Request::GetArray()); if ($this->isValid) { $this->OnSuccess(); } else { if ($this->confirm->GetErrorUrl()) { Response::Redirect(FrontendRouter::Url($this->confirm->GetErrorUrl())); return true; } } return parent::Init(); }
/** * Sets the confirm properties as given in the form * @return ContentRegisterConfirm */ protected function SaveElement() { $this->confirm->SetErrorUrl($this->selectorError->Save($this->confirm->GetErrorUrl())); $this->confirm->SetSuccessUrl($this->selectorSuccess->Save($this->confirm->GetSuccessUrl())); $this->confirm->SetActivate((bool) $this->Value('Activate')); return $this->confirm; }