From e341a30f7f992f293fadc0d9162c4c3f69398bda Mon Sep 17 00:00:00 2001 From: afornerot Date: Thu, 16 Apr 2020 15:01:23 +0200 Subject: [PATCH] plus d'apercu pour les fichiers pdf (ref #121) --- .../PortalBundle/Controller/PagewidgetController.php | 6 +++--- .../PortalBundle/Controller/ProjecttaskController.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php index c84f85b0..17d2be3c 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -1454,7 +1454,7 @@ class PagewidgetController extends Controller foreach ($finder as $file) { $tmp=[]; $tmp["name"]=$file->getRelativePathname(); - $tmp["extension"]=$file->getExtension(); + $tmp["extension"]=strtolower($file->getExtension()); $fileinfo = new file($file->getPathname()); $tmp["minetype"]=$fileinfo->getMimeType(); $tmp["minefamily"]=explode("/",$tmp["minetype"])[0]; @@ -1463,6 +1463,7 @@ class PagewidgetController extends Controller if($tmp["extension"]=="pdf") { $tmp["thumb"]="/".$this->getParameter('alias')."/bundles/cadolescore/images/files/".$tmp["extension"].".png"; + /* ne plus afficher l'apercu du pdf if($fs->exists($directory."/thumbmini/".$tmp["name"])) { $data = file_get_contents($directory."/thumbmini/".$tmp["name"]); $tmp["thumb"]="data:image/jpg;base64," . base64_encode($data); @@ -1471,8 +1472,7 @@ class PagewidgetController extends Controller $data = file_get_contents($directory."/thumb/".$tmp["name"]); $tmp["thumb"]="data:image/jpg;base64," . base64_encode($data); } - - + */ } elseif($fs->exists($directory."/thumbmini/".$tmp["name"])) { $data = file_get_contents($directory."/thumbmini/".$tmp["name"]); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php index 4bd41adf..7a3c25a3 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php @@ -231,7 +231,7 @@ class ProjecttaskController extends Controller foreach ($finder as $file) { $tmp=[]; $tmp["name"]=$file->getRelativePathname(); - $tmp["extension"]=$file->getExtension(); + $tmp["extension"]=strtolower($file->getExtension()); $fileinfo = new file($file->getPathname()); $tmp["minetype"]=$fileinfo->getMimeType(); $tmp["minefamily"]=explode("/",$tmp["minetype"])[0]; @@ -240,6 +240,7 @@ class ProjecttaskController extends Controller if($tmp["extension"]=="pdf") { $tmp["thumb"]="/".$this->getParameter('alias')."/bundles/cadolescore/images/files/".$tmp["extension"].".png"; + /* ne plus afficher l'apercu du pdf if($fs->exists($directory."/thumbmini/".$tmp["name"])) { $data = file_get_contents($directory."/thumbmini/".$tmp["name"]); $tmp["thumb"]="data:image/jpg;base64," . base64_encode($data); @@ -248,8 +249,7 @@ class ProjecttaskController extends Controller $data = file_get_contents($directory."/thumb/".$tmp["name"]); $tmp["thumb"]="data:image/jpg;base64," . base64_encode($data); } - - + */ } elseif($fs->exists($directory."/thumbmini/".$tmp["name"])) { $data = file_get_contents($directory."/thumbmini/".$tmp["name"]);