From fbe54043cf598b19a753dc2b21a7ed558d23fd15 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Thu, 18 Aug 2011 13:40:07 -0400
Subject: [PATCH] Fix folders drop-down list: descend into root folder (e.g. INBOX) even if part of the exception list

---
 program/include/rcube_template.php |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php
index a672c50..f5c741f 100755
--- a/program/include/rcube_template.php
+++ b/program/include/rcube_template.php
@@ -248,8 +248,15 @@
     public function show_message($message, $type='notice', $vars=null, $override=true, $timeout=0)
     {
         if ($override || !$this->message) {
+            if (rcube_label_exists($message)) {
+                if (!empty($vars))
+                    $vars = array_map('Q', $vars);
+                $msgtext = rcube_label(array('name' => $message, 'vars' => $vars));
+            }
+            else
+                $msgtext = $message;
+
             $this->message = $message;
-            $msgtext = rcube_label_exists($message) ? rcube_label(array('name' => $message, 'vars' => $vars)) : $message;
             $this->command('display_message', $msgtext, $type, $timeout * 1000);
         }
     }
@@ -674,7 +681,9 @@
             // show a label
             case 'label':
                 if ($attrib['name'] || $attrib['command']) {
-                    $label = rcube_label($attrib + array('vars' => array('product' => $this->config['product_name'])));
+                    $vars = $attrib + array('product' => $this->config['product_name']);
+                    unset($vars['name'], $vars['command']);
+                    $label = rcube_label($attrib + array('vars' => $vars));
                     return !$attrbi['noshow'] ? Q($label) : '';
                 }
                 break;
@@ -748,7 +757,12 @@
                   $content = Q($this->get_pagetitle());
                 }
                 else if ($object == 'pagetitle') {
-                    $title = !empty($this->config['product_name']) ? $this->config['product_name'].' :: ' : '';
+                    if (!empty($this->config['devel_mode']) && !empty($_SESSION['username']))
+                      $title = $_SESSION['username'].' :: ';
+                    else if (!empty($this->config['product_name']))
+                      $title = $this->config['product_name'].' :: ';
+                    else
+                      $title = '';
                     $title .= $this->get_pagetitle();
                     $content = Q($title);
                 }

--
Gitblit v1.9.1