52 lines
1.4 KiB
PHP
52 lines
1.4 KiB
PHP
<?php
|
|
namespace App\Http\Controllers\Admin\FileManager;
|
|
|
|
use App\CMS\Repositories\FileManager\Directory as DirectoryRepository;
|
|
use App\Http\Controllers\Admin\Controller;
|
|
use App\Models\FileManager\Directory;
|
|
use Illuminate\Support\Facades\Input;
|
|
|
|
class UploadedFilesOverview extends Controller
|
|
{
|
|
/**
|
|
* @var DirectoryRepository
|
|
*/
|
|
private $directoryRepository;
|
|
|
|
/**
|
|
* UploadedFilesOverview constructor.
|
|
*
|
|
* @param DirectoryRepository $directoryRepository
|
|
*/
|
|
public function __construct(DirectoryRepository $directoryRepository)
|
|
{
|
|
$this->directoryRepository = $directoryRepository;
|
|
}
|
|
|
|
/**
|
|
* List of all files and directories
|
|
*
|
|
* @param Directory $directory
|
|
*
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
*/
|
|
public function index(Directory $directory)
|
|
{
|
|
// include hidden directories?
|
|
$subdirectories = $this->directoryRepository->getAllSubdirectories($directory);
|
|
|
|
if (!Input::get('hidden', false)) {
|
|
$subdirectories = $subdirectories->where('hidden', false);
|
|
}
|
|
|
|
$subdirectories = $subdirectories->get();
|
|
|
|
return view('admin.fileManager.overview', [
|
|
'directory' => $directory,
|
|
'subdirectories' => $subdirectories,
|
|
'newDirectory' => new Directory(),
|
|
'parentDirectory' => $directory
|
|
]);
|
|
}
|
|
}
|