Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
4c9c73be
Commit
4c9c73be
authored
Mar 25, 2015
by
Joas Schilling
Browse files
Correct the app name for sharing events
parent
4f0abd91
Changes
1
Show whitespace changes
Inline
Side-by-side
apps/files_sharing/lib/activity.php
View file @
4c9c73be
...
@@ -28,6 +28,7 @@ use OCP\Activity\IExtension;
...
@@ -28,6 +28,7 @@ use OCP\Activity\IExtension;
use
OCP\IURLGenerator
;
use
OCP\IURLGenerator
;
class
Activity
implements
IExtension
{
class
Activity
implements
IExtension
{
const
FILES_SHARING_APP
=
'files_sharing'
;
/**
/**
* Filter with all sharing related activities
* Filter with all sharing related activities
*/
*/
...
@@ -72,7 +73,7 @@ class Activity implements IExtension {
...
@@ -72,7 +73,7 @@ class Activity implements IExtension {
}
}
protected
function
getL10N
(
$languageCode
=
null
)
{
protected
function
getL10N
(
$languageCode
=
null
)
{
return
$this
->
languageFactory
->
get
(
'files_sharing'
,
$languageCode
);
return
$this
->
languageFactory
->
get
(
self
::
FILES_SHARING_APP
,
$languageCode
);
}
}
/**
/**
...
@@ -146,7 +147,7 @@ class Activity implements IExtension {
...
@@ -146,7 +147,7 @@ class Activity implements IExtension {
public
function
translate
(
$app
,
$text
,
$params
,
$stripPath
,
$highlightParams
,
$languageCode
)
{
public
function
translate
(
$app
,
$text
,
$params
,
$stripPath
,
$highlightParams
,
$languageCode
)
{
$l
=
$this
->
getL10N
(
$languageCode
);
$l
=
$this
->
getL10N
(
$languageCode
);
if
(
$app
===
'files_sharing'
)
{
if
(
$app
===
self
::
FILES_SHARING_APP
)
{
switch
(
$text
)
{
switch
(
$text
)
{
case
self
::
SUBJECT_REMOTE_SHARE_RECEIVED
:
case
self
::
SUBJECT_REMOTE_SHARE_RECEIVED
:
return
(
string
)
$l
->
t
(
'You received a new remote share from %s'
,
$params
);
return
(
string
)
$l
->
t
(
'You received a new remote share from %s'
,
$params
);
...
@@ -160,9 +161,6 @@ class Activity implements IExtension {
...
@@ -160,9 +161,6 @@ class Activity implements IExtension {
return
(
string
)
$l
->
t
(
'Public shared folder %1$s was downloaded'
,
$params
);
return
(
string
)
$l
->
t
(
'Public shared folder %1$s was downloaded'
,
$params
);
case
self
::
SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED
:
case
self
::
SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED
:
return
(
string
)
$l
->
t
(
'Public shared file %1$s was downloaded'
,
$params
);
return
(
string
)
$l
->
t
(
'Public shared file %1$s was downloaded'
,
$params
);
}
}
else
if
(
$app
===
'files'
)
{
switch
(
$text
)
{
case
self
::
SUBJECT_SHARED_USER_SELF
:
case
self
::
SUBJECT_SHARED_USER_SELF
:
return
(
string
)
$l
->
t
(
'You shared %1$s with %2$s'
,
$params
);
return
(
string
)
$l
->
t
(
'You shared %1$s with %2$s'
,
$params
);
case
self
::
SUBJECT_SHARED_GROUP_SELF
:
case
self
::
SUBJECT_SHARED_GROUP_SELF
:
...
@@ -189,7 +187,7 @@ class Activity implements IExtension {
...
@@ -189,7 +187,7 @@ class Activity implements IExtension {
* @return array|false
* @return array|false
*/
*/
public
function
getSpecialParameterList
(
$app
,
$text
)
{
public
function
getSpecialParameterList
(
$app
,
$text
)
{
if
(
$app
===
'files_sharing'
)
{
if
(
$app
===
self
::
FILES_SHARING_APP
)
{
switch
(
$text
)
{
switch
(
$text
)
{
case
self
::
SUBJECT_REMOTE_SHARE_RECEIVED
:
case
self
::
SUBJECT_REMOTE_SHARE_RECEIVED
:
return
array
(
return
array
(
...
@@ -207,9 +205,6 @@ class Activity implements IExtension {
...
@@ -207,9 +205,6 @@ class Activity implements IExtension {
return
array
(
return
array
(
0
=>
'file'
,
0
=>
'file'
,
);
);
}
}
else
if
(
$app
===
'files'
)
{
switch
(
$text
)
{
case
self
::
SUBJECT_SHARED_LINK_SELF
:
case
self
::
SUBJECT_SHARED_LINK_SELF
:
return
[
0
=>
'file'
];
return
[
0
=>
'file'
];
case
self
::
SUBJECT_SHARED_USER_SELF
:
case
self
::
SUBJECT_SHARED_USER_SELF
:
...
@@ -273,7 +268,7 @@ class Activity implements IExtension {
...
@@ -273,7 +268,7 @@ class Activity implements IExtension {
}
}
/**
/**
* The extension can check if a custom
er
filter (given by a query string like filter=abc) is valid or not.
* The extension can check if a custom filter (given by a query string like filter=abc) is valid or not.
*
*
* @param string $filterValue
* @param string $filterValue
* @return boolean
* @return boolean
...
@@ -310,8 +305,8 @@ class Activity implements IExtension {
...
@@ -310,8 +305,8 @@ class Activity implements IExtension {
public
function
getQueryForFilter
(
$filter
)
{
public
function
getQueryForFilter
(
$filter
)
{
if
(
$filter
===
self
::
FILTER_SHARES
)
{
if
(
$filter
===
self
::
FILTER_SHARES
)
{
return
[
return
[
'
(
`app` = ?
or `app` = ?)
'
,
'`app` = ?'
,
[
'files_sharing'
,
'files'
],
[
self
::
FILES_SHARING_APP
,
],
];
];
}
}
return
false
;
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment