FIX: fix file manager
This commit is contained in:
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\CMS\Helpers;
|
||||||
|
|
||||||
|
use App\Models\FileManager\Directory;
|
||||||
|
use App\Models\FileManager\File;
|
||||||
|
|
||||||
|
class RootDirectory
|
||||||
|
{
|
||||||
|
protected static $directory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create root directory
|
||||||
|
*
|
||||||
|
* @return Directory
|
||||||
|
*/
|
||||||
|
protected static function create()
|
||||||
|
{
|
||||||
|
$directory = new Directory();
|
||||||
|
$directory->name = 'Root';
|
||||||
|
$directory->is_root = true;
|
||||||
|
$directory->save();
|
||||||
|
|
||||||
|
Directory::whereNull('parent_id')
|
||||||
|
->where('is_root', false)
|
||||||
|
->update(['parent_id' => $directory->id]);
|
||||||
|
|
||||||
|
File::where('directory_id', null)
|
||||||
|
->update(['directory_id' => $directory->id]);
|
||||||
|
|
||||||
|
return $directory;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get root directory
|
||||||
|
*
|
||||||
|
* @return Directory
|
||||||
|
*/
|
||||||
|
public static function get()
|
||||||
|
{
|
||||||
|
self::$directory = Directory::where('is_root', true)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (is_null(self::$directory)) {
|
||||||
|
self::$directory = self::create();
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::$directory;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\CMS\Repositories\FileManager;
|
namespace App\CMS\Repositories\FileManager;
|
||||||
|
|
||||||
|
use App\CMS\Helpers\RootDirectory;
|
||||||
use App\Models\FileManager\Directory as DirectoryModel;
|
use App\Models\FileManager\Directory as DirectoryModel;
|
||||||
|
use App\Models\FileManager\File;
|
||||||
|
|
||||||
class Directory
|
class Directory
|
||||||
{
|
{
|
||||||
@@ -11,4 +13,25 @@ class Directory
|
|||||||
->where('parent_id', $directoryId)
|
->where('parent_id', $directoryId)
|
||||||
->exists();
|
->exists();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param DirectoryModel $directory
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
|
public function getAllSubdirectories(DirectoryModel &$directory)
|
||||||
|
{
|
||||||
|
if (!$directory->exists) {
|
||||||
|
$directory = DirectoryModel::where('is_root', true)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (is_null($directory)) {
|
||||||
|
$directory = RootDirectory::get();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$subdirectories = $directory->allSubdirectories();
|
||||||
|
|
||||||
|
return $subdirectories;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Admin\FileManager;
|
namespace App\Http\Controllers\Admin\FileManager;
|
||||||
|
|
||||||
use App\Events\EditFile;
|
|
||||||
use App\CMS\Helpers\FileManager;
|
use App\CMS\Helpers\FileManager;
|
||||||
|
use App\CMS\Helpers\RootDirectory;
|
||||||
|
use App\Events\EditFile;
|
||||||
use App\Http\Controllers\Admin\Controller;
|
use App\Http\Controllers\Admin\Controller;
|
||||||
use App\Http\Requests\EditUploadedFileRequest;
|
use App\Http\Requests\EditUploadedFileRequest;
|
||||||
use App\Models\FileManager\File;
|
use App\Models\FileManager\File;
|
||||||
use Illuminate\Support\Facades\Event;
|
use Illuminate\Support\Facades\Event;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
||||||
|
|
||||||
class EditUploadedFile extends Controller
|
class EditUploadedFile extends Controller
|
||||||
{
|
{
|
||||||
@@ -17,14 +17,18 @@ class EditUploadedFile extends Controller
|
|||||||
*
|
*
|
||||||
* Render edit form for displaying details and updating given file
|
* Render edit form for displaying details and updating given file
|
||||||
*
|
*
|
||||||
* @param int $id file id
|
* @param File $file
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||||
|
* @internal param int $id file id
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public function show(File $file)
|
public function show(File $file)
|
||||||
{
|
{
|
||||||
|
$root = RootDirectory::get();
|
||||||
return view('admin.fileManager.edit', [
|
return view('admin.fileManager.edit', [
|
||||||
'file' => $file,
|
'file' => $file,
|
||||||
|
'root' => $root,
|
||||||
'extraInfo' => FileManager::getAdditionalInfo($file)
|
'extraInfo' => FileManager::getAdditionalInfo($file)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -48,6 +52,7 @@ class EditUploadedFile extends Controller
|
|||||||
$file->name = $request->name;
|
$file->name = $request->name;
|
||||||
$file->keywords = $request->keywords;
|
$file->keywords = $request->keywords;
|
||||||
$file->description = $request->description;
|
$file->description = $request->description;
|
||||||
|
$file->directory_id = $request->directory_id;
|
||||||
$file->save();
|
$file->save();
|
||||||
|
|
||||||
// fire action
|
// fire action
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class UploadFile extends Controller
|
|||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||||
*/
|
*/
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\Http\Controllers\Admin\FileManager;
|
namespace App\Http\Controllers\Admin\FileManager;
|
||||||
|
|
||||||
|
use App\CMS\Repositories\FileManager\Directory as DirectoryRepository;
|
||||||
use App\Http\Controllers\Admin\Controller;
|
use App\Http\Controllers\Admin\Controller;
|
||||||
use App\Models\FileManager\Directory;
|
use App\Models\FileManager\Directory;
|
||||||
use Illuminate\Support\Facades\Input;
|
use Illuminate\Support\Facades\Input;
|
||||||
|
|
||||||
class UploadedFilesOverview extends Controller
|
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
|
* List of all files and directories
|
||||||
*
|
*
|
||||||
@@ -19,13 +35,9 @@ class UploadedFilesOverview extends Controller
|
|||||||
// include hidden directories?
|
// include hidden directories?
|
||||||
$includeHidden = Input::get('hidden');
|
$includeHidden = Input::get('hidden');
|
||||||
|
|
||||||
if (!$directory->exists) {
|
$subdirectories = $this->directoryRepository->getAllSubdirectories($directory);
|
||||||
$subdirectories = Directory::whereNull('parent_id');
|
|
||||||
} else {
|
|
||||||
$subdirectories = $directory->allSubdirectories();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($includeHidden === false) {
|
if (!$includeHidden) {
|
||||||
$subdirectories = $subdirectories->where('hidden', false);
|
$subdirectories = $subdirectories->where('hidden', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Models\FileManager;
|
namespace App\Models\FileManager;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Psy\Exception\ErrorException;
|
||||||
|
|
||||||
class Directory extends Model
|
class Directory extends Model
|
||||||
{
|
{
|
||||||
@@ -17,7 +18,16 @@ class Directory extends Model
|
|||||||
'user_id',
|
'user_id',
|
||||||
'hidden'
|
'hidden'
|
||||||
];
|
];
|
||||||
|
protected $casts = [
|
||||||
|
'hidden' => 'bool',
|
||||||
|
'is_root' => 'bool'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Files in directory
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function files()
|
public function files()
|
||||||
{
|
{
|
||||||
return $this->hasMany(File::class);
|
return $this->hasMany(File::class);
|
||||||
@@ -30,14 +40,7 @@ class Directory extends Model
|
|||||||
*/
|
*/
|
||||||
public function allSubdirectories()
|
public function allSubdirectories()
|
||||||
{
|
{
|
||||||
$subdirectories = $this->hasMany(Directory::class, 'parent_id', 'id');
|
return $this->hasMany(Directory::class, 'parent_id', 'id');
|
||||||
|
|
||||||
// todo fix this ugly hack! statement above produces WHERE parent_id IS NOT NULL and parent_id IS NULL when selecting subdirectories from root/none directory
|
|
||||||
if (is_null($this->id)) {
|
|
||||||
$subdirectories = $subdirectories->orWhereNull('parent_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $subdirectories;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function subdirectories()
|
public function subdirectories()
|
||||||
@@ -47,4 +50,14 @@ class Directory extends Model
|
|||||||
|
|
||||||
return $subdirectories;
|
return $subdirectories;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
// try to prevent from deleting root folder
|
||||||
|
if ($this->is_root == true) {
|
||||||
|
throw new ErrorException('Cannot delete root folder!');
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ class File extends Model
|
|||||||
'user_id',
|
'user_id',
|
||||||
'file_size',
|
'file_size',
|
||||||
'mime_type',
|
'mime_type',
|
||||||
'hash_algorith',
|
'hash_algorithm',
|
||||||
'name',
|
'name',
|
||||||
'file_size'
|
'file_hash'
|
||||||
];
|
];
|
||||||
|
|
||||||
public function directory()
|
public function directory()
|
||||||
|
|||||||
@@ -4,12 +4,8 @@ namespace App\Models\FileManager\ModelTraits;
|
|||||||
|
|
||||||
use App\Events\UploadFile;
|
use App\Events\UploadFile;
|
||||||
use App\Models\FileManager\File as FileModel;
|
use App\Models\FileManager\File as FileModel;
|
||||||
use Franzose\ClosureTable\Extensions\Str;
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Event;
|
use Illuminate\Support\Facades\Event;
|
||||||
use Illuminate\Support\Facades\File as FileFacade;
|
|
||||||
use Intervention\Image\Constraint;
|
|
||||||
use Intervention\Image\Facades\Image;
|
|
||||||
use Symfony\Component\HttpFoundation\File\File as SymphonyFile;
|
use Symfony\Component\HttpFoundation\File\File as SymphonyFile;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
|
|
||||||
@@ -26,7 +22,7 @@ trait File
|
|||||||
*/
|
*/
|
||||||
public function getFilename(UploadedFile $file)
|
public function getFilename(UploadedFile $file)
|
||||||
{
|
{
|
||||||
return uniqid() . '.' . $file->getClientOriginalExtension();
|
return date('Y-m-').uniqid() . '.' . $file->getClientOriginalExtension();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,12 +44,6 @@ trait File
|
|||||||
// save file into physical location (local FS)
|
// save file into physical location (local FS)
|
||||||
$uploadedFile = $file->move($destination, $filename);
|
$uploadedFile = $file->move($destination, $filename);
|
||||||
|
|
||||||
// is uploaded file an image?
|
|
||||||
if (Str::startsWith($uploadedFile->getMimeType(), 'image')) {
|
|
||||||
// yes, create thumbnail
|
|
||||||
$this->createThumbnail($uploadedFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
// insert record into database
|
// insert record into database
|
||||||
$id = $this->saveIntoDatabase($uploadedFile, $data, $file->getClientOriginalName());
|
$id = $this->saveIntoDatabase($uploadedFile, $data, $file->getClientOriginalName());
|
||||||
|
|
||||||
@@ -101,29 +91,4 @@ trait File
|
|||||||
|
|
||||||
return $newFile->id;
|
return $newFile->id;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Create thumbnail of given image
|
|
||||||
*
|
|
||||||
* @param SymphonyFile $file
|
|
||||||
*/
|
|
||||||
private function createThumbnail(SymphonyFile $file)
|
|
||||||
{
|
|
||||||
// does thumbnail directory exist?
|
|
||||||
if (!is_dir(config('app.thumbnail_path'))) {
|
|
||||||
FileFacade::makeDirectory(config('app.thumbnail_path'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// get image instance
|
|
||||||
$image = Image::make(config('app.upload_path') . DIRECTORY_SEPARATOR . $file->getFilename());
|
|
||||||
|
|
||||||
// resize image and keep aspect ration
|
|
||||||
$image->resize(env('THUMBNAIL_WIDTH', 300), null, function (Constraint $constraint) {
|
|
||||||
$constraint->aspectRatio();
|
|
||||||
$constraint->upsize();
|
|
||||||
});
|
|
||||||
|
|
||||||
// save thumbnail with lower quality
|
|
||||||
$image->save(config('app.thumbnail_path') . DIRECTORY_SEPARATOR . $file->getFilename(), 75);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class MarkDirectoryAsRoot extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('directories', function (Blueprint $table) {
|
||||||
|
$table->boolean('is_root')->default(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('directories', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('is_root');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
namespace Modules\Blog\Modificators;
|
||||||
|
|
||||||
|
class PerexCreator
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var \DOMDocument
|
||||||
|
*/
|
||||||
|
protected $DOMDocument;
|
||||||
|
protected $perex;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->DOMDocument = new \DOMDocument('1.0', 'UTF-8');
|
||||||
|
$this->maxLength = 300;
|
||||||
|
$this->maxImages = 2;
|
||||||
|
$this->perex = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addHtml($node)
|
||||||
|
{
|
||||||
|
$this->perex .= strip_tags($this->DOMDocument->saveHTML($node), '<p><strong><em><b><i><u>');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create($html)
|
||||||
|
{
|
||||||
|
if (empty($html)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
|
||||||
|
$this->DOMDocument->loadHTML($html);
|
||||||
|
|
||||||
|
$texts = $this->DOMDocument->getElementsByTagName('p');
|
||||||
|
$images = $this->DOMDocument->getElementsByTagName('img');
|
||||||
|
$iframes = $this->DOMDocument->getElementsByTagName('iframe');
|
||||||
|
|
||||||
|
$textId = 0;
|
||||||
|
$imgId = 0;
|
||||||
|
if ($texts->length > 1) {
|
||||||
|
$this->addHtml($texts[$textId++]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mb_strlen($this->perex) < $this->maxLength) {
|
||||||
|
if ($iframes->length > 0) {
|
||||||
|
$this->perex .= $this->DOMDocument->saveHTML($iframes[0]);
|
||||||
|
} elseif ($images->length > 0) {
|
||||||
|
while ($imgId < $images->length && $imgId < $this->maxImages) {
|
||||||
|
$this->perex .= $this->DOMDocument->saveHTML($images[$imgId++]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while (mb_strlen($this->perex) < $this->maxLength && $textId < $texts->length) {
|
||||||
|
$this->addHtml($texts[$textId++]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->perex;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,42 +1,44 @@
|
|||||||
<?php
|
<?php
|
||||||
return [
|
return [
|
||||||
"createSubdirectoryFor" => "Vytvořit podadresář v :directory.",
|
"createSubdirectoryFor" => "Vytvořit podadresář v :directory.",
|
||||||
"createdAt" => "Nahráno",
|
"createdAt" => "Nahráno",
|
||||||
"delete" => "Smazat",
|
"delete" => "Smazat",
|
||||||
"description" => "Popis souboru",
|
"description" => "Popis souboru",
|
||||||
"directories" => "Podadresáře v adresáři :directory",
|
"directories" => "Podadresáře v adresáři :directory",
|
||||||
"directoryDescription" => "Popis",
|
"directoryDescription" => "Popis",
|
||||||
"directoryHidden" => "Skrytý adresář",
|
"directoryHidden" => "Skrytý adresář",
|
||||||
"directoryName" => "Jméno adresáře",
|
'directory' => 'Adresář',
|
||||||
"edit" => "Upravit soubor :name",
|
"directoryName" => "Jméno adresáře",
|
||||||
"editButton" => "Upravit",
|
"edit" => "Upravit soubor :name",
|
||||||
"editDirectory" => "Upravit adresář",
|
"editButton" => "Upravit",
|
||||||
"editDirectorySuccess" => "Úspěšně uloženo",
|
"editDirectory" => "Upravit adresář",
|
||||||
"encoding" => "Kódování",
|
"editDirectorySuccess" => "Úspěšně uloženo",
|
||||||
"fileDeleted" => "Soubor smazán",
|
"encoding" => "Kódování",
|
||||||
"fileInfo" => "Informace",
|
"fileDeleted" => "Soubor smazán",
|
||||||
"fileSize" => "Velikost",
|
"fileInfo" => "Informace",
|
||||||
"hash" => "Hash",
|
"fileSize" => "Velikost",
|
||||||
"invalidFile" => "Nahrávaný soubor nelze nahrát, z nějakého důvodu není validní.",
|
"hash" => "Hash",
|
||||||
"keywords" => "Klíčová slova (oddělena čárkou)",
|
"invalidFile" => "Nahrávaný soubor nelze nahrát, z nějakého důvodu není validní.",
|
||||||
"mime" => "MIME typ",
|
"keywords" => "Klíčová slova (oddělena čárkou)",
|
||||||
"name" => "Jméno",
|
"mime" => "MIME typ",
|
||||||
"newDirectory" => "Vytvořit nový adresář",
|
"name" => "Jméno",
|
||||||
"newDirectorySuccess" => "Nový adresář úspěšně vytvořen",
|
"newDirectory" => "Vytvořit nový adresář",
|
||||||
"newFile" => "Nový soubor",
|
"newDirectorySuccess" => "Nový adresář úspěšně vytvořen",
|
||||||
"noFileSpecified" => "Nebyl zvolen žádný soubor k nahrávání",
|
"newFile" => "Nový soubor",
|
||||||
"noFiles" => "Žádný soubor nebyl nalezen",
|
"noFileSpecified" => "Nebyl zvolen žádný soubor k nahrávání",
|
||||||
"noSubdirectories" => "Žádné podadresáře",
|
"noFiles" => "Žádný soubor nebyl nalezen",
|
||||||
"originalFilename" => "Původní jméno",
|
"noSubdirectories" => "Žádné podadresáře",
|
||||||
"overview" => "Seznam všech souborů",
|
"originalFilename" => "Původní jméno",
|
||||||
"parentDirectory" => "Rodičovský adresář",
|
"overview" => "Seznam všech souborů",
|
||||||
"resolution" => "Rozlišení",
|
"parentDirectory" => "Rodičovský adresář",
|
||||||
"rootDirectories" => "Kořenové adresáře",
|
"resolution" => "Rozlišení",
|
||||||
"selectFile" => "Vybrat soubor",
|
"rootDirectories" => "Kořenové adresáře",
|
||||||
"subdirectoryExists" => "Adresář s tímto jménem tu již eixstuje",
|
"selectFile" => "Vybrat soubor",
|
||||||
"successfullyChanged" => "Úspěšně uloženo",
|
"subdirectoryExists" => "Adresář s tímto jménem tu již eixstuje",
|
||||||
"updatedAt" => "Poslední změna",
|
"successfullyChanged" => "Úspěšně uloženo",
|
||||||
"upload" => "Nahrát nový soubor",
|
"updatedAt" => "Poslední změna",
|
||||||
"uploadSuccessfull" => "Soubor úspěšně nahrán|:count soubory úspěšně nahrány|:count souborů úspěšně nahráno",
|
"upload" => "Nahrát nový soubor",
|
||||||
"url" => "Veřejná URL",
|
"uploadSuccessfull" => "Soubor úspěšně nahrán|:count soubory úspěšně nahrány|:count souborů úspěšně nahráno",
|
||||||
|
"url" => "Veřejná URL",
|
||||||
|
'rootDirectory' => 'Kořenový adresář'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<option value="{{$directory->id}}" @if($file->directory_id == $directory->id) selected @endif>
|
||||||
|
{{str_repeat('-', $depth)}}
|
||||||
|
{{$directory->is_root ? trans('admin/fileManager.rootDirectory') : $directory->name}}
|
||||||
|
</option>
|
||||||
|
|
||||||
|
@if (!is_null($directory->subdirectories))
|
||||||
|
@foreach($directory->subdirectories as $dir)
|
||||||
|
@include('admin.fileManager.directories.subdirectoriesOptionList', ['directory' => $dir, 'depth' => $depth +1, 'file' => $file])
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@if($directory->id)
|
@if (!$directory->is_root)
|
||||||
<div class="col-sm-4 col-md-3 text-center">
|
<div class="col-sm-4 col-md-3 text-center">
|
||||||
@include('admin.snippets.card', [
|
@include('admin.snippets.card', [
|
||||||
'body' => '<a href="'.route('upload.overview', ['directory' => $directory->parent_id]).'"><p><i class="fa fa-2x fa-level-up"></i><br />'.trans('admin/fileManager.parentDirectory').'</p></a>',
|
'body' => '<a href="'.route('upload.overview', ['directory' => $directory->parent_id]).'"><p><i class="fa fa-2x fa-level-up"></i><br />'.trans('admin/fileManager.parentDirectory').'</p></a>',
|
||||||
|
|||||||
@@ -12,6 +12,15 @@
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input class="form-control" type="text" name="keywords" id="keywords" value="{{$file->keywords}}" />
|
<input class="form-control" type="text" name="keywords" id="keywords" value="{{$file->keywords}}" />
|
||||||
|
|
||||||
|
<lavel class="control-label">
|
||||||
|
@lang('admin/fileManager.directory')
|
||||||
|
</lavel>
|
||||||
|
|
||||||
|
<select name="directory_id" class="form-control">
|
||||||
|
@include('admin/fileManager.directories.subdirectoriesOptionList', ['directory' => $root, 'depth' => 0, 'file' => $file])
|
||||||
|
</select>
|
||||||
|
|
||||||
<label class="control-label">
|
<label class="control-label">
|
||||||
@lang('admin/fileManager.description')
|
@lang('admin/fileManager.description')
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<input type="hidden" name="directoryId" value="{{$directory->id}}" />
|
<input type="hidden" name="directoryId" value="{{$directory->id}}" />
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<input type="file" multiple name="files[]" class="form-control" id="file" />
|
<input type="file" multiple name="files[]" required class="form-control" id="file" />
|
||||||
|
|
||||||
<input type="text" name="name" id="name" class="form-control" placeholder="@lang('admin/fileManager.name')"
|
<input type="text" name="name" id="name" class="form-control" placeholder="@lang('admin/fileManager.name')"
|
||||||
value="{{old('name')}}" />
|
value="{{old('name')}}" />
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
@extends('admin.layoutWithNavigation')
|
@extends('admin.layoutWithNavigation')
|
||||||
|
|
||||||
@if ($directory->id)
|
@if (!$directory->is_root)
|
||||||
@section('pageHeading', @trans('admin/fileManager.directories', ['directory' => $directory->name]))
|
@section('pageHeading', @trans('admin/fileManager.directories', ['directory' => $directory->name]))
|
||||||
@else
|
@else
|
||||||
@section('pageHeading', @trans('admin/fileManager.rootDirectories'))
|
@section('pageHeading', @trans('admin/fileManager.rootDirectories'))
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if ($directory->exists)
|
@if (!$directory->is_root)
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading" role="tab" id="edit-dir-title">
|
<div class="panel-heading" role="tab" id="edit-dir-title">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
|
|||||||
Reference in New Issue
Block a user