/** * Initializes the login element * @return boolean Returns always true */ protected function Init() { $this->login = ContentLogin::Schema()->ByContent($this->Content()); $this->HandleLoggedIn(); $passwordUrl = $this->login->GetPasswordUrl(); $this->passwordUrl = $passwordUrl ? FrontendRouter::Url($passwordUrl) : ''; $this->AddNameField(); $this->AddPasswordField(); $this->AddUniqueSubmit('LoginSubmit'); $validator = new Access(self::Guard(), false, $this->ErrorPrefix('Access')); $this->Elements()->AddValidator($validator); return parent::Init(); }
/** * The element schema * @return ContentLoginSchema */ protected function ElementSchema() { return ContentLogin::Schema(); }