mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-01 16:36:45 +01:00
Correzione visualizzazione allegati
This commit is contained in:
parent
884da4fdae
commit
e4148b634b
@ -206,7 +206,7 @@ class Upload extends Model
|
||||
*/
|
||||
public function isImage()
|
||||
{
|
||||
$list = ['jpg', 'png', 'gif', 'jpeg', 'bmp', 'svg'];
|
||||
$list = ['jpg', 'png', 'gif', 'jpeg', 'bmp'];
|
||||
|
||||
return in_array($this->extension, $list);
|
||||
}
|
||||
|
11
view.php
11
view.php
@ -91,11 +91,14 @@ if ($file->isFatturaElettronica()) {
|
||||
if ($file->isImage()) {
|
||||
echo '
|
||||
<img src="'.$link.'"></img>';
|
||||
} else {
|
||||
if ($file->isPDF()) {
|
||||
$src = \Prints::getPDFLink($file->filepath);
|
||||
}
|
||||
} elseif ($file->isPDF()) {
|
||||
$preview = \Prints::getPDFLink($file->filepath);
|
||||
|
||||
echo '
|
||||
<iframe src="'.($preview ?: $link).'">
|
||||
<a src="'.$link.'">'.tr('Il browser non supporta i contenuti iframe: clicca qui per raggiungere il file originale').'</a>
|
||||
</iframe>';
|
||||
} else {
|
||||
echo '
|
||||
<iframe src="'.base_path().'/view.php?file_id='.$file_id.'&download=1">
|
||||
<a src="'.base_path().'/view.php?file_id='.$file_id.'&download=1">'.tr('Il browser non supporta i contenuti iframe: clicca qui per raggiungere il file originale').'</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user