Branch 'roundcubemail-plugins-kolab-3.1' - plugins/calendar plugins/libkolab plugins/tasklist

Aleksander Machniak machniak at kolabsys.com
Thu Nov 21 15:14:06 CET 2013


 plugins/calendar/skins/larry/calendar.css |    3 ++-
 plugins/libkolab/lib/kolab_storage.php    |   29 +++++++++++++++++++++++++----
 plugins/tasklist/skins/larry/tasklist.css |    4 ++--
 3 files changed, 29 insertions(+), 7 deletions(-)

New commits:
commit abe9b7eae8230fc4bd3fe6997a57cc4503557742
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Thu Nov 21 15:12:15 2013 +0100

    Improve other users folders display on the hierarchized folders list (Bug #2377)

diff --git a/plugins/calendar/skins/larry/calendar.css b/plugins/calendar/skins/larry/calendar.css
index a8926b6..7baa487 100644
--- a/plugins/calendar/skins/larry/calendar.css
+++ b/plugins/calendar/skins/larry/calendar.css
@@ -158,7 +158,7 @@ pre {
 }
 
 #calendarslist li.virtual {
-	padding-top: 2px;
+	height: 12px;
 }
 
 #calendarslist li label {
@@ -231,6 +231,7 @@ pre {
 
 #calendarslist li.virtual span.calname {
 	color: #aaa;
+	top: 2px;
 }
 
 #calfeedurl,
diff --git a/plugins/libkolab/lib/kolab_storage.php b/plugins/libkolab/lib/kolab_storage.php
index a95a59e..d6e7043 100644
--- a/plugins/libkolab/lib/kolab_storage.php
+++ b/plugins/libkolab/lib/kolab_storage.php
@@ -437,9 +437,10 @@ class kolab_storage
                         $folder = substr($folder, $pos+1);
                     }
                     else {
-                        $prefix = '('.$folder.')';
+                        $prefix = $folder;
                         $folder = '';
                     }
+
                     $found  = true;
                     $folder_ns = 'other';
                     break;
@@ -467,7 +468,7 @@ class kolab_storage
         $folder = str_replace(html::quote($delim), ' » ', $folder);
 
         if ($prefix)
-            $folder = html::quote($prefix) . ' ' . $folder;
+            $folder = html::quote($prefix) . ($folder !== '' ? ' ' . $folder : '');
 
         if (!$folder_ns)
             $folder_ns = 'personal';
@@ -492,7 +493,8 @@ class kolab_storage
     }
 
     /**
-     * Helper method to generate a truncated folder name to display
+     * Helper method to generate a truncated folder name to display.
+     * Note: $origname is a string returned by self::object_name()
      */
     public static function folder_displayname($origname, &$names)
     {
@@ -504,10 +506,29 @@ class kolab_storage
                 $length = strlen($names[$i] . ' » ');
                 $prefix = substr($name, 0, $length);
                 $count  = count(explode(' » ', $prefix));
-                $name   = str_repeat('   ', $count-1) . '» ' . substr($name, $length);
+                $diff   = 1;
+
+                // check if prefix folder is in other users namespace
+                for ($n = count($names)-1; $n >= 0; $n--) {
+                    if (strpos($prefix, '(' . $names[$n] . ') ') === 0) {
+                        $diff = 0;
+                        break;
+                    }
+                }
+
+                $name = str_repeat('   ', $count - $diff) . '» ' . substr($name, $length);
+                break;
+            }
+            // other users namespace and parent folder exists
+            else if (strpos($name, '(' . $names[$i] . ') ') === 0) {
+                $length = strlen('(' . $names[$i] . ') ');
+                $prefix = substr($name, 0, $length);
+                $count  = count(explode(' » ', $prefix));
+                $name   = str_repeat('   ', $count) . '» ' . substr($name, $length);
                 break;
             }
         }
+
         $names[] = $origname;
 
         return $name;
diff --git a/plugins/tasklist/skins/larry/tasklist.css b/plugins/tasklist/skins/larry/tasklist.css
index 7a1df99..b9d10c6 100644
--- a/plugins/tasklist/skins/larry/tasklist.css
+++ b/plugins/tasklist/skins/larry/tasklist.css
@@ -226,8 +226,7 @@ body.attachmentwin #topnav .topright {
 }
 
 #tasklists li.virtual {
-	padding-top: 4px;
-	height: 16px;
+	height: 12px;
 }
 
 #tasklists li label {
@@ -293,6 +292,7 @@ body.attachmentwin #topnav .topright {
 
 #tasklists li.virtual span.listname {
 	color: #aaa;
+	top: 2px;
 }
 
 #tasklists li.virtual span.handle {




More information about the commits mailing list