aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/AppInfo/Application.php9
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php6
-rw-r--r--apps/files_sharing/lib/Listener/LoadAdditionalListener.php6
3 files changed, 9 insertions, 12 deletions
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php
index 649f5d0f78f..946d82a3df7 100644
--- a/apps/files_sharing/lib/AppInfo/Application.php
+++ b/apps/files_sharing/lib/AppInfo/Application.php
@@ -117,7 +117,6 @@ class Application extends App implements IBootstrap {
$context->injectFn([$this, 'registerMountProviders']);
$context->injectFn([$this, 'registerEventsScripts']);
$context->injectFn([$this, 'registerDownloadEvents']);
- $context->injectFn([$this, 'loadFilesSharing']);
Helper::registerHooks();
@@ -214,12 +213,4 @@ class Application extends App implements IBootstrap {
}
);
}
-
- public function loadFilesSharing(IManager $shareManager): void {
- if (!$shareManager->shareApiEnabled() || !class_exists('\OCA\Files\App')) {
- return;
- }
-
- Util::addScript(self::APP_ID, 'files_sharing', 'files');
- }
}
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index e80412f18b4..5d5015cfca6 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -232,7 +232,7 @@ class ShareAPIController extends OCSController {
// Get the original node permission if the share owner is the current user
if ($isOwnShare) {
- $result['permissions'] = $node->getPermissions();
+ $result['item_permissions'] = $node->getPermissions();
}
$result['mimetype'] = $node->getMimetype();
@@ -243,8 +243,8 @@ class ShareAPIController extends OCSController {
$result['file_source'] = $node->getId();
$result['file_parent'] = $node->getParent()->getId();
$result['file_target'] = $share->getTarget();
- $result['size'] = $node->getSize();
- $result['mtime'] = $node->getMTime();
+ $result['item_size'] = $node->getSize();
+ $result['item_mtime'] = $node->getMTime();
$expiration = $share->getExpirationDate();
if ($expiration !== null) {
diff --git a/apps/files_sharing/lib/Listener/LoadAdditionalListener.php b/apps/files_sharing/lib/Listener/LoadAdditionalListener.php
index d44b8c559ad..583cd575793 100644
--- a/apps/files_sharing/lib/Listener/LoadAdditionalListener.php
+++ b/apps/files_sharing/lib/Listener/LoadAdditionalListener.php
@@ -29,6 +29,7 @@ use OCA\Files_Sharing\AppInfo\Application;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
+use OCP\Share\IManager;
use OCP\Util;
class LoadAdditionalListener implements IEventListener {
@@ -40,5 +41,10 @@ class LoadAdditionalListener implements IEventListener {
// After files for the breadcrumb share indicator
Util::addScript(Application::APP_ID, 'additionalScripts', 'files');
Util::addStyle(Application::APP_ID, 'icons');
+
+ $shareManager = \OC::$server->get(IManager::class);
+ if ($shareManager->shareApiEnabled() && class_exists('\OCA\Files\App')) {
+ Util::addScript(Application::APP_ID, 'files_sharing', 'files');
+ }
}
}