File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121include_once __DIR__ .'/core.php ' ;
2222
2323use Util \Query ;
24+ use Models \Module ;
2425
2526// Informazioni fondamentali
2627$ columns = (array ) filter ('columns ' , null , true );
181182 $ value = '<a href=" ' .$ print_url .'" target="_blank"><i class="fa fa-2x fa-print"></i></a> ' ;
182183 }
183184
185+ // Immagine
186+ elseif ($ field == '_img_ ' ) {
187+ $ module = Module::where ('id ' , $ id_module )->first ();
188+ if ( !empty ($ r ['_img_ ' ]) ){
189+ $ fileinfo = \Uploads::fileInfo ($ r ['_img_ ' ]);
190+
191+ $ directory = '/ ' .$ module ->upload_directory .'/ ' ;
192+ $ image = $ directory .$ r ['_img_ ' ];
193+ $ image_thumbnail = $ directory .$ fileinfo ['filename ' ].'_thumb600. ' .$ fileinfo ['extension ' ];
194+
195+ $ url = file_exists (base_dir ().$ image_thumbnail ) ? base_path ().$ image_thumbnail : base_path ().$ image ;
196+
197+ $ value = '<img src=" ' .$ url .'" style="max-height: 80px; max-width:120px"> ' ;
198+ }
199+ }
200+
184201 // Icona
185202 elseif (preg_match ('/^icon_(.+?)$/ ' , trim ($ field ), $ m )) {
186203 $ 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> ' ;
Original file line number Diff line number Diff line change 121121 $ attr_td .= " width='100' " ;
122122 }
123123
124+ //Immagine
125+ elseif (trim ((string ) $ field ) == '_img_ ' ) {
126+ $ attr_td .= " width='30' " ;
127+ $ field = str_replace ('_img_ ' , '' , $ field );
128+ }
129+
124130 // Icona di stampa
125131 elseif (trim ((string ) $ field ) == '_print_ ' ) {
126132 $ attr_td .= " width='30' " ;
You can’t perform that action at this time.
0 commit comments