forked from devcode-it/openstamanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.php
84 lines (61 loc) · 2.3 KB
/
controller.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
include_once __DIR__.'/core.php';
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');
}
include_once App::filepath('include|custom|', 'top.php');
// Inclusione gli elementi fondamentali
include_once $docroot.'/actions.php';
// Widget in alto
echo '{( "name": "widgets", "id_module": "'.$id_module.'", "position": "top", "place": "controller" )}';
// Lettura eventuali plugins modulo da inserire come tab
echo '
<div class="nav-tabs-custom">
<ul class="nav nav-tabs pull-right" id="tabs" role="tablist">
<li class="pull-left active header">
<a data-toggle="tab" href="#tab_0">
<i class="'.$structure['icon'].'"></i> '.$structure['title'];
// Pulsante "Aggiungi" solo se il modulo è di tipo "table" e se esiste il template per la popup
if ($structure->hasAddFile() && $structure->permission == 'rw') {
echo '
<button type="button" class="btn btn-primary" data-toggle="modal" data-title="'.tr('Aggiungi').'..." data-href="add.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'"><i class="fa fa-plus"></i></button>';
}
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");
// Tab dei plugin
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>';
// Plugin
$module_record = $record;
foreach ($plugins as $plugin) {
$record = $module_record;
echo '
<div id="tab_'.$plugin['id'].'" class="tab-pane">';
$id_plugin = $plugin['id'];
include $docroot.'/include/manager.php';
echo '
</div>';
}
$record = $module_record;
echo '
</div>
</div>';
redirectOperation($id_module, isset($id_parent) ? $id_parent : $id_record);
// Widget in basso
echo '{( "name": "widgets", "id_module": "'.$id_module.'", "position": "right", "place": "controller" )}';
include_once App::filepath('include|custom|', 'bottom.php');