Exemplo n.º 1
0
 /**
  * List files
  *
  */
 public function indexAction()
 {
     $basePath = $this->_getParam('path', '/');
     // The target of a picker action. If set, we need to show the picker
     $this->view->picker = $this->_getParam('picker');
     // Get all top level files
     $files = $this->fileService->listDirectory($basePath);
     $this->view->files = $files;
     if ($basePath == '/') {
         $this->view->base = '';
     } else {
         $this->view->base = trim($basePath, '/') . '/';
     }
     $this->renderView('filemanager/list.php');
 }
Exemplo n.º 2
0
 /**
  * Get all the files for a given expense
  * @return ArrayObject
  */
 public function getExpenseFiles(Expense $expense)
 {
     $client = $this->clientService->getClient($expense->clientid);
     if (!$client) {
         // throw new Exception("Invalid expense for attaching files to");
         return array();
     }
     $path = 'Expenses/' . $expense->id;
     $files = $this->fileService->listDirectory($path);
     return $files;
 }