public function previewUploadFormSubmitted(AppForm $form) { if (!$this->presenter->editAllowed()) { return; } if ($form->values['file']->isOK()) { FilesModel::uploadPreview($form->values); } if ($this->getParam('ajax_upload')) { //@see uploadFormSubmitted Debugger::$bar = FALSE; $this->presenter->sendResponse(new TextResponse("{error: '',msg: 'ok'}", 'text/html')); exit; } else { $this->redirect("editFile!#toc-files", $form->values['id']); } }