get('lang'); // return $this->render('@FileManager/default/sidenav/file_manager.right.sidenav.html.twig', [ // 'lang' => $lang // ]); // } public function getFilesFromDirectory(ContainerInterface $container, Request $request) { // {{ render(controller('FileManagerBundle\\Controller\\FileManagerController::fileManagerRightSideNavView',{'lang': lang})) }} $callback_function = $request->get('callback_function'); $lang = $request->get('lang'); $directoryName = $request->get('directoryName'); // $systemBox = $container->get('net15.system.box.manager')->getByName('SystemBox'); $response['message'] = ''; $response['success'] = false; $response['directory'] = $container->get('net15.directory.manager')->getFolderByName($directoryName); // $response['directory'] = $container->get('net15.photos.box.manager')->getByName('PhotosBox'); return $this->render('@FileManager/default/files_upload/files.uploaded.html.twig', [ 'directory' => $response['directory'], 'message' => $response['message'], 'success' => $response['success'], 'callback_function' => $callback_function, 'lang' => $lang ]); } public function getFileItem(string $guid, ContainerInterface $container){ $fileItem = $container->get('net15.file.item.manager')->getByGUID($guid); $response = new Response(); // if($container->get('net15.file.item.manager')->canView($fileItem, $this->getUser())){ $filepath = $fileItem->getDownloadPath(); $filename = $fileItem->getName(); $disposition = $response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_INLINE, $filename); $response->headers->set('Content-Disposition', $disposition); $response->headers->set('Content-Type', $fileItem->getMime()); $response->setContent(file_get_contents($filepath)); // } return $response; } public function getFileThumbnail(string $guid, ContainerInterface $container){ $fileItem = $container->get('net15.file.item.manager')->getByGUID($guid); $response = new Response(); // if($container->get('net15.file.item.manager')->canView($fileItem, $this->getUser())){ $filepath = $fileItem->getThumbnail(); $filename = $fileItem->getName(); $disposition = $response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_INLINE, $filename); $response->headers->set('Content-Disposition', $disposition); $response->headers->set('Content-Type', $fileItem->getMime()); $response->setContent(file_get_contents($filepath)); // } return $response; } public function showPhoto(FileItem $fileItem,ContainerInterface $container, Request $request){ return $this->render('@FileManager/default/files_upload/show.photo.html.twig', ['image'=>$fileItem]); } }