private function validateForm()
{
if ($this->frm->isSubmitted()) {
if ($this->frm->getField('send_new_profile_admin_mail')->isChecked()) {
if ($this->frm->getField('overwrite_profile_notification_email')->isChecked()) {
$this->frm->getField('profile_notification_email')->isEmail(BL::msg('EmailIsRequired'));
}
}
if ($this->frm->isCorrect()) {
// set our settings
$this->get('fork.settings')->set($this->URL->getModule(), 'send_new_profile_admin_mail', (bool) $this->frm->getField('send_new_profile_admin_mail')->getValue());
$profileNotificationEmail = null;
if ($this->frm->getField('overwrite_profile_notification_email')->isChecked()) {
$profileNotificationEmail = $this->frm->getField('profile_notification_email')->getValue();
}
$this->get('fork.settings')->set($this->URL->getModule(), 'profile_notification_email', $profileNotificationEmail);
$this->get('fork.settings')->set($this->URL->getModule(), 'send_new_profile_mail', (bool) $this->frm->getField('send_new_profile_mail')->getValue());
// redirect to the settings page
$this->redirect(BackendModel::createURLForAction('Settings') . '&report=saved-settings');
}
}
}