diff options
author | Michael Jobst <mjobst+github@tecratech.de> | 2016-11-10 09:13:25 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-11 11:54:13 -0500 |
commit | 81b1dc4930204ca7210b595e631a4c4ce46fb79d (patch) | |
tree | 77e867b192923d51b054f529e0ab5e4a1623d204 /apps/files_sharing/lib | |
parent | 45a6e376995a3ef6618b12ee65e6f903e846b1a5 (diff) | |
download | nextcloud-server-81b1dc4930204ca7210b595e631a4c4ce46fb79d.tar.gz nextcloud-server-81b1dc4930204ca7210b595e631a4c4ce46fb79d.zip |
share api expanded by tags (#26583)
* share api expanded by tags
* Modified files_sharing JS Unit tests
* modified tests. renamed request parameter. refactoring
* Update Share20OCS.php
Added missing function description
* Update Helper.php
Added missing function description
* Update Helper.php
implicit boolean conversion to !empty()
* Update Share20OCSTest.php
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index bc525b6ef82..bd57d80dab0 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -23,6 +23,7 @@ */ namespace OCA\Files_Sharing\Controller; +use OCA\Files\Helper; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCS\OCSBadRequestException; use OCP\AppFramework\OCS\OCSException; @@ -484,9 +485,10 @@ class ShareAPIController extends OCSController { /** * @param \OCP\Files\File|\OCP\Files\Folder $node + * @param boolean $includeTags * @return DataResponse */ - private function getSharedWithMe($node = null) { + private function getSharedWithMe($node = null, $includeTags) { $userShares = $this->shareManager->getSharedWith($this->currentUser, \OCP\Share::SHARE_TYPE_USER, $node, -1, 0); $groupShares = $this->shareManager->getSharedWith($this->currentUser, \OCP\Share::SHARE_TYPE_GROUP, $node, -1, 0); @@ -509,6 +511,10 @@ class ShareAPIController extends OCSController { } } + if ($includeTags) { + $formatted = Helper::populateTags($formatted, 'file_source'); + } + return new DataResponse($formatted); } @@ -572,7 +578,8 @@ class ShareAPIController extends OCSController { $shared_with_me = 'false', $reshares = 'false', $subfiles = 'false', - $path = null + $path = null, + $include_tags = 'false' ) { if ($path !== null) { @@ -588,7 +595,7 @@ class ShareAPIController extends OCSController { } if ($shared_with_me === 'true') { - $result = $this->getSharedWithMe($path); + $result = $this->getSharedWithMe($path, $include_tags); return $result; } @@ -634,6 +641,10 @@ class ShareAPIController extends OCSController { } } + if ($include_tags) { + $formatted = Helper::populateTags($formatted, 'file_source'); + } + return new DataResponse($formatted); } |