Replica header moduli anche su plugin del modulo

This commit is contained in:
loviuz 2024-06-29 01:36:30 +02:00
parent f139df500d
commit 9266830a72
1 changed files with 46 additions and 4 deletions

View File

@ -24,6 +24,7 @@ use Models\Module;
// Disabilitazione dei campi // Disabilitazione dei campi
$read_only = $structure->permission == 'r'; $read_only = $structure->permission == 'r';
$module_header_html = '';
if (empty($id_record) && !empty($id_module) && empty($id_plugin)) { if (empty($id_record) && !empty($id_module) && empty($id_plugin)) {
redirect(base_path().'/controller.php?id_module='.$id_module); redirect(base_path().'/controller.php?id_module='.$id_module);
@ -239,9 +240,20 @@ if (empty($record) || !$has_access) {
<div class="clearfix"></div> <div class="clearfix"></div>
<br>'; <br>';
// Eventuale header personalizzato // Eventuale header personalizzato
$header = $structure->filepath('header.php'); $module_header = $structure->filepath('header.php');
if ($header) { $module_header_html = '';
include_once $header;
if (!empty($module_header)) {
ob_start();
include $module_header;
$module_header_html = ob_get_clean();
}
// Eventuale header personalizzato
if ($module_header_html) {
echo '<div class="module-header">';
echo $module_header_html;
echo '</div>';
} }
} }
@ -297,6 +309,13 @@ if (empty($record) || !$has_access) {
echo ' echo '
<div id="tab_note" class="tab-pane">'; <div id="tab_note" class="tab-pane">';
// Eventuale header personalizzato
if ($module_header_html) {
echo '<div class="module-header">';
echo $module_header_html;
echo '</div>';
}
include base_dir().'/plugins/notes.php'; include base_dir().'/plugins/notes.php';
echo ' echo '
@ -307,6 +326,13 @@ if (empty($record) || !$has_access) {
echo ' echo '
<div id="tab_checks" class="tab-pane">'; <div id="tab_checks" class="tab-pane">';
// Eventuale header personalizzato
if ($module_header_html) {
echo '<div class="module-header">';
echo $module_header_html;
echo '</div>';
}
include base_dir().'/plugins/checks.php'; include base_dir().'/plugins/checks.php';
echo ' echo '
@ -316,7 +342,16 @@ if (empty($record) || !$has_access) {
// Informazioni sulle operazioni // Informazioni sulle operazioni
if (Auth::admin()) { if (Auth::admin()) {
echo ' echo '
<div id="tab_info" class="tab-pane"> <div id="tab_info" class="tab-pane">';
// Eventuale header personalizzato
if ($module_header_html) {
echo '<div class="module-header">';
echo $module_header_html;
echo '</div>';
}
echo '
<div class="timeline">'; <div class="timeline">';
$operations = $dbo->fetchArray('SELECT `zz_operations`.*, `zz_users`.`username` FROM `zz_operations` LEFT JOIN `zz_users` ON `zz_operations`.`id_utente` = `zz_users`.`id` WHERE id_module = '.prepare($id_module).' AND id_record = '.prepare($id_record).' ORDER BY `created_at` DESC LIMIT 200'); $operations = $dbo->fetchArray('SELECT `zz_operations`.*, `zz_users`.`username` FROM `zz_operations` LEFT JOIN `zz_users` ON `zz_operations`.`id_utente` = `zz_users`.`id` WHERE id_module = '.prepare($id_module).' AND id_record = '.prepare($id_record).' ORDER BY `created_at` DESC LIMIT 200');
@ -390,6 +425,13 @@ if (empty($record) || !$has_access) {
echo ' echo '
<div id="tab_'.$plugin['id'].'" class="tab-pane">'; <div id="tab_'.$plugin['id'].'" class="tab-pane">';
// Eventuale header personalizzato
if ($module_header_html) {
echo '<div class="module-header">';
echo $module_header_html;
echo '</div>';
}
$id_plugin = $plugin['id']; $id_plugin = $plugin['id'];
include base_dir().'/include/manager.php'; include base_dir().'/include/manager.php';