Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
BUG: fixed a but with recent folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Marion committed Jun 3, 2011
1 parent 00d5816 commit e66f00f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
10 changes: 5 additions & 5 deletions core/controllers/BrowseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,14 @@ public function getelementinfoAction()
$folder = $this->Folder->load($id);
$jsonContent = array_merge($jsonContent, $folder->toArray());
$jsonContent['creation'] = $this->Component->Date->formatDate(strtotime($jsonContent['date_update']));
if(!isset($this->userSession->Dao->recentFolders))
if(!isset($this->userSession->recentFolders))
{
$this->userSession->Dao->recentFolders = array();
$this->userSession->recentFolders = array();
}
array_push($this->userSession->Dao->recentFolders, $folder->getKey());
if(count($this->userSession->Dao->recentFolders) > 5)
array_push($this->userSession->recentFolders, $folder->getKey());
if(count($this->userSession->recentFolders) > 5)
{
array_shift($this->userSession->Dao->recentFolders);
array_shift($this->userSession->recentFolders);
}
break;
case 'item':
Expand Down
10 changes: 5 additions & 5 deletions core/controllers/FolderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ public function viewAction()
$header .= "</ul>";
}

if(!isset($this->userSession->Dao->recentFolders))
if(!isset($this->userSession->recentFolders))
{
$this->userSession->Dao->recentFolders = array();
$this->userSession->recentFolders = array();
}
array_push($this->userSession->Dao->recentFolders, $folder->getKey());
if(count($this->userSession->Dao->recentFolders) > 5)
array_push($this->userSession->recentFolders, $folder->getKey());
if(count($this->userSession->recentFolders) > 5)
{
array_shift($this->userSession->Dao->recentFolders);
array_shift($this->userSession->recentFolders);
}

$this->Folder->incrementViewCount($folder);
Expand Down
4 changes: 2 additions & 2 deletions core/controllers/ItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ function viewAction()
else
{
$parents = $itemDao->getFolders();
if(isset($this->userSession->Dao->recentFolders))
if(isset($this->userSession->recentFolders))
{
foreach($parents as $p)
{
if(in_array($p->getKey(), $this->userSession->Dao->recentFolders))
if(in_array($p->getKey(), $this->userSession->recentFolders))
{
$currentFolder = $p;
break;
Expand Down
1 change: 1 addition & 0 deletions core/public/js/common/common.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
{
html+='<img class="infoLogo" alt="Data Type" src="'+json.global.coreWebroot+'/public/images/icons/document-big.png" />';
}
console.log(arrayElement['name']);
html+='<span class="infoTitle" >'+sliceFileName(arrayElement['name'],27)+'</span>';
html+='<table>';
html+=' <tr>';
Expand Down
6 changes: 3 additions & 3 deletions core/public/js/layout/jquery.treeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
// var padding=parseInt(node.find('td:first').css('padding-left').slice(0,-2));

var j = 1;

var sliceValue = 42 - (id.split('-').length - 1)*3;

$.each(elements['folders'], function(index, value) {
if(j > 70)
Expand All @@ -345,7 +345,7 @@
return;
}
html+= "<tr id='"+id+"-"+i+"' deletable='"+value['deletable']+"' privacy='"+value['privacy_status']+"' class='parent child-of-"+id+"' ajax='"+value['folder_id']+"'type='folder' policy='"+value['policy']+"' element='"+value['folder_id']+"'>";
html+= " <td><span class='folder'>"+sliceFileName(value['name'],40)+"</span></td>";
html+= " <td><span class='folder'>"+sliceFileName(value['name'],sliceValue)+"</span></td>";
html+= " <td>"+'<img class="folderLoading" element="'+value['folder_id']+'" alt="" src="'+json.global.coreWebroot+'/public/images/icons/loading.gif"/>'+"</td>";
html+= " <td>"+value['date_update']+"</td>";
html+= " <td><input type='checkbox' class='treeCheckbox' type='folder' element='"+value['folder_id']+"'/></td>";
Expand All @@ -366,7 +366,7 @@
return;
}
html+= "<tr id='"+id+"-"+i+"' class='child-of-"+id+"' privacy='"+value['privacy_status']+"' type='item' policy='"+value['policy']+"' element='"+value['item_id']+"'>";
html+= " <td><span class='file'>"+sliceFileName(value['name'],40)+"</span></td>";
html+= " <td><span class='file'>"+sliceFileName(value['name'],sliceValue)+"</span></td>";
html+= " <td>"+value['size']+"</td>";
html+= " <td>"+value['date_update']+"</td>";
html+= " <td><input type='checkbox' class='treeCheckbox' type='item' element='"+value['item_id']+"'/></td>";
Expand Down

0 comments on commit e66f00f

Please sign in to comment.