. */ use HTMLBuilder\HTMLBuilder; include_once __DIR__.'/../core.php'; // Compatibilità per controller ed editor if (!empty($id_plugin)) { $structure = Plugins::get($id_plugin); } else { $structure = Modules::get($id_module); } if (!empty($id_plugin)) { // Inclusione di eventuale plugin personalizzato if (!empty($structure['script'])) { $path = $structure->getEditFile(); if (!empty($path)) { include $path; } return; } echo '

'.$structure['title'].(!empty($structure['help']) ? ' ' : '').''; if ($structure->hasAddFile()) { echo ' '; } echo '

'; } $type = $structure['option']; // Lettura risultato query del modulo // include $structure->filepath('init.php'); // Caricamento file aggiuntivo su elenco record $controller_before = $structure->filepath('controller_before.php'); if (!empty($controller_before)) { include $controller_before; } /* * Datatables con record */ if (!empty($type) && $type != 'menu' && $type != 'custom') { $total = Util\Query::readQuery($structure); if (empty($id_plugin) && count(Modules::getSegments($id_module)) > 1) { echo '
{[ "type": "select", "name": "id_segment_", "required": 0, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_module]).', "value": "'.$_SESSION['module_'.$id_module]['id_segment'].'" ]}

'; echo ' '; } // Reset della selezione precedente $_SESSION['module_'.$id_module]['selected'] = []; $selezione = array_keys($_SESSION['module_'.$id_module]['selected']); $table_id = 'main_'.rand(0, 99); echo ' '; foreach ($total['fields'] as $key => $field) { $attr_td = ''; $name = trim($field); // Check per tipologie di campi particolari if (preg_match('/^color_/', $field)) { $attr_td .= " width='140'"; $field = str_replace('color_', '', $field); } // Data (larghezza fissa) elseif (preg_match('/^Data/', $field)) { $attr_td .= " width='100'"; } // Icona di stampa elseif (trim($field) == '_print_') { $attr_td .= " width='30'"; $field = str_replace('_print_', '', $field); } elseif (preg_match('/^icon_/', $field)) { $attr_td .= " width='30'"; $name = str_replace('icon_', 'icon_title_', $name); $field = str_replace('icon_', '', $field); } echo ' '.$field.''; } echo ' '; echo ' '; foreach ($total['fields'] as $key => $field) { echo ' '; } echo '
'; echo '
'; if (setting('Abilita esportazione Excel e PDF')) { echo '
'; } else { echo ' '; } echo '
'; } /* * Inclusione modulo personalizzato */ elseif ($type == 'custom') { $path = $structure->getEditFile(); if (!empty($path)) { include $path; } } // Caricamento file aggiuntivo su elenco record $controller_after = $structure->filepath('controller_after.php'); if (!empty($controller_after)) { include $controller_after; }