Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
937d1b29
Commit
937d1b29
authored
Aug 14, 2012
by
Michael Gapczynski
Browse files
Options
Downloads
Patches
Plain Diff
Retrieve all file dependent items when looking for file item type
parent
4c7fd8cd
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/public/share.php
+11
-4
11 additions, 4 deletions
lib/public/share.php
with
11 additions
and
4 deletions
lib/public/share.php
+
11
−
4
View file @
937d1b29
...
...
@@ -448,9 +448,16 @@ class Share {
private
static
function
getItems
(
$itemType
,
$item
=
null
,
$shareType
=
null
,
$shareWith
=
null
,
$uidOwner
=
null
,
$format
=
self
::
FORMAT_NONE
,
$parameters
=
null
,
$limit
=
-
1
,
$includeCollections
=
false
,
$itemShareWithBySource
=
false
)
{
$backend
=
self
::
getBackend
(
$itemType
);
// Get filesystem root to add it to the file target and remove from the file source
if
(
$backend
instanceof
Share_Backend_File_Dependent
)
{
$root
=
\OC_Filesystem
::
getRoot
();
}
else
{
$root
=
''
;
}
if
(
$itemType
==
'file'
&&
!
isset
(
$item
))
{
$where
=
'WHERE file_target IS NOT NULL'
;
$query_args
=
array
();
}
else
if
(
$includeCollections
&&
!
isset
(
$item
)
&&
$collectionTypes
=
self
::
getCollectionItemTypes
(
$itemType
))
{
// If includeCollections is true, find collections of this item type, e.g. a music album contains songs
if
(
$includeCollections
&&
!
isset
(
$item
)
&&
$collectionTypes
=
self
::
getCollectionItemTypes
(
$itemType
))
{
$item_types
=
array_merge
(
array
(
$itemType
),
$collectionTypes
);
$placeholders
=
join
(
','
,
array_fill
(
0
,
count
(
$item_types
),
'?'
));
$where
=
"WHERE item_type IN ('"
.
$placeholders
.
"')"
;
...
...
@@ -574,7 +581,7 @@ class Share {
}
// TODO Check this outside of the loop
// Check if this is a collection of the requested item type
if
(
$row
[
'item_type'
]
!=
$itemType
)
{
if
(
$row
[
'item_type'
]
!=
$itemType
&&
$itemType
!=
'file'
&&
!
isset
(
$item
)
)
{
if
(
$collectionBackend
=
self
::
getBackend
(
$row
[
'item_type'
]))
{
$row
[
'collection'
]
=
array
(
'item_type'
=>
$itemType
,
$column
=>
$row
[
$column
]);
// Fetch all of the children sources
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment