public function saveClicked(SubmitButton $button) { $array = $button->getForm()->getValues(); $array = $this->convertNumberToClass($array); $array['authorUrl'] = Model::createAuthorUri($array['name'], $array['surname'], $array['class'], $array['authorId']); Model::save($array, 'authorId', 'authors'); $this->flashMessage('Změny pro autora:' . $array['name'] . " " . $array['surname'] . ' byly uloženy.'); $this->presenter->redirect(":Admin:Default:authors"); }
public function deleteClicked(SubmitButton $button) { $arr = $button->getForm()->getValues(); $files[] = $arr['file'][0]; $miniature = WWW_DIR . "/attachments/mini/" . basename($files[0]); if (is_file($miniature)) { $files[] = $miniature; } $this->fileModel->deleteFiles($files); $this->arr = $files; }
public function saveClicked(SubmitButton $button) { $array = $button->getForm()->getValues(); if ($array['id'] != '') { Model::save($array, 'id', 'options'); } else { $array['name'] = 'home'; Model::add($array, 'options'); } $this->flashMessage('Text uložen.', 'info'); $this->presenter->redirect("this"); }
public function saveClicked(SubmitButton $button) { $array = $button->getForm()->getValues(); unset($array['authorId']); try { $array['url'] = Model::createUri($array['title'], $array['author'], $array['workId']); } catch (Exception $e) { $this->flashMessage('U tohoto autora byla již vložena práce se stejným jménem', 'error'); return; } $array = $this->fixValues($array); Model::save($array, 'workId', 'works'); $this->flashMessage('Práce uložena.', 'info'); $this->presenter->redirect(":Admin:Default:works"); }
/** * Handler which is called when form is submmited by button of this control * @param SubmitButton $button */ public function submitButtonHandler($button) { $form = $button->getForm(); foreach ($this->onSubmit as $onSubmitItem) { list($callback, $params) = $onSubmitItem; $callback->invokeArgs($params); } if ($this->hasAnyParentEmptyValue()) { return; } if (self::$disableChilds) { $this->addEmptyHeaderItem(); $this->disableAllChilds(); } else { $this->setFirstItemSelected(); $this->selectFirstItemForAllChilds(); } }