From fb14ab21e83b119c92060b6f9eb4813226efbb39 Mon Sep 17 00:00:00 2001 From: DeSwa Date: Tue, 8 Oct 2024 15:16:28 +0300 Subject: [PATCH 1/6] New labels for Tree Contextmenu --- Resources/translations/messages.ca.yml | 4 ++++ Resources/translations/messages.de.yml | 4 ++++ Resources/translations/messages.en.yml | 4 ++++ Resources/translations/messages.es.yml | 4 ++++ Resources/translations/messages.fr.yml | 4 ++++ Resources/translations/messages.it.yml | 4 ++++ Resources/translations/messages.nl.yml | 4 ++++ Resources/translations/messages.pl.yml | 4 ++++ Resources/translations/messages.pt_BR.yml | 4 ++++ Resources/translations/messages.ro.yml | 4 ++++ Resources/translations/messages.ru.yml | 4 ++++ Resources/translations/messages.tr.yml | 6 +++++- 12 files changed, 49 insertions(+), 1 deletion(-) diff --git a/Resources/translations/messages.ca.yml b/Resources/translations/messages.ca.yml index 15c5d09..ac86a33 100644 --- a/Resources/translations/messages.ca.yml +++ b/Resources/translations/messages.ca.yml @@ -17,6 +17,10 @@ folder: deleted: success: "La carpeta s'ha eliminat correctament" unauthorized: "La carpeta ja no existeix o no està autoritzat per accedir a aquesta pàgina" + rename: + success: Folder has been renamed successfully + unauthorized: Folder no longer exist or you are not authorized to access this page + danger: Folder could not renamed button: cancel: "CANCEL·LAR" refresh: "Actualitzar" diff --git a/Resources/translations/messages.de.yml b/Resources/translations/messages.de.yml index bd32f31..cf7cd9d 100644 --- a/Resources/translations/messages.de.yml +++ b/Resources/translations/messages.de.yml @@ -17,6 +17,10 @@ folder: deleted: success: Das Verzeichnis wurde erfolgreich gelöscht unauthorized: Die Datei existiert nicht mehr oder Sie haben keine Zugriffsrechte auf diese Seite + rename: + success: Folder has been renamed successfully + unauthorized: Folder no longer exist or you are not authorized to access this page + danger: Folder could not renamed button: cancel: ABBRECHEN refresh: Neu laden diff --git a/Resources/translations/messages.en.yml b/Resources/translations/messages.en.yml index 5e950f4..f460e75 100644 --- a/Resources/translations/messages.en.yml +++ b/Resources/translations/messages.en.yml @@ -17,6 +17,10 @@ folder: deleted: success: Folder has been deleted successfully unauthorized: Folder no longer exist or you are not authorized to access this page + rename: + success: Folder has been renamed successfully + unauthorized: Folder no longer exist or you are not authorized to access this page + danger: Folder could not renamed button: cancel: CANCEL refresh: Refresh diff --git a/Resources/translations/messages.es.yml b/Resources/translations/messages.es.yml index 3b7b98c..0796ed1 100644 --- a/Resources/translations/messages.es.yml +++ b/Resources/translations/messages.es.yml @@ -17,6 +17,10 @@ folder: deleted: success: La carpeta se ha eliminado correctamente unauthorized: La carpeta ya no existe o no está autorizado para acceder a esta página + rename: + success: Folder has been renamed successfully + unauthorized: Folder no longer exist or you are not authorized to access this page + danger: Folder could not renamed button: cancel: CANCELAR refresh: Actualizar diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index bf1126e..737a8a3 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -17,6 +17,10 @@ folder: deleted: success: Le dossier a été supprimé avec succès unauthorized: Le dossier n'existe plus ou vous n'êtes pas autorisé à accéder à cette page + rename: + success: Folder has been renamed successfully + unauthorized: Folder no longer exist or you are not authorized to access this page + danger: Folder could not renamed button: cancel: ANNULER refresh: Rafraîchir diff --git a/Resources/translations/messages.it.yml b/Resources/translations/messages.it.yml index bfd732f..d6388bb 100644 --- a/Resources/translations/messages.it.yml +++ b/Resources/translations/messages.it.yml @@ -17,6 +17,10 @@ folder: deleted: success: La cartella è stata eliminata correttamente unauthorized: La cartella non esiste più o non sei autorizzato ad accedere a questa pagina + rename: + success: Folder has been renamed successfully + unauthorized: Folder no longer exist or you are not authorized to access this page + danger: Folder could not renamed button: cancel: ANNULLA refresh: Aggiorna diff --git a/Resources/translations/messages.nl.yml b/Resources/translations/messages.nl.yml index a627ced..134b537 100644 --- a/Resources/translations/messages.nl.yml +++ b/Resources/translations/messages.nl.yml @@ -17,6 +17,10 @@ folder: deleted: success: Map is met succes verwijderd. unauthorized: Map bestaat niet meer of u bent niet bevoegd om deze pagina te openen. + rename: + success: Folder has been renamed successfully + unauthorized: Folder no longer exist or you are not authorized to access this page + danger: Folder could not renamed button: cancel: ANULEREN refresh: Verversen diff --git a/Resources/translations/messages.pl.yml b/Resources/translations/messages.pl.yml index d95a8cf..b91c1e4 100644 --- a/Resources/translations/messages.pl.yml +++ b/Resources/translations/messages.pl.yml @@ -17,6 +17,10 @@ folder: deleted: success: Folder został pomyślnie usunięty unauthorized: Folder już nie istnieje lub nie masz uprawnień dostępu do tej strony. + rename: + success: Folder has been renamed successfully + unauthorized: Folder no longer exist or you are not authorized to access this page + danger: Folder could not renamed button: cancel: Anuluj refresh: Odśwież diff --git a/Resources/translations/messages.pt_BR.yml b/Resources/translations/messages.pt_BR.yml index 7366d18..7e43e5b 100644 --- a/Resources/translations/messages.pt_BR.yml +++ b/Resources/translations/messages.pt_BR.yml @@ -17,6 +17,10 @@ folder: deleted: success: A pasta excluída com sucesso unauthorized: A pasta não existe mais ou você não tem autorização para acessar esta página + rename: + success: Folder has been renamed successfully + unauthorized: Folder no longer exist or you are not authorized to access this page + danger: Folder could not renamed button: cancel: CANCELAR refresh: Atualizar diff --git a/Resources/translations/messages.ro.yml b/Resources/translations/messages.ro.yml index f0cea15..55ab0f6 100644 --- a/Resources/translations/messages.ro.yml +++ b/Resources/translations/messages.ro.yml @@ -17,6 +17,10 @@ folder: deleted: success: Directorul a fost sters cu succes unauthorized: Directorul nu mai exista sau nu esti autorizat sa accesezi aceasta pagina + rename: + success: Folder has been renamed successfully + unauthorized: Folder no longer exist or you are not authorized to access this page + danger: Folder could not renamed button: cancel: ANULEAZA refresh: Reimprospateaza diff --git a/Resources/translations/messages.ru.yml b/Resources/translations/messages.ru.yml index cf16dc5..7cdd69d 100644 --- a/Resources/translations/messages.ru.yml +++ b/Resources/translations/messages.ru.yml @@ -17,6 +17,10 @@ folder: deleted: success: Папка успешно удалена unauthorized: Папка больше не существует или у вас недостаточно прав для доступа к этой странице + rename: + success: Folder has been renamed successfully + unauthorized: Folder no longer exist or you are not authorized to access this page + danger: Folder could not renamed button: cancel: ОТМЕНА refresh: Обновить diff --git a/Resources/translations/messages.tr.yml b/Resources/translations/messages.tr.yml index a562cb4..f9b0e33 100644 --- a/Resources/translations/messages.tr.yml +++ b/Resources/translations/messages.tr.yml @@ -17,10 +17,14 @@ folder: deleted: success: Klasör başarıyla silindi unauthorized: Klasör mevcut değil veya bu işlem için yetkiniz yok + rename: + success: Klasör başarıyla yeniden adlandırıldı + unauthorized: Klasör mevcut değil veya bu işlem için yetkiniz yok + danger: Klasör yeniden adlandırılamadı button: cancel: İPTAL refresh: Yenile - parent: Parent + parent: Üst Dizin save: KAYDET add: files: Dosya Yükle... From 37ca93b51955882a7d7e5c08b13c3a81724fb08d Mon Sep 17 00:00:00 2001 From: DeSwa Date: Tue, 8 Oct 2024 15:17:51 +0300 Subject: [PATCH 2/6] Modernize + New Features + Remember last working directory --- DependencyInjection/Configuration.php | 1 + Event/FileManagerEvents.php | 2 + Helpers/FileManager.php | 2 + Resources/doc/tutorials/input-button.md | 2 +- Resources/doc/tutorials/integrate-tinymce.md | 2 +- Resources/public/css/manager.css | 118 +++- Resources/public/js/manager.js | 570 ++++++++++--------- Resources/views/extension/_order.html.twig | 3 +- Resources/views/manager.html.twig | 16 +- Resources/views/views/_modals.html.twig | 25 + composer.json | 3 +- 11 files changed, 474 insertions(+), 270 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 9a20e15..900a210 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -32,6 +32,7 @@ public function getConfigTreeBuilder(): TreeBuilder { ->children() ->scalarNode('dir')->end() ->enumNode('type')->values(['file', 'image', 'media'])->end() + ->booleanNode('remember_last_path')->defaultValue(true)->end() ->booleanNode('tree')->end() ->booleanNode('show_file_count')->defaultValue(true)->end() ->scalarNode('root_name')->defaultValue(null)->end() diff --git a/Event/FileManagerEvents.php b/Event/FileManagerEvents.php index c3a6f90..7c60374 100644 --- a/Event/FileManagerEvents.php +++ b/Event/FileManagerEvents.php @@ -22,6 +22,8 @@ final class FileManagerEvents { public const PRE_DELETE_FOLDER = ' file_manager.pre_delete_folder'; /** @Event("Symfony\Component\EventDispatcher\GenericEvent") */ public const POST_DELETE_FOLDER = 'file_manager.post_delete_folder'; + /** @Event("Symfony\Component\EventDispatcher\GenericEvent") */ + public const RENAME_FOLDER = 'file_manager.post_rename_folder'; /** @Event("Symfony\Component\EventDispatcher\GenericEvent") */ public const POST_DIRECTORY_FILTER_CONFIGURATION = 'file_manager.post_directory_filter_configuration'; diff --git a/Helpers/FileManager.php b/Helpers/FileManager.php index 26ffd3b..610dad6 100644 --- a/Helpers/FileManager.php +++ b/Helpers/FileManager.php @@ -7,6 +7,7 @@ use Symfony\Component\EventDispatcher\GenericEvent; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\Routing\RouterInterface; @@ -75,6 +76,7 @@ public function getParent(): ?string $queryParentParameters['route'] = \dirname($this->getRoute()); } else { unset($queryParentParameters['route']); +// $queryParentParameters['route'] = '/'; } $parentRoute = $this->router->generate('file_manager', $queryParentParameters); diff --git a/Resources/doc/tutorials/input-button.md b/Resources/doc/tutorials/input-button.md index e128e7b..0f1d90d 100644 --- a/Resources/doc/tutorials/input-button.md +++ b/Resources/doc/tutorials/input-button.md @@ -49,7 +49,7 @@ artgris_file_manager: