build the path up so that breadcrumb paths work
authorChuck Hagenbuch <chuck@horde.org>
Fri, 27 Mar 2009 20:15:51 +0000 (16:15 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Fri, 27 Mar 2009 20:15:51 +0000 (16:15 -0400)
chora/lib/Chora.php

index 4f1420b..2aaf578 100644 (file)
@@ -184,9 +184,14 @@ class Chora
         $dirs = explode('/', $where);
         $dir_count = count($dirs) - 1;
 
+        $path = '';
         foreach ($dirs as $i => $dir) {
+            if (!empty($path)) {
+                $path .= '/';
+            }
+            $path .= $dir;
             if (!empty($dir)) {
-                $bar .= '/ <a href="' . self::url('browsedir', $dir . ($i == $dir_count ? '' : '/')) . '">'. Text::htmlallspaces($dir) . '</a> ';
+                $bar .= '/ <a href="' . self::url('browsedir', $path . ($i == $dir_count && !$GLOBALS['atdir'] ? '' : '/')) . '">'. Text::htmlallspaces($dir) . '</a> ';
             }
         }