/**
* The index page
*
- * Display file tree
+ * Display index
*
* @param Request $request The request instance
* @return Response The rendered view
*/
- public function index(Request $request, string $path): Response {
+ public function index(Request $request): Response {
+ //Get roots
+ $this->context['roots'] = $this->config['roots'];
+
//Render template
$response = $this->render('@RapsysTree/index.html.twig', $this->context);
return $response;
}
+ /**
+ * The directory page
+ *
+ * Display directory
+ *
+ * @param Request $request The request instance
+ * @param string $path The directory path
+ * @return Response The rendered view
+ */
+ public function directory(Request $request, string $path): Response {
+ header('Content-Type: text/plain');
+ var_dump($path);
+ exit;
+
+ //Render template
+ $response = $this->render('@RapsysTree/directory.html.twig', $this->context);
+
+ $response->setEtag(md5($response->getContent()));
+ $response->setPublic();
+ $response->isNotModified($request);
+
+ //Return response
+ return $response;
+ }
+
+ /**
+ * The document page
+ *
+ * Display document
+ *
+ * @param Request $request The request instance
+ * @param string $path The directory path
+ * @return Response The rendered view
+ */
+ public function document(Request $request, string $path): Response {
+ //Render template
+ $response = $this->render('@RapsysTree/document.html.twig', $this->context);
+
+ $response->setEtag(md5($response->getContent()));
+ $response->setPublic();
+ $response->isNotModified($request);
+
+ //Return response
+ return $response;
+ }
+
/**
* Renders a view
*
}
//With empty facebook title and title
- if (empty($parameters['facebook']['og:title']) && !empty($parameters['title'])) {
+ if (empty($parameters['facebook']['og:title']) && !empty($parameters['title']['page'])) {
//Set facebook title
- $parameters['facebook']['og:title'] = $parameters['title'];
+ $parameters['facebook']['og:title'] = $parameters['title']['page'];
}
//With empty facebook description and description