mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
feat: Gestione immagini nelle viste
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
include_once __DIR__.'/core.php';
|
include_once __DIR__.'/core.php';
|
||||||
|
|
||||||
use Util\Query;
|
use Util\Query;
|
||||||
|
use Models\Module;
|
||||||
|
|
||||||
// Informazioni fondamentali
|
// Informazioni fondamentali
|
||||||
$columns = (array) filter('columns', null, true);
|
$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>';
|
$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
|
// Icona
|
||||||
elseif (preg_match('/^icon_(.+?)$/', trim($field), $m)) {
|
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>';
|
$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'";
|
$attr_td .= " width='100'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Immagine
|
||||||
|
elseif (trim((string) $field) == '_img_') {
|
||||||
|
$attr_td .= " width='30'";
|
||||||
|
$field = str_replace('_img_', '', $field);
|
||||||
|
}
|
||||||
|
|
||||||
// Icona di stampa
|
// Icona di stampa
|
||||||
elseif (trim((string) $field) == '_print_') {
|
elseif (trim((string) $field) == '_print_') {
|
||||||
$attr_td .= " width='30'";
|
$attr_td .= " width='30'";
|
||||||
|
Reference in New Issue
Block a user