| $videos = ['mp4', 'm4p', 'm4v', 'mov', 'mpg', 'mpeg', 'mp2', 'mpeg', 'mpe', 'mpv', 'webm', 'ogv', 'ogg']; | $videos = ['mp4', 'm4p', 'm4v', 'mov', 'mpg', 'mpeg', 'mp2', 'mpeg', 'mpe', 'mpv', 'webm', 'ogv', 'ogg']; | ||||
| $audio = ['mp3', 'mpa', 'aac', 'oga']; | $audio = ['mp3', 'mpa', 'aac', 'oga']; | ||||
| $files = ['pdf']; | $files = ['pdf']; | ||||
| $dicom = ['dcm']; | |||||
| $dicom = ['dcm', 'DCM']; | |||||
| if (!is_null($fileName)) { | if (!is_null($fileName)) { | ||||
| $ext = strtolower($this->getExtension($fileName)); | $ext = strtolower($this->getExtension($fileName)); | ||||
| } | } | ||||
| if (in_array($ext, $dicom)) { | if (in_array($ext, $dicom)) { | ||||
| return 'iframe'; | |||||
| return 'dicom'; | |||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| case 'dicom': | case 'dicom': | ||||
| return $wrapStart.$user.'<a data-options=\'{"hash":false}\' data-fancybox data-type="iframe" data-src="/dicom/?attach_id='.$attachId.'" href="#" class="'.$linkClass.'"><span class="icon-file-picture"></span> '.$attachTitle.'</a>'.$wrapEnd; | |||||
| return $wrapStart.$user.'<a data-options=\'{"hash":false}\' data-fancybox data-type="iframe" data-src="/dicom/dicom.php?attach_id='.$attachId.'" href="#" class="'.$linkClass.'"><span class="icon-file-picture"></span> '.$attachTitle.'</a>'.$wrapEnd; | |||||
| break; | break; | ||||
| case 'video': | case 'video': |
| <?php endforeach; ?> | <?php endforeach; ?> | ||||
| </ul> | </ul> | ||||
| <?php endforeach; ?> | <?php endforeach; ?> | ||||
| <?php //debug($this->view->isSimpleViewer); ?> | |||||
| <?php //debug($this->view->groupedAttachments); ?> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> |
| <?php | |||||
| // Il percorso al file DICOM sul server | |||||
| require_once '../../App/bootstrap.php'; | |||||
| $attachId = isset($_GET['attach_id']) ? $_GET['attach_id'] : 0; | |||||
| if (!$user->isLogged()) { | |||||
| //exit(0); | |||||
| } | |||||
| $attach = $db->where('id', $attachId)->getOne('requests_attachments'); | |||||
| $file_name = $attach['file_name']; | |||||
| $dicomFilePath = ATTACH_DIR . $file_name; | |||||
| echo $dicomFilePath; | |||||
| /* | |||||
| // Verifica che il file DICOM esista | |||||
| if (file_exists($dicomFilePath)) { | |||||
| // Imposta l'intestazione Content-Type per il file DICOM | |||||
| header('Content-Type: application/dicom'); | |||||
| // Indica la lunghezza del file in modo che il client possa sapere quanto è grande | |||||
| header('Content-Length: ' . filesize($dicomFilePath)); | |||||
| // Disabilita la memorizzazione nella cache per assicurarsi che il file venga sempre caricato | |||||
| header('Cache-Control: no-cache, must-revalidate'); | |||||
| header('Expires: 0'); | |||||
| // Leggi e trasmetti il file DICOM come se fosse il contenuto della risposta | |||||
| readfile($dicomFilePath); | |||||
| exit(); | |||||
| } else { | |||||
| // Restituisci un errore 404 se il file non viene trovato | |||||
| http_response_code(404); | |||||
| echo "File non trovato."; | |||||
| }*/ | |||||
| ?> |