]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow extensions to specify the list of special parameters
authorJoas Schilling <nickvergessen@gmx.de>
Thu, 11 Dec 2014 13:54:50 +0000 (14:54 +0100)
committerJoas Schilling <nickvergessen@gmx.de>
Thu, 11 Dec 2014 13:56:46 +0000 (14:56 +0100)
lib/private/activitymanager.php
lib/public/activity/iextension.php
lib/public/activity/imanager.php

index e0ee7c1b055a5a853f1965898b638fbbbadec4ee..70bd227b417e755f6a71e8848345396dd15d0f63 100644 (file)
@@ -167,6 +167,25 @@ class ActivityManager implements IManager {
                return false;
        }
 
+       /**
+        * @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
index e78ae0043a6fe8c7864267c6a4fede3d321518cb..1b405ad8d3d24891a105c4d936a09b6323882ded 100644 (file)
@@ -79,6 +79,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.
index 0a49fdf499958b4d916ba0c7f1eaa5ba98e436a0..a08670be4b0d4b2e66922ce42c667c51dfae6382 100644 (file)
@@ -99,6 +99,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