Index: trunk/lib/Navigation.inc.php
===================================================================
--- trunk/lib/Navigation.inc.php	(revision 484)
+++ trunk/lib/Navigation.inc.php	(revision 485)
@@ -198,4 +198,22 @@
 
     /**
+     * Returns the path from root up to the current page as an array.
+     *
+     * @access  public
+     * @param   string   $key   Which value to use in the path (usually head_title or body_title or just title).
+     * @return  mixed           Path (string) or false if path param is not set.
+     */
+    public function getPathArray($key='title')
+    {
+        $path = array();
+        if ($this->getParam('path')) {
+            foreach ($this->pages as $page) {
+                $path[] = strip_tags($page[$key]);
+            }
+        }
+        return $path;
+    }
+
+    /**
      * Returns the text path from root up to the current page, separated by the
      * path_delimiter.
@@ -207,14 +225,63 @@
     public function getPath($key='title')
     {
-        if ($this->getParam('path')) {
-            $path = '';
-            $pathmark = '';
+
+        $path = $this->getPathArray();
+        return empty($path) ? '' : join(oTxt($this->getParam('path_delimiter'), true), $path);
+    }
+
+    /**
+     * Returns the breadcrumbs from the root page to the current page.
+     * Breadcrumbs are the text path with pages titles linked to that page.
+     *
+     * @access  public
+     * @return  string   Breadcrumbs or empty string if breadcrumbs param not set.
+     */
+    public function getBreadcrumbsArray()
+    {
+        $app =& App::getInstance();
+
+        if ($this->getParam('breadcrumbs')) {
+            $breadcrumbs = array();
+            $crumb_count = sizeof($this->pages);
             foreach ($this->pages as $page) {
-                $path .= oTxt($pathmark . strip_tags($page[$key]), true);
-                $pathmark = $this->getParam('path_delimiter');
-            }
-            return $path;
+                if ($crumb_count <= $this->getParam('chop_breadcrumbs')) {
+                    // Stop gathering crumbs.
+                    break;
+                }
+                if ($crumb_count <= 1) {
+                    // The last crumb.
+                    if ('' == trim($page['url']) || $crumb_count <= $this->getParam('chop_breadcrumb_links')) {
+                        // A crumb with no link.
+                        $breadcrumbs[] = array(
+                            'url' => false,
+                            'title' => sprintf($this->getParam('last_crumb_format'), $page['title'])
+                        );
+                    } else if ($crumb_count > $this->getParam('chop_breadcrumb_links')) {
+                        // A normal linked crumb.
+                        $breadcrumbs[] = array(
+                            'url' => $page['url'],
+                            'title' => sprintf($this->getParam('last_crumb_format'), $page['title'])
+                        );
+                    }
+                } else {
+                    if ('' == trim($page['url'])) {
+                        // A crumb with no link.
+                        $breadcrumbs[] = array(
+                            'url' => false,
+                            'title' => $page['title']
+                        );
+                    } else {
+                        // A normal linked crumb.
+                        $breadcrumbs[] = array(
+                            'url' => $page['url'],
+                            'title' => $page['title']
+                        );
+                    }
+                }
+                $crumb_count--;
+            }
+            return $breadcrumbs;
         } else {
-            return false;
+            return array();
         }
     }
@@ -247,5 +314,5 @@
                     } else if ($crumb_count > $this->getParam('chop_breadcrumb_links')) {
                         // A normal linked crumb.
-                        $breadcrumbs[] =  '<a href="' . $app->oHREF($page['url']) . '">' . sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true)) . '</a>';
+                        $breadcrumbs[] =  '<a href="' . $page['url'] . '">' . sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true)) . '</a>';
                     }
                 } else {
@@ -255,5 +322,5 @@
                     } else {
                         // A normal linked crumb.
-                        $breadcrumbs[] = '<a href="' . $app->oHREF($page['url']) . '">' . oTxt($page['title'], true) . '</a>';
+                        $breadcrumbs[] = '<a href="' . $page['url'] . '">' . oTxt($page['title'], true) . '</a>';
                     }
                 }
