Commit 532dedfd111d8fb2d0884a1264d488ecdb5edf6c

Authored by kevin_fourie
1 parent ee2c4032

KTS-1602

"Administrator mode - always go to "Root Folder" when using Bread Crumb menu navigation"
Verified and applied patch.

Reviewed By: Conrad



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6189 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 9 additions and 9 deletions
lib/browse/browseutil.inc.php
... ... @@ -198,6 +198,10 @@ class KTBrowseUtil {
198 198 foreach (range(0, $parents - 1) as $index) {
199 199 $id = $folder_path_ids[$index];
200 200 $oThisFolder = Folder::get($id);
  201 + $url = KTUtil::addQueryStringSelf("fFolderId=" . $id);
  202 + if (!empty($sAction)) {
  203 + $url = generateControllerUrl($sAction, "fFolderId=" . $id);
  204 + }
201 205 if (!KTPermissionUtil::userHasPermissionOnItem($oUser, 'ktcore.permissions.folder_details', $oThisFolder)) {
202 206 if (KTBrowseUtil::inAdminMode($oUser, $oThisFolder)) {
203 207 $aBreadcrumbs[] = array("url" => $url, "name" => sprintf('(%s)', $folder_path_names[$index]));
... ... @@ -206,16 +210,17 @@ class KTBrowseUtil {
206 210 }
207 211 continue;
208 212 }
209   - $url = KTUtil::addQueryStringSelf("fFolderId=" . $id);
210   - if (!empty($sAction)) {
211   - $url = generateControllerUrl($sAction, "fFolderId=" . $id);
212   - }
213 213 $aBreadcrumbs[] = array("url" => $url, "name" => $folder_path_names[$index]);
214 214 }
215 215 }
216 216  
217 217 // now add this folder, _if we aren't in 1_.
218 218 if ($oFolder->getId() != 1) {
  219 + $id = $oFolder->getId();
  220 + $url = KTUtil::addQueryStringSelf("fFolderId=" . $id);
  221 + if (!empty($sAction)) {
  222 + $url = generateControllerUrl($sAction, "fFolderId=" . $id);
  223 + }
219 224 if (!KTPermissionUtil::userHasPermissionOnItem($oUser, 'ktcore.permissions.folder_details', $oFolder)) {
220 225 if (KTBrowseUtil::inAdminMode($oUser, $oFolder)) {
221 226 $aBreadcrumbs[] = array("url" => $url, "name" => sprintf('(%s)', $oFolder->getName()));
... ... @@ -225,11 +230,6 @@ class KTBrowseUtil {
225 230 } else if ($bFinal) {
226 231 $aBreadcrumbs[] = array("name" => $oFolder->getName());
227 232 } else {
228   - $id = $oFolder->getId();
229   - $url = KTUtil::addQueryStringSelf("fFolderId=" . $id);
230   - if (!empty($sAction)) {
231   - $url = generateControllerUrl($sAction, "fFolderId=" . $id);
232   - }
233 233 $aBreadcrumbs[] = array("url" => $url, "name" => $oFolder->getName());
234 234 }
235 235 }
... ...