]> source.dussan.org Git - nextcloud-server.git/commitdiff
Extend trashbin migrator
authorChristopher Ng <chrng8@gmail.com>
Fri, 8 Apr 2022 19:23:12 +0000 (19:23 +0000)
committerChristopher Ng <chrng8@gmail.com>
Fri, 8 Apr 2022 19:31:22 +0000 (19:31 +0000)
Signed-off-by: Christopher Ng <chrng8@gmail.com>
apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php

index 0aa41c1954fad3325caf4e0c4b7aa0fb93946dcc..c7832ec5bc883fb4aa367091f9bc17bd4bf6f272 100644 (file)
@@ -31,6 +31,7 @@ use OCP\Files\Folder;
 use OCP\Files\IRootFolder;
 use OCP\Files\NotFoundException;
 use OCP\IDBConnection;
+use OCP\IL10N;
 use OCP\IUser;
 use OCP\UserMigration\IExportDestination;
 use OCP\UserMigration\IImportSource;
@@ -50,12 +51,16 @@ class TrashbinMigrator implements IMigrator {
 
        protected IDBConnection $dbc;
 
+       protected IL10N $l10n;
+
        public function __construct(
                IRootFolder $rootFolder,
-               IDBConnection $dbc
+               IDBConnection $dbc,
+               IL10N $l10n
        ) {
                $this->root = $rootFolder;
                $this->dbc = $dbc;
+               $this->l10n = $l10n;
        }
 
        /**
@@ -134,4 +139,25 @@ class TrashbinMigrator implements IMigrator {
                        $output->writeln("No trashbin to import…");
                }
        }
+
+       /**
+        * {@inheritDoc}
+        */
+       public function getId(): string {
+               return 'trashbin';
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       public function getDisplayName(): string {
+               return $this->l10n->t('Deleted files');
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       public function getDescription(): string {
+               return $this->l10n->t('Deleted files and folders in the trash bin');
+       }
 }