Exemple #1
0
 /**
  * @param Request $request
  * @return JsonResponse
  */
 protected function respondFolderGetTableData(Request $request)
 {
     /* Get list of uploads in this folder */
     list($result, $iTotalDisplayRecords, $iTotalRecords) = $this->getListOfUploadsOfFolder($request);
     $uri = Traceback_uri() . "?mod=license";
     /* Browse-Pfile menu */
     $menuPfile = menu_find("Browse-Pfile", $menuDepth);
     /* Browse-Pfile menu without the compare menu item */
     $menuPfileNoCompare = menu_remove($menuPfile, "Compare");
     $users = $this->userDao->getUserChoices();
     $statusTypesAvailable = $this->uploadDao->getStatusTypeMap();
     if (!$this->userPerm) {
         unset($statusTypesAvailable[4]);
     }
     $output = array();
     $rowCounter = 0;
     while ($row = $this->dbManager->fetchArray($result)) {
         if (empty($row['upload_pk']) || !$this->uploadDao->isAccessible($row['upload_pk'], Auth::getGroupId())) {
             continue;
         }
         $rowCounter++;
         $output[] = $this->showRow($row, $request, $uri, $menuPfile, $menuPfileNoCompare, $statusTypesAvailable, $users, $rowCounter);
     }
     $this->dbManager->freeResult($result);
     return new JsonResponse(array('sEcho' => intval($request->get('sEcho')), 'aaData' => $output, 'iTotalRecords' => $iTotalRecords, 'iTotalDisplayRecords' => $iTotalDisplayRecords));
 }
Exemple #2
0
 /**
  * @brief Given a folderId, list every item in it.
  * If it is an individual file, then list the file contents.
  */
 private function ShowFolder($folderId)
 {
     $rootFolder = $this->folderDao->getRootFolder(Auth::getUserId());
     /* @var $uiFolderNav FolderNav */
     $uiFolderNav = $GLOBALS['container']->get('ui.folder.nav');
     $folderNav = '<div id="sidetree">';
     if ($folderId != $rootFolder->getId()) {
         $folderNav .= '<div class="treeheader" style="display:inline;"><a href="' . Traceback_uri() . '?mod=' . $this->Name . '">Top</a> | </div>';
     }
     $folderNav .= '<div id="sidetreecontrol" class="treeheader" style="display:inline;"><a href="?#">Collapse All</a> | <a href="?#">Expand All</a></div>';
     $folderNav .= $uiFolderNav->showFolderTree($folderId) . '</div>';
     $this->vars['folderNav'] = $folderNav;
     $assigneeArray = $this->getAssigneeArray();
     $this->vars['assigneeOptions'] = $assigneeArray;
     $this->vars['statusOptions'] = $this->uploadDao->getStatusTypeMap();
     $this->vars['folder'] = $folderId;
     $this->vars['folderName'] = $rootFolder->getName();
 }