2017-08-04 16:28:16 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include_once __DIR__.'/core.php';
|
|
|
|
|
2018-01-12 16:23:26 +01:00
|
|
|
if (!empty($id_record) && !empty($id_module)) {
|
|
|
|
redirect(ROOTDIR.'/editor.php?id_module='.$id_module.'&id_record='.$id_record);
|
|
|
|
} elseif (empty($id_module)) {
|
|
|
|
redirect(ROOTDIR.'/index.php');
|
|
|
|
}
|
|
|
|
|
2018-06-26 09:41:43 +02:00
|
|
|
include_once App::filepath('include|custom|', 'top.php');
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2018-07-18 16:12:25 +02:00
|
|
|
// Inclusione gli elementi fondamentali
|
|
|
|
include_once $docroot.'/actions.php';
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2018-02-22 12:35:22 +01:00
|
|
|
// Widget in alto
|
|
|
|
echo '{( "name": "widgets", "id_module": "'.$id_module.'", "position": "top", "place": "controller" )}';
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Lettura eventuali plugins modulo da inserire come tab
|
|
|
|
echo '
|
|
|
|
<div class="nav-tabs-custom">
|
2017-10-08 18:28:26 +02:00
|
|
|
<ul class="nav nav-tabs pull-right" id="tabs" role="tablist">
|
2018-07-18 16:12:25 +02:00
|
|
|
<li class="pull-left active header">
|
2017-08-04 16:28:16 +02:00
|
|
|
<a data-toggle="tab" href="#tab_0">
|
2018-07-18 16:12:25 +02:00
|
|
|
<i class="'.$element['icon'].'"></i> '.$element['title'];
|
|
|
|
|
2017-08-04 16:28:16 +02:00
|
|
|
// Pulsante "Aggiungi" solo se il modulo è di tipo "table" e se esiste il template per la popup
|
2018-07-18 16:12:25 +02:00
|
|
|
if (!empty($element['add_file']) && $element['permessi'] == 'rw') {
|
2017-08-04 16:28:16 +02:00
|
|
|
echo '
|
2018-07-18 16:12:25 +02:00
|
|
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-title="'.tr('Aggiungi').'..." data-target="#bs-popup" data-href="add.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'"><i class="fa fa-plus"></i></button>';
|
2017-08-04 16:28:16 +02:00
|
|
|
}
|
2018-07-18 16:12:25 +02:00
|
|
|
|
2017-08-04 16:28:16 +02:00
|
|
|
echo '
|
|
|
|
</a>
|
|
|
|
</li>';
|
|
|
|
|
|
|
|
$plugins = $dbo->fetchArray('SELECT id, title FROM zz_plugins WHERE idmodule_to='.prepare($id_module)." AND position='tab_main' AND enabled = 1");
|
2018-07-18 16:12:25 +02:00
|
|
|
|
|
|
|
// Tab dei plugin
|
2017-08-04 16:28:16 +02:00
|
|
|
foreach ($plugins as $plugin) {
|
|
|
|
echo '
|
|
|
|
<li>
|
|
|
|
<a data-toggle="tab" href="#tab_'.$plugin['id'].'" id="link-tab_'.$plugin['id'].'">'.$plugin['title'].'</a>
|
|
|
|
</li>';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '
|
|
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
|
|
<div id="tab_0" class="tab-pane active">';
|
|
|
|
|
|
|
|
include $docroot.'/include/manager.php';
|
|
|
|
|
|
|
|
echo '
|
|
|
|
</div>';
|
|
|
|
|
2018-07-18 15:20:10 +02:00
|
|
|
// Plugin
|
|
|
|
$module_record = $record;
|
2017-08-04 16:28:16 +02:00
|
|
|
foreach ($plugins as $plugin) {
|
2018-07-18 15:20:10 +02:00
|
|
|
$record = $module_record;
|
|
|
|
|
2017-08-04 16:28:16 +02:00
|
|
|
echo '
|
|
|
|
<div id="tab_'.$plugin['id'].'" class="tab-pane">';
|
|
|
|
|
|
|
|
$id_plugin = $plugin['id'];
|
|
|
|
|
|
|
|
include $docroot.'/include/manager.php';
|
|
|
|
|
|
|
|
echo '
|
|
|
|
</div>';
|
|
|
|
}
|
|
|
|
|
2018-07-18 15:20:10 +02:00
|
|
|
$record = $module_record;
|
|
|
|
|
2017-08-04 16:28:16 +02:00
|
|
|
echo '
|
|
|
|
</div>
|
2018-02-22 12:35:22 +01:00
|
|
|
</div>';
|
2017-09-07 16:51:14 +02:00
|
|
|
|
2018-07-09 12:57:55 +02:00
|
|
|
redirectOperation($id_module, isset($id_parent) ? $id_parent : $id_record);
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2018-02-22 12:35:22 +01:00
|
|
|
// Widget in basso
|
|
|
|
echo '{( "name": "widgets", "id_module": "'.$id_module.'", "position": "right", "place": "controller" )}';
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2018-06-26 09:41:43 +02:00
|
|
|
include_once App::filepath('include|custom|', 'bottom.php');
|