Fix filelist_and_upload per immagini

This commit is contained in:
Luca 2018-05-22 18:54:43 +02:00
parent 76315a0617
commit a854477448
2 changed files with 16 additions and 18 deletions

View File

@ -602,15 +602,3 @@ input.small-width {
margin-bottom:-1px; margin-bottom:-1px;
margin-right: 0px; margin-right: 0px;
} }
.thumbnail {
position: relative;
-ms-zoom: 0.25;
-moz-transform: scale(0.25);
-moz-transform-origin: 0 0;
-o-transform: scale(0.25);
-o-transform-origin: 0 0;
-webkit-transform: scale(0.25);
-webkit-transform-origin: 0 0;
}

View File

@ -80,13 +80,23 @@ $result .= '
$extension = end((explode('.', $r['original']))); $extension = end((explode('.', $r['original'])));
$supported_extensions = ['pdf','jpg','png','gif','jpeg','bmp']; $supported_extensions = ['pdf','jpg','png','gif','jpeg','bmp'];
if ( in_array($extension, $supported_extensions)){ if ( in_array($extension, $supported_extensions)){
$result .= "
<div class='hide thumbnail' id='view-".$r['id']."' > $result .= "<div class='hide' id='view-".$r['id']."' >";
<iframe src=\"".ROOTDIR.'/files/'.\Modules::get($options['id_module'])['directory'].'/'.$r['filename']."\" frameborder=\"0\" scrolling=\"no\" width=\"100%\" height=\"550\"></iframe>
</div> if ($extension=='pdf'){
<button class=\"btn btn-sm btn-info\" data-target=\"#bs-popup\" type=\"button\" data-title=\"".htmlentities($r['nome'], ENT_QUOTES, "UTF-8")." <small><em>(".$r['filename'].")</em></small>\" data-href=\"#view-".$r['id']."\" ><i class='fa fa-eye'></i></button>"; $result .= "
<iframe src=\"".ROOTDIR.'/files/'.\Modules::get($options['id_module'])['directory'].'/'.$r['filename']."\" frameborder=\"0\" scrolling=\"no\" width=\"100%\" height=\"550\"></iframe>";
}else{
$result .= "
<img src=\"".ROOTDIR.'/files/'.\Modules::get($options['id_module'])['directory'].'/'.$r['filename']."\" width=\"100%\" ></img>";
}
$result .= "</div>";
$result .= " <button class=\"btn btn-sm btn-info\" data-target=\"#bs-popup\" type=\"button\" data-title=\"".htmlentities($r['nome'], ENT_QUOTES, "UTF-8")." <small><em>(".$r['filename'].")</em></small>\" data-href=\"#view-".$r['id']."\" ><i class='fa fa-eye'></i></button>";
}else{ }else{
$result .= "<button class=\"btn btn-sm btn-default\" title=\"".tr('Anteprima file non disponibile').".\" onclick=\"alert('".tr('Anteprima file di tipo "'.$extension.'" non supportata.')."');\" ><i class='fa fa-eye'></i></button>\n"; $result .= " <button class=\"btn btn-sm btn-default\" title=\"".tr('Anteprima file non disponibile').".\" onclick=\"alert('".tr('Anteprima file di tipo "'.$extension.'" non supportata.')."');\" ><i class='fa fa-eye'></i></button>\n";
} }
if (!$options['readonly']){ if (!$options['readonly']){