From df618da530cccfcf5829abe009df875f57cbf8ec Mon Sep 17 00:00:00 2001
From: Dennis1993 <marvin-wegener@outlook.com>
Date: Tue, 06 Aug 2013 13:23:36 -0400
Subject: [PATCH] Update compose.html

---
 program/lib/Roundcube/rcube_plugin.php |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/program/lib/Roundcube/rcube_plugin.php b/program/lib/Roundcube/rcube_plugin.php
index 167a9eb..3153a84 100644
--- a/program/lib/Roundcube/rcube_plugin.php
+++ b/program/lib/Roundcube/rcube_plugin.php
@@ -92,6 +92,16 @@
     abstract function init();
 
     /**
+     * Provide information about this
+     *
+     * @return array Meta information about a plugin or false if not implemented
+     */
+    public static function info()
+    {
+        return false;
+    }
+
+    /**
      * Attempt to load the given plugin which is required for the current plugin
      *
      * @param string Plugin name
@@ -217,7 +227,7 @@
             $rcube->load_language($lang, $add);
 
             // add labels to client
-            if ($add2client) {
+            if ($add2client && method_exists($rcube->output, 'add_label')) {
                 if (is_array($add2client)) {
                     $js_labels = array_map(array($this, 'label_map_callback'), $add2client);
                 }
@@ -226,6 +236,24 @@
                 }
                 $rcube->output->add_label($js_labels);
             }
+        }
+    }
+
+    /**
+     * Wrapper for add_label() adding the plugin ID as domain
+     */
+    public function add_label()
+    {
+        $rcube = rcube::get_instance();
+
+        if (method_exists($rcube->output, 'add_label')) {
+            $args = func_get_args();
+            if (count($args) == 1 && is_array($args[0])) {
+                $args = $args[0];
+            }
+
+            $args = array_map(array($this, 'label_map_callback'), $args);
+            $rcube->output->add_label($args);
         }
     }
 
@@ -380,6 +408,10 @@
      */
     private function label_map_callback($key)
     {
+        if (strpos($key, $this->ID.'.') === 0) {
+            return $key;
+        }
+
         return $this->ID.'.'.$key;
     }
 }

--
Gitblit v1.9.1