* @param Request $request
     *
     * @return Symfony\Component\HttpFoundation\Response JSON response
     */
    public function indexAction(Request $request)
    {
        /*
         * Validate
         */
        if (true !== ($notValid = $this->validateRequest($request, 'GET'))) {
            return new Response(json_encode($notValid), Response::HTTP_OK, ['content-type' => 'application/javascript']);
        }
        $this->validateAccessForRole('ROLE_ACCESS_DOCUMENTS');
        $arrayFilter = [];
        /*
         * Manage get request to filter list
         */
        $listManager = $this->createEntityListManager('RZ\\Roadiz\\Core\\Entities\\Document', $arrayFilter);
        $listManager->setItemPerPage(30);
        $listManager->handle();
        $documents = $listManager->getEntities();
        $documentsArray = [];
        foreach ($documents as $doc) {
            $documentsArray[] = ['id' => $doc->getId(), 'filename' => $doc->getFilename(), 'thumbnail' => $doc->getViewer()->getDocumentUrlByArray(AjaxDocumentsExplorerController::$thumbnailArray), 'html' => $this->getTwig()->render('widgets/documentSmallThumbnail.html.twig', ['document' => $doc])];
        }
        $responseArray = ['status' => 'confirm', 'statusCode' => 200, 'documents' => $documentsArray, 'documentsCount' => count($documents), 'filters' => $listManager->getAssignation()];
        return new Response(json_encode($responseArray), Response::HTTP_OK, ['content-type' => 'application/javascript']);
    }
}
AjaxDocumentsExplorerController::$thumbnailArray = ["width" => 40, "crop" => "1x1", "quality" => 50];
    public function indexAction(Request $request)
    {
        /*
         * Validate
         */
        if (true !== ($notValid = $this->validateRequest($request, 'GET'))) {
            return new Response(json_encode($notValid), Response::HTTP_OK, ['content-type' => 'application/javascript']);
        }
        $this->validateAccessForRole('ROLE_ACCESS_DOCUMENTS');
        $arrayFilter = [];
        if ($request->get('folderId') > 0) {
            $folder = $this->getService('em')->find('RZ\\Roadiz\\Core\\Entities\\Folder', $request->get('folderId'));
            $arrayFilter['folders'] = [$folder];
        }
        /*
         * Manage get request to filter list
         */
        $listManager = $this->createEntityListManager('RZ\\Roadiz\\Core\\Entities\\Document', $arrayFilter, ['createdAt' => 'DESC']);
        $listManager->setItemPerPage(30);
        $listManager->handle();
        $documents = $listManager->getEntities();
        $documentsArray = [];
        foreach ($documents as $doc) {
            $documentsArray[] = ['id' => $doc->getId(), 'filename' => $doc->getFilename(), 'thumbnail' => $doc->getViewer()->getDocumentUrlByArray(AjaxDocumentsExplorerController::$thumbnailArray), 'html' => $this->getTwig()->render('widgets/documentSmallThumbnail.html.twig', ['document' => $doc])];
        }
        $responseArray = ['status' => 'confirm', 'statusCode' => 200, 'documents' => $documentsArray, 'documentsCount' => count($documents), 'filters' => $listManager->getAssignation()];
        return new Response(json_encode($responseArray), Response::HTTP_OK, ['content-type' => 'application/javascript']);
    }
}
AjaxDocumentsExplorerController::$thumbnailArray = ["fit" => "40x40", "quality" => 50];