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

Commit 70c07df

Browse files
author
Charles Marion
committed
ENH: 0009614: Create top lvl community's folder
1 parent afad056 commit 70c07df

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

core/controllers/CommunityController.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,10 @@ function manageAction()
183183
}
184184

185185
//init file tree
186-
$this->view->folders = array();
187-
$this->view->folders[] = $communityDao->getPublicFolder();
188-
$this->view->folders[] = $communityDao->getPrivateFolder();
186+
$this->view->mainFolder = $communityDao->getFolder();
187+
188+
$this->view->folders = $this->Folder->getChildrenFoldersFiltered($this->view->mainFolder, $this->userSession->Dao, MIDAS_POLICY_READ);
189+
$this->view->items = $this->Folder->getItemsFiltered($this->view->mainFolder, $this->userSession->Dao, MIDAS_POLICY_READ);
189190
$this->view->Date = $this->Component->Date;
190191

191192
$this->view->header = $this->t("Manage Community");
@@ -273,9 +274,9 @@ function viewAction()
273274
$group_member = $communityDao->getMemberGroup();
274275
$this->view->members = $group_member->getUsers();
275276

276-
$this->view->folders = array();
277-
$this->view->folders[] = $communityDao->getPublicFolder();
278-
$this->view->folders[] = $communityDao->getPrivateFolder();
277+
$this->view->mainFolder = $communityDao->getFolder();
278+
$this->view->folders = $this->Folder->getChildrenFoldersFiltered($this->view->mainFolder, $this->userSession->Dao, MIDAS_POLICY_READ);
279+
$this->view->items = $this->Folder->getItemsFiltered($this->view->mainFolder, $this->userSession->Dao, MIDAS_POLICY_READ);
279280

280281
$this->view->isMember = false;
281282
if($this->userSession->Dao != null)

core/translation/fr-main.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,5 @@ Who can join the community?;Qui peut rejoindre la communaut
219219
Send invitation;Envoyer des invitations
220220
Invite the user ...;Inviter l utilisateur ...
221221
has been invited;a �t� invit�
222-
invited you to the community;vous a invit� � la communaut�
222+
invited you to the community;vous a invit� � la communaut�
223+
Create top level Folder;Cr�er un r�pertoire racine

core/views/community/manage.phtml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,17 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/common/common.bro
187187
echo "</tr>";
188188
$node++;
189189
}
190+
191+
foreach($this->items as $item)
192+
{
193+
echo "<tr id='node--$node' policy='{$item->policy}' privacy='{$item->getPrivacyStatus()}' class='' type='item' element='{$item->getItemId()}' >";
194+
echo " <td class='treeBrowseElement'><span class='file'>{$this->slicename($item->getName(),40)}</span></td>";
195+
echo " <td>{$item->size}</td>";
196+
echo " <td>{$this->Date->ago($item->getDate(),true)}</td>";
197+
echo " <td><input type='checkbox' class='treeCheckbox' type='item' element='{$item->getItemId()}' /></td>";
198+
echo "</tr>";
199+
$node++;
200+
}
190201
?>
191202

192203
</tbody>
@@ -204,6 +215,7 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/common/common.bro
204215
<div class='sideElementFirst genericAction'>
205216
<h1>Actions</h1>
206217
<ul>
218+
<li><a onclick='createNewFolder(".$this->mainFolder->getKey().");'>{$this->t('Create top level Folder')}</a></li>
207219
<li><a href='javascript:;' id='communityDeleteLink'>{$this->t('Delete')}</a></li>
208220
</ul>
209221
</div>";

core/views/community/view.phtml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/common/common.bro
9090
echo "</tr>";
9191
$node++;
9292
}
93+
94+
foreach($this->items as $item)
95+
{
96+
echo "<tr id='node--$node' policy='{$item->policy}' privacy='{$item->getPrivacyStatus()}' class='' type='item' element='{$item->getItemId()}' >";
97+
echo " <td class='treeBrowseElement'><span class='file'>{$this->slicename($item->getName(),40)}</span></td>";
98+
echo " <td>{$item->size}</td>";
99+
echo " <td>{$this->Date->ago($item->getDate(),true)}</td>";
100+
echo " <td><input type='checkbox' class='treeCheckbox' type='item' element='{$item->getItemId()}' /></td>";
101+
echo "</tr>";
102+
$node++;
103+
}
93104
?>
94105

95106
</tbody>

0 commit comments

Comments
 (0)