/** * Generate filename. * * @param string $dir Directory. * @param string $ext File extension. * @return string */ protected function generateFilename($dir, $ext) { if ($dir[0] == '/') { $dir = substr($dir, 1); } if ($dir[strlen($dir) - 1] != '/') { $dir .= '/'; } return $this->uploadsPath . $dir . FileRepository::generateFilename($this->uploadsPath . $dir, $ext); }
/** * Get file library. */ protected function fileLibrary() { $this->request->shiftPath(1); $this->fileLibrary = $this->document->componentManager->createComponent('filelibrary', 'Energine\\share\\components\\FileRepository', ['config' => 'core/modules/share/config/FileRepositorySelect.component.xml']); $this->fileLibrary->run(); }