Example #1
0
 public function getConnector(Request $request)
 {
     $own_directory = $this->makeDirectory();
     $uploadAllow = ['image/jpeg', 'image/png', 'image/gif', 'image/vnd.adobe.photoshop', 'application/pdf', 'application/x-shockwave-flash', 'video/x-flv', 'video/h264', 'video/webm', 'audio/aac', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/webm', 'image/vnd.djvu', 'application/vnd.oasis.opendocument.chart', 'application/vnd.oasis.opendocument.formula', 'application/vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.image', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.text', 'application/epub+zip', 'application/vnd.ms-htmlhelp', 'application/x-mobipocket-ebook', 'application/onenote', 'application/vnd.ms-project', 'application/x-mspublisher', 'application/vnd.visio', 'application/x-mswrite', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'application/vnd.sun.xml.calc', 'application/vnd.sun.xml.draw', 'application/vnd.sun.xml.impress', 'application/vnd.sun.xml.math', 'text/plain', 'application/zip', 'application/x-rar-compressed'];
     $customType = $request->input('custom_type', '');
     $onlyMimes = $this->onlyMimes($customType);
     if (!empty($onlyMimes)) {
         $uploadAllow = $onlyMimes;
     }
     $connector = new Connector(new \elFinder(['roots' => [['driver' => 'LocalFileSystem', 'path' => public_path('files/' . $own_directory), 'alias' => 'Online drive: \\Home', 'URL' => asset('files/' . $own_directory . '/'), 'accessControl' => config('elfinder.access'), 'dateFormat' => DateTimeHelper::shortDateFormat(), 'timeFormat' => DateTimeHelper::shortTimeFormat(), 'uploadAllow' => $uploadAllow, 'uploadDeny' => ['all'], 'uploadOrder' => ['deny', 'allow']]]]));
     $connector->run();
     return $connector->getResponse();
 }
Example #2
0
 public function index(Request $request)
 {
     $this->theme->title(trans('pages.my_documents_title'));
     $this->theme->description(trans('pages.my_documents_desc'));
     return $this->_list(['dateFormat' => DateTimeHelper::shortDateFormat(), 'timeFormat' => DateTimeHelper::shortTimeFormat()]);
 }