summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-03-30 17:12:54 +0200
committerLukas Reschke <lukas@owncloud.com>2015-03-30 17:12:54 +0200
commit8e0fef74ffe570b9c159b91a9d8fb1ef7b526aef (patch)
tree3234c58d4a4e99477822b71537a2713743a05140
parentbf17ac929d16b36a131ba9cec7abed304bb78abb (diff)
parent4c9c73bef925d41d8bc9f39f4365c34d794ab86a (diff)
downloadnextcloud-server-8e0fef74ffe570b9c159b91a9d8fb1ef7b526aef.tar.gz
nextcloud-server-8e0fef74ffe570b9c159b91a9d8fb1ef7b526aef.zip
Merge pull request #15312 from owncloud/activity-fix-compilation
Correct the app name for sharing events
-rw-r--r--apps/files_sharing/lib/activity.php19
1 files changed, 7 insertions, 12 deletions
diff --git a/apps/files_sharing/lib/activity.php b/apps/files_sharing/lib/activity.php
index 68953f950c8..a21f57235c9 100644
--- a/apps/files_sharing/lib/activity.php
+++ b/apps/files_sharing/lib/activity.php
@@ -28,6 +28,7 @@ use OCP\Activity\IExtension;
use OCP\IURLGenerator;
class Activity implements IExtension {
+ const FILES_SHARING_APP = 'files_sharing';
/**
* Filter with all sharing related activities
*/
@@ -72,7 +73,7 @@ class Activity implements IExtension {
}
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 {
public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
$l = $this->getL10N($languageCode);
- if ($app === 'files_sharing') {
+ if ($app === self::FILES_SHARING_APP) {
switch ($text) {
case self::SUBJECT_REMOTE_SHARE_RECEIVED:
return (string) $l->t('You received a new remote share from %s', $params);
@@ -160,9 +161,6 @@ class Activity implements IExtension {
return (string) $l->t('Public shared folder %1$s was downloaded', $params);
case self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED:
return (string) $l->t('Public shared file %1$s was downloaded', $params);
- }
- } else if ($app === 'files') {
- switch ($text) {
case self::SUBJECT_SHARED_USER_SELF:
return (string) $l->t('You shared %1$s with %2$s', $params);
case self::SUBJECT_SHARED_GROUP_SELF:
@@ -189,7 +187,7 @@ class Activity implements IExtension {
* @return array|false
*/
public function getSpecialParameterList($app, $text) {
- if ($app === 'files_sharing') {
+ if ($app === self::FILES_SHARING_APP) {
switch ($text) {
case self::SUBJECT_REMOTE_SHARE_RECEIVED:
return array(
@@ -207,9 +205,6 @@ class Activity implements IExtension {
return array(
0 => 'file',
);
- }
- } else if ($app === 'files') {
- switch ($text) {
case self::SUBJECT_SHARED_LINK_SELF:
return [0 => 'file'];
case self::SUBJECT_SHARED_USER_SELF:
@@ -273,7 +268,7 @@ class Activity implements IExtension {
}
/**
- * The extension can check if a customer 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
* @return boolean
@@ -310,8 +305,8 @@ class Activity implements IExtension {
public function getQueryForFilter($filter) {
if ($filter === self::FILTER_SHARES) {
return [
- '(`app` = ? or `app` = ?)',
- ['files_sharing', 'files'],
+ '`app` = ?',
+ [self::FILES_SHARING_APP,],
];
}
return false;