-
Notifications
You must be signed in to change notification settings - Fork 7
/
dbtoolkit_launcher.php
154 lines (143 loc) · 4.84 KB
/
dbtoolkit_launcher.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
/*
* app launcher! ye baby
*/
//vardump($app);
global $wpdb;
$user = wp_get_current_user();
if(!empty($_GET['sub'])){
$_GET['renderinterface'] = $_GET['sub'];
}
$Interface = get_option($_GET['renderinterface']);
if(empty($app) && !empty($_GET['renderinterface'])){
$app= get_option('_'.sanitize_title($Interface['_Application']).'_app');
}
if(is_array($app)){
foreach($app['interfaces'] as $interface=>$access){
$cfg = get_option($interface);
if($access == 'null'){
$access = 'read';
}
if(!empty($user->allcaps[$access])){
if(!empty($cfg['_ItemGroup'])){
if(!empty($cfg['_interfaceName'])){
$menus[$cfg['_ItemGroup']][$cfg['ID']] = $cfg['_interfaceName'];
}else{
$menus[$cfg['_ItemGroup']][$cfg['ID']] = $cfg['_ReportDescription'];
}
}else{
if(!empty($cfg['_interfaceName'])){
$menus[$cfg['_interfaceName']] = $cfg['ID'];
}
}
}
}
}
?>
<h2 id="appTitle"><?php echo $app['name']; ?></h2>
<?php
// get link of docked:
if(!empty($app['docked'])){
$Link = 'admin.php?page=';
}else{
$Link = 'admin.php?page=dbt_builder&renderinterface=';
}
if(!empty($menus)){
ksort($menus);
echo '<div class="appnav_toolbar">';
echo '<ul class="tools_widgets">';
foreach($menus as $menu=>$group){
if(is_array($group)){
echo '<li class="root_item"><a class="parent hasSubs">'.$menu.'</a>';
echo '<ul id="'.sanitize_title($menu).'" style="visibility: hidden; display: block;">';
foreach($group as $interface=>$label){
echo '<li><a href="'.$Link.$interface.'">'.$label.'</a></li>';
}
echo '</ul>';
echo '</li>';
}else{
//vardump($app);
if($group == $app['landing']){
if(!empty($Interface['_Application'])){
if(!empty($app['docked'])){
$group = 'app_'.$Interface['_Application'];
}
}else{
$group = $_GET['page'];
}
//vardump($interface);
}
echo '<li class="root_item"><a href="'.$Link.$group.'" class="parent">'.$menu.'</a></li>';
}
}
echo '</ul>';
echo '<div style="clear:both;"></div>';
echo '</div>';
}
if(!empty($areas)){
echo '<div class="subsubsub">';
echo implode(' | ',$areas);
echo '</div>';
echo '<div style="clear:both;"></div>';
}
/*
?>
<div class="appnav_toolbar">
<ul class="tools_widgets">
<li class="root_item"><a class="parent hasSubs">Processors</a>
<ul id="" style="visibility: hidden; display: block;">
<li><a>A Link</a></li>
<li><a class="child HasSubs">A Link</a>
<ul id="" style="visibility: hidden; display: block;">
<li class="title"><a>A nother sub link</a></li>
</ul>
</li>
<li><a>A Link</a></li>
<li><a>A Link</a></li>
<li><a>A Link</a></li>
</ul>
</li>
<li class="root_item"><a class="parent">Processors</a></li>
</ul>
<div style="clear:both;"></div>
</div>
<?php
*
*/
if(!empty($_GET['renderinterface'])){
$noedit = true;
include DB_TOOLKIT.'dbtoolkit_admin.php';
}else{
// load landing
if(!empty($app['landing'])){
$_GET['renderinterface'] = $app['landing'];
}else{
if(!empty($app['interfaces'])){
foreach($app['interfaces'] as $intf=>$val){
$_GET['renderinterface'] = $intf;
break;
}
}
}
$noedit = true;
include DB_TOOLKIT.'dbtoolkit_admin.php';
}
?>
<?php
$_SESSION['dataform']['OutScripts'] .= "
// activate menus
jQuery('.tools_widgets ul').css({
display: \"none\"
});
jQuery('.tools_widgets li').hover(function(){
jQuery(this).find('ul:first').css({
visibility: \"visible\",
display: \"none\"
}).fadeIn(250);
},function(){
jQuery(this).find('ul:first').css({
visibility: \"hidden\"
});
});
";
?>