Ejemplo n.º 1
0
 /**
  * @return ViewModel
  */
 public function listAction()
 {
     $this->createDirForm->build();
     $this->uploadFileForm->build();
     $this->deleteFileForm->build();
     $viewData = ['list' => $this->getFileManager()->getList(), 'currentDir' => $this->getCurrentPath(), 'createForm' => $this->createDirForm, 'uploadForm' => $this->uploadFileForm, 'deleteForm' => $this->deleteFileForm];
     $this->layout('layout/filemanager.phtml');
     return new ViewModel($viewData);
 }
Ejemplo n.º 2
0
 /**
  * @return \Zend\Http\Response
  */
 public function deleteAction()
 {
     $this->deleteFileForm->build();
     if ($this->handleDeletePost($this->deleteFileForm)) {
         $this->flashMessenger()->addSuccessMessage($this->userText->getMessage(EntityName::FILE, Message::DELETE_SUCCESS));
     } else {
         $this->flashMessenger()->addErrorMessage($this->userText->getMessage(EntityName::FILE, Message::DELETE_FAILURE));
     }
     return $this->redirect()->toRoute('filemanager/list', ['dir' => $this->getCurrentPath()]);
 }
Ejemplo n.º 3
0
 /**
  * @covers DmFileman\Form\DeleteFileForm
  */
 public function testBuild()
 {
     $this->sut->build();
     $this->assertInstanceOf('Zend\\Form\\Element\\Text', $this->sut->get(Form::NAME));
     $this->assertInstanceOf('Zend\\Form\\Element\\Csrf', $this->sut->get(Form::SECURITY));
 }