Commit 4e22e64bfc4da824d623c5240ab59c621c2e3c4e

Authored by nbm
1 parent 4a156bb6

Use Folder Details to check whether to be able to see the details of a

folder.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5527 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 12 additions and 4 deletions
lib/browse/browseutil.inc.php
@@ -194,8 +194,12 @@ class KTBrowseUtil { @@ -194,8 +194,12 @@ class KTBrowseUtil {
194 foreach (range(0, $parents - 1) as $index) { 194 foreach (range(0, $parents - 1) as $index) {
195 $id = $folder_path_ids[$index]; 195 $id = $folder_path_ids[$index];
196 $oThisFolder = Folder::get($id); 196 $oThisFolder = Folder::get($id);
197 - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, 'ktcore.permissions.read', $oThisFolder)) {  
198 - $aBreadcrumbs[] = array('name' => '...'); 197 + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, 'ktcore.permissions.folder_details', $oThisFolder)) {
  198 + if (KTBrowseUtil::inAdminMode($oUser, $oThisFolder)) {
  199 + $aBreadcrumbs[] = array("url" => $url, "name" => sprintf('(%s)', $folder_path_names[$index]));
  200 + } else {
  201 + $aBreadcrumbs[] = array('name' => '...');
  202 + }
199 continue; 203 continue;
200 } 204 }
201 $url = KTUtil::addQueryStringSelf("fFolderId=" . $id); 205 $url = KTUtil::addQueryStringSelf("fFolderId=" . $id);
@@ -208,8 +212,12 @@ class KTBrowseUtil { @@ -208,8 +212,12 @@ class KTBrowseUtil {
208 212
209 // now add this folder, _if we aren't in 1_. 213 // now add this folder, _if we aren't in 1_.
210 if ($oFolder->getId() != 1) { 214 if ($oFolder->getId() != 1) {
211 - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, 'ktcore.permissions.read', $oFolder)) {  
212 - $aBreadcrumbs[] = array('name' => '...'); 215 + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, 'ktcore.permissions.folder_details', $oFolder)) {
  216 + if (KTBrowseUtil::inAdminMode($oUser, $oFolder)) {
  217 + $aBreadcrumbs[] = array("url" => $url, "name" => sprintf('(%s)', $oFolder->getName()));
  218 + } else {
  219 + $aBreadcrumbs[] = array('name' => '...');
  220 + }
213 } else if ($bFinal) { 221 } else if ($bFinal) {
214 $aBreadcrumbs[] = array("name" => $oFolder->getName()); 222 $aBreadcrumbs[] = array("name" => $oFolder->getName());
215 } else { 223 } else {