/** * Validate the form * * @return void */ private function validateForm() { // is the form submitted? if ($this->frm->isSubmitted()) { // cleanup the submitted fields, ignore fields that were added by hackers $this->frm->cleanupFields(); // validate fields $this->frm->getField('title')->isFilled(BL::err('TitleIsRequired')); $this->meta->validate(); // no errors? if ($this->frm->isCorrect()) { // build item $item['id'] = $this->id; $item['meta_id'] = $this->meta->save(true); $item['title'] = $this->frm->getField('title')->getValue(); $item['language'] = BL::getWorkingLanguage(); // update the item BackendSlideshowModel::updateCategory($item); // trigger event BackendModel::triggerEvent($this->getModule(), 'after_edite_category', array('item' => $item)); // everything is saved, so redirect to the overview $this->redirect(BackendModel::createURLForAction('Categories') . '&report=edited-category&var=' . urlencode($item['title']) . '&highlight=' . $item['id']); } } }