/** * List files from a project * */ public function filelistAction() { $project = $this->byId($this->_getParam('projectid'), 'Project'); $client = $this->byId($project->clientid, 'Client'); $folder = $this->_getParam('folder', ''); $path = 'Clients/' . $client->title . '/Projects/' . $project->title; $projectPath = $path; $parent = ''; if ($folder != null && mb_strlen($folder)) { $path = base64_decode($folder); $parent = dirname($path); if ($path == $projectPath) { $parent = ''; } } $content = $this->cacheService->get($path); if (!$content) { $files = array(); try { $files = $this->fileService->listDirectory($path); } catch (Exception $e) { $this->log->err("Failed loading files from {$path}"); } $this->view->files = $files; $this->view->project = $project; if ($path == '/') { $this->view->base = ''; } else { $this->view->base = trim($path, '/') . '/'; } $this->view->parentPath = $parent; $content = $this->view->render('project/file-list.php'); $this->cacheService->store($path, $content); } $this->getResponse()->appendBody($content); }
/** * View the thumbnail for a given image */ public function viewthumbnailAction() { $file = $this->fileService->getFile($this->_getParam('id')); $this->fileService->streamTumbnailFile($file); }