30 const NAME =
"foldercontents";
32 function __construct()
34 parent::__construct(self::NAME, array(
39 protected function handle(Request $request)
41 $folderId = intval($request->get(
'folder'));
43 $folderDao = $this->
getObject(
'dao.folder');
45 $childFolders = $folderDao->getFolderChildFolders($folderId);
46 foreach ($childFolders as $folder) {
47 $results[$folder[
'foldercontents_pk']] =
'/'.$folder[
'folder_name'];
49 $childUploads = $folderDao->getFolderChildUploads($folderId,
Auth::getGroupId());
50 foreach ($childUploads as $upload) {
52 $uploadDate = explode(
".",$upload[
'upload_ts'])[0];
53 $uploadStatus =
" (" . $uploadStatus->getTypeName($upload[
'status_fk']) .
")";
54 $results[$upload[
'foldercontents_pk']] = $upload[
'upload_filename'] . _(
" from ") .
Convert2BrowserTime($uploadDate) . $uploadStatus;
57 if (!$request->get(
'removable')) {
58 return new JsonResponse($results);
61 $filterResults = array();
62 foreach ($folderDao->getRemovableContents($folderId) as $content) {
63 $filterResults[$content] = $results[$content];
65 if (empty($filterResults)) {
66 $filterResults[
"-1"] =
"No removable content found";
68 return new JsonResponse($filterResults);
Convert2BrowserTime($server_time)
Convert the server time to browser time.
static getGroupId()
Get the current user's group id.