private function validateForm()
{
if ($this->frm->isSubmitted()) {
$this->frm->cleanupFields();
if ($this->frm->isCorrect()) {
// set the base values
$width = (int) $this->frm->getField('width_widget')->getValue();
$height = (int) $this->frm->getField('height_widget')->getValue();
if ($width > 800) {
$width = 800;
} elseif ($width < 300) {
$width = $this->get('fork.settings')->get('Location', 'width_widget');
}
if ($height < 150) {
$height = $this->get('fork.settings')->get('Location', 'height_widget');
}
// set our settings (widgets)
$this->get('fork.settings')->set($this->URL->getModule(), 'zoom_level_widget', (string) $this->frm->getField('zoom_level_widget')->getValue());
$this->get('fork.settings')->set($this->URL->getModule(), 'width_widget', $width);
$this->get('fork.settings')->set($this->URL->getModule(), 'height_widget', $height);
$this->get('fork.settings')->set($this->URL->getModule(), 'map_type_widget', (string) $this->frm->getField('map_type_widget')->getValue());
// trigger event
BackendModel::triggerEvent($this->getModule(), 'after_saved_settings');
// redirect to the settings page
$this->redirect(BackendModel::createURLForAction('Settings') . '&report=saved');
}
}
}