From f25be2b863ec997dbe49d655db3a5a80a1f17bb7 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Wed, 04 Jun 2014 09:45:17 -0400
Subject: [PATCH] Render localized texts for icon-style messagelist headers

---
 program/lib/Roundcube/rcube_plugin.php |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/program/lib/Roundcube/rcube_plugin.php b/program/lib/Roundcube/rcube_plugin.php
index a571609..f0af953 100644
--- a/program/lib/Roundcube/rcube_plugin.php
+++ b/program/lib/Roundcube/rcube_plugin.php
@@ -125,22 +125,16 @@
         $fpath = $this->home.'/'.$fname;
         $rcube = rcube::get_instance();
 
-        if (is_file($fpath) && !$rcube->config->load_from_file($fpath)) {
+        if (($is_local = is_file($fpath)) && !$rcube->config->load_from_file($fpath)) {
             rcube::raise_error(array(
                 'code' => 527, 'type' => 'php',
                 'file' => __FILE__, 'line' => __LINE__,
                 'message' => "Failed to load config from $fpath"), true, false);
             return false;
-        } else {
-            $fname = $this->ID . '.inc.php';
+        }
+        else if (!$is_local) {
             // Search plugin_name.inc.php file in any configured path
-            if (!$rcube->config->load_from_file($fname)) {
-                rcube::raise_error(array(
-                    'code' => 527, 'type' => 'php',
-                    'file' => __FILE__, 'line' => __LINE__,
-                    'message' => "Failed to load $fname config file from any configured path"), true, false);
-                return false;
-            }
+            return $rcube->config->load_from_file($this->ID . '.inc.php');
         }
 
         return true;

--
Gitblit v1.9.1