mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-13 09:40:18 +01:00
feat: Gestione immagini nelle viste
This commit is contained in:
parent
60349f586c
commit
ab23acb15e
@ -21,6 +21,7 @@
|
||||
include_once __DIR__.'/core.php';
|
||||
|
||||
use Util\Query;
|
||||
use Models\Module;
|
||||
|
||||
// Informazioni fondamentali
|
||||
$columns = (array) filter('columns', null, true);
|
||||
@ -181,6 +182,22 @@ if (!empty($query)) {
|
||||
$value = '<a href="'.$print_url.'" target="_blank"><i class="fa fa-2x fa-print"></i></a>';
|
||||
}
|
||||
|
||||
// Immagine
|
||||
elseif ($field == '_img_') {
|
||||
$module = Module::where('id', $id_module)->first();
|
||||
if( !empty($r['_img_']) ){
|
||||
$fileinfo = \Uploads::fileInfo($r['_img_']);
|
||||
|
||||
$directory = '/'.$module->upload_directory.'/';
|
||||
$image = $directory.$r['_img_'];
|
||||
$image_thumbnail = $directory.$fileinfo['filename'].'_thumb600.'.$fileinfo['extension'];
|
||||
|
||||
$url = file_exists(base_dir().$image_thumbnail) ? base_path().$image_thumbnail : base_path().$image;
|
||||
|
||||
$value = '<img src="'.$url.'" style="max-height: 80px; max-width:120px">';
|
||||
}
|
||||
}
|
||||
|
||||
// Icona
|
||||
elseif (preg_match('/^icon_(.+?)$/', trim($field), $m)) {
|
||||
$value = '<span class=\'badge text-black\' style=\'font-weight:normal;\' ><i class="'.$r[$field].'" title="'.$r['icon_title_'.$m[1]].'" ></i> <span>'.$r['icon_title_'.$m[1]].'</span></span>';
|
||||
|
@ -121,6 +121,12 @@ if (!empty($type) && $type != 'menu' && $type != 'custom') {
|
||||
$attr_td .= " width='100'";
|
||||
}
|
||||
|
||||
//Immagine
|
||||
elseif (trim((string) $field) == '_img_') {
|
||||
$attr_td .= " width='30'";
|
||||
$field = str_replace('_img_', '', $field);
|
||||
}
|
||||
|
||||
// Icona di stampa
|
||||
elseif (trim((string) $field) == '_print_') {
|
||||
$attr_td .= " width='30'";
|
||||
|
Loading…
x
Reference in New Issue
Block a user