Commit 661268e8582a8873f5a7e80822cd7d1cda943042
1 parent
189605d5
Use KTBrowseUtil::breadcrumbsForFolder instead of doing it manually.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4060 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
5 additions
and
25 deletions
presentation/lookAndFeel/knowledgeTree/browse.php
| @@ -3,11 +3,7 @@ | @@ -3,11 +3,7 @@ | ||
| 3 | /** | 3 | /** |
| 4 | * $Id$ | 4 | * $Id$ |
| 5 | * | 5 | * |
| 6 | - * Main dashboard page -- This page is presented to the user after login. | ||
| 7 | - * It contains a high level overview of the users subscriptions, checked out | ||
| 8 | - * document, pending approval routing documents, etc. | ||
| 9 | - * | ||
| 10 | - * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | 6 | + * Copyright (c) 2005 Jam Warehouse http://www.jamwarehouse.com |
| 11 | * | 7 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
| @@ -24,7 +20,7 @@ | @@ -24,7 +20,7 @@ | ||
| 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 25 | * | 21 | * |
| 26 | * @version $Revision$ | 22 | * @version $Revision$ |
| 27 | - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | 23 | + * @author Brad Shuttleworth <brad@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 28 | */ | 24 | */ |
| 29 | 25 | ||
| 30 | // main library routines and defaults | 26 | // main library routines and defaults |
| @@ -36,6 +32,7 @@ require_once(KT_LIB_DIR . "/util/ktutil.inc"); | @@ -36,6 +32,7 @@ require_once(KT_LIB_DIR . "/util/ktutil.inc"); | ||
| 36 | require_once(KT_LIB_DIR . "/browse/DocumentCollection.inc.php"); | 32 | require_once(KT_LIB_DIR . "/browse/DocumentCollection.inc.php"); |
| 37 | require_once(KT_LIB_DIR . "/browse/BrowseColumns.inc.php"); | 33 | require_once(KT_LIB_DIR . "/browse/BrowseColumns.inc.php"); |
| 38 | require_once(KT_LIB_DIR . "/browse/PartialQuery.inc.php"); | 34 | require_once(KT_LIB_DIR . "/browse/PartialQuery.inc.php"); |
| 35 | +require_once(KT_LIB_DIR . "/browse/browseutil.inc.php"); | ||
| 39 | 36 | ||
| 40 | require_once(KT_LIB_DIR . "/foldermanagement/Folder.inc"); | 37 | require_once(KT_LIB_DIR . "/foldermanagement/Folder.inc"); |
| 41 | 38 | ||
| @@ -85,25 +82,8 @@ class BrowseDispatcher extends KTStandardDispatcher { | @@ -85,25 +82,8 @@ class BrowseDispatcher extends KTStandardDispatcher { | ||
| 85 | $collection->addColumn(new BrowseColumn("Test 3","test3")); | 82 | $collection->addColumn(new BrowseColumn("Test 3","test3")); |
| 86 | $collection->addColumn(new BrowseColumn("Test 4","test4")); | 83 | $collection->addColumn(new BrowseColumn("Test 4","test4")); |
| 87 | 84 | ||
| 88 | - // do the breadcrumbs. | ||
| 89 | - | ||
| 90 | - // skip root. | ||
| 91 | - $folder_path_names = array_slice($this->oFolder->getPathArray(), 1); | ||
| 92 | - $folder_path_ids = array_slice(explode(',', $this->oFolder->getParentFolderIds()), 1); | ||
| 93 | - | ||
| 94 | - $parents = count($folder_path_ids); | ||
| 95 | - | ||
| 96 | - if ($parents != 0) { | ||
| 97 | - foreach (range(0,$parents) as $index) { | ||
| 98 | - $this->aBreadcrumbs[] = array("url" => "?fFolderId=" . $folder_path_ids[$index], "name" => $folder_path_names[$index]); | ||
| 99 | - } | ||
| 100 | - } | ||
| 101 | - | ||
| 102 | - // now add this folder, _if we aren't in 1_. | ||
| 103 | - if ($this->oFolder->getId() != 1) { | ||
| 104 | - $this->aBreadcrumbs[] = array("name" => $this->oFolder->getName()); | ||
| 105 | - } | ||
| 106 | - | 85 | + $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, |
| 86 | + KTBrowseUtil::breadcrumbsForFolder($this->oFolder)); | ||
| 107 | // setup the folderside add actions | 87 | // setup the folderside add actions |
| 108 | // FIXME do we want to use folder actions? | 88 | // FIXME do we want to use folder actions? |
| 109 | $portlet = new KTActionPortlet("Folder Actions"); | 89 | $portlet = new KTActionPortlet("Folder Actions"); |