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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
29d1e808
Commit
29d1e808
authored
12 years ago
by
Michael Gapczynski
Browse files
Options
Downloads
Patches
Plain Diff
Implement generateTarget for file sharing backend
parent
6d48f3fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/files_sharing/lib/share/file.php
+19
-3
19 additions, 3 deletions
apps/files_sharing/lib/share/file.php
with
19 additions
and
3 deletions
apps/files_sharing/lib/share/file.php
+
19
−
3
View file @
29d1e808
...
...
@@ -46,9 +46,25 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
return
false
;
}
public
function
generateTarget
(
$itemSource
,
$shareWith
,
$exclude
=
null
)
{
// TODO Make sure target path doesn't exist already
return
$itemSource
;
public
function
generateTarget
(
$filePath
,
$shareWith
,
$exclude
=
null
)
{
$target
=
$filePath
;
if
(
isset
(
$exclude
))
{
if
(
$pos
=
strrpos
(
$target
,
'.'
))
{
$name
=
substr
(
$target
,
0
,
$pos
);
$ext
=
substr
(
$target
,
$pos
);
}
else
{
$name
=
$filePath
;
$ext
=
''
;
}
$i
=
2
;
$append
=
''
;
while
(
in_array
(
$name
.
$append
.
$ext
,
$exclude
))
{
$append
=
' ('
.
$i
.
')'
;
$i
++
;
}
$target
=
$name
.
$append
.
$ext
;
}
return
$target
;
}
public
function
formatItems
(
$items
,
$format
,
$parameters
=
null
)
{
...
...
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