summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-12-12 13:03:26 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-12-12 13:03:26 +0100
commit4f92e4a233a4235cddf7260818fbdf09f67aec49 (patch)
tree7753d5b48df089cb4effeaebd01ee130dc713009 /lib
parentffd5e93f70c5e866d0b1207896c98cef44da9ce6 (diff)
parent46def69574e15b4ec3230c7e6131b882397e210c (diff)
downloadnextcloud-server-4f92e4a233a4235cddf7260818fbdf09f67aec49.tar.gz
nextcloud-server-4f92e4a233a4235cddf7260818fbdf09f67aec49.zip
Merge pull request #12808 from owncloud/add-special-parameterlist-to-manager
Add special parameterlist to manager
Diffstat (limited to 'lib')
-rw-r--r--lib/private/activitymanager.php19
-rw-r--r--lib/public/activity/iextension.php13
-rw-r--r--lib/public/activity/imanager.php7
3 files changed, 39 insertions, 0 deletions
diff --git a/lib/private/activitymanager.php b/lib/private/activitymanager.php
index e0ee7c1b055..70bd227b417 100644
--- a/lib/private/activitymanager.php
+++ b/lib/private/activitymanager.php
@@ -168,6 +168,25 @@ class ActivityManager implements IManager {
}
/**
+ * @param string $app
+ * @param string $text
+ * @return array|false
+ */
+ function getSpecialParameterList($app, $text) {
+ foreach($this->extensions as $extension) {
+ $c = $extension();
+ if ($c instanceof IExtension) {
+ $specialParameter = $c->getSpecialParameterList($app, $text);
+ if (is_array($specialParameter)) {
+ return $specialParameter;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
* @param string $type
* @return string
*/
diff --git a/lib/public/activity/iextension.php b/lib/public/activity/iextension.php
index e78ae0043a6..1b405ad8d3d 100644
--- a/lib/public/activity/iextension.php
+++ b/lib/public/activity/iextension.php
@@ -80,6 +80,19 @@ interface IExtension {
public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode);
/**
+ * 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
+ */
+ function getSpecialParameterList($app, $text);
+
+ /**
* 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.
*
diff --git a/lib/public/activity/imanager.php b/lib/public/activity/imanager.php
index 0a49fdf4999..a08670be4b0 100644
--- a/lib/public/activity/imanager.php
+++ b/lib/public/activity/imanager.php
@@ -100,6 +100,13 @@ interface IManager {
function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode);
/**
+ * @param string $app
+ * @param string $text
+ * @return array|false
+ */
+ function getSpecialParameterList($app, $text);
+
+ /**
* @param string $type
* @return string
*/