diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-12-11 14:55:20 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-12-12 11:41:01 +0100 |
commit | 46def69574e15b4ec3230c7e6131b882397e210c (patch) | |
tree | 3058b8e163d24fbc48952f0f873141caf35dc73b /apps/files_sharing/lib | |
parent | e3dfddb48a5f33a1d368ef92d49b09931b7c289d (diff) | |
download | nextcloud-server-46def69574e15b4ec3230c7e6131b882397e210c.tar.gz nextcloud-server-46def69574e15b4ec3230c7e6131b882397e210c.zip |
Specify list of activity parameters for sharing extension
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/activity.php | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/activity.php b/apps/files_sharing/lib/activity.php index 0f7e8ab9b63..979df1c1da6 100644 --- a/apps/files_sharing/lib/activity.php +++ b/apps/files_sharing/lib/activity.php @@ -94,16 +94,47 @@ class Activity implements \OCP\Activity\IExtension { case self::SUBJECT_REMOTE_SHARE_RECEIVED: return $l->t('You received a new remote share from %s', $params)->__toString(); case self::SUBJECT_REMOTE_SHARE_ACCEPTED: - return $l->t('%1$s accepted remote share <strong>%2$s</strong>', $params)->__toString(); + return $l->t('%1$s accepted remote share %2$s', $params)->__toString(); case self::SUBJECT_REMOTE_SHARE_DECLINED: - return $l->t('%1$s declined remote share <strong>%2$s</strong>', $params)->__toString(); + return $l->t('%1$s declined remote share %2$s', $params)->__toString(); case self::SUBJECT_REMOTE_SHARE_UNSHARED: - return $l->t('%1$s unshared <strong>%2$s</strong>', $params)->__toString(); + return $l->t('%1$s unshared %2$s', $params)->__toString(); } } } /** + * The extension can define the type of parameters for translation + * + * Currently known types are: + * * file => will strip away the path of the file and add a tooltip with it + * * username => will add the avatar of the user + * + * @param string $app + * @param string $text + * @return array|false + */ + public function getSpecialParameterList($app, $text) { + if ($app === 'files_sharing') { + switch ($text) { + case self::SUBJECT_REMOTE_SHARE_RECEIVED: + return array( + 0 => '',// We can not use 'username' since the user is in a different ownCloud + ); + case self::SUBJECT_REMOTE_SHARE_ACCEPTED: + case self::SUBJECT_REMOTE_SHARE_DECLINED: + case self::SUBJECT_REMOTE_SHARE_UNSHARED: + return array( + 0 => '',// We can not use 'username' since the user is in a different ownCloud + 1 => 'file', + ); + } + } + + return false; + } + + /** * A string naming the css class for the icon to be used can be returned. * If no icon is known for the given type false is to be returned. * |