forked from phpmyadmin/phpmyadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server_plugins.php
185 lines (177 loc) · 6.54 KB
/
server_plugins.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @package PhpMyAdmin
*/
/**
* requirements
*/
require_once 'libraries/common.inc.php';
/**
* JS includes
*/
$response = PMA_Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('jquery/jquery.cookie.js');
$scripts->addFile('jquery/jquery.tablesorter.js');
$scripts->addFile('server_plugins.js');
/**
* Does the common work
*/
require 'libraries/server_common.inc.php';
/**
* Displays the sub-page heading
*/
echo '<h2>' . "\n"
. PMA_CommonFunctions::getInstance()->getImage('b_engine.png')
. "\n" . __('Plugins') . "\n"
. '</h2>' . "\n";
/**
* Prepare plugin list
*/
$sql = "SELECT p.plugin_name, p.plugin_type, p.is_active, m.module_name, m.module_library,
m.module_version, m.module_author, m.module_description, m.module_license
FROM data_dictionary.plugins p
JOIN data_dictionary.modules m USING (module_name)
ORDER BY m.module_name, p.plugin_type, p.plugin_name";
$res = PMA_DBI_query($sql);
$plugins = array();
$modules = array();
while ($row = PMA_DBI_fetch_assoc($res)) {
$plugins[$row['plugin_type']][] = $row;
$modules[$row['module_name']]['info'] = $row;
$modules[$row['module_name']]['plugins'][$row['plugin_type']][] = $row;
}
PMA_DBI_free_result($res);
// sort plugin list (modules are already sorted)
ksort($plugins);
/**
* Displays the page
*/
?>
<script type="text/javascript">
pma_theme_image = '<?php echo $GLOBALS['pmaThemeImage']; ?>';
</script>
<div id="pluginsTabs">
<ul>
<li><a href="#plugins_plugins"><?php echo __('Plugins'); ?></a></li>
<li><a href="#plugins_modules"><?php echo __('Modules'); ?></a></li>
</ul>
<div id="plugins_plugins">
<div id="sectionlinks">
<?php
foreach ($plugins as $plugin_type => $plugin_list) {
$key = 'plugins-' . preg_replace('/[^a-z]/', '', strtolower($plugin_type));
echo '<a href="#' . $key . '">' . htmlspecialchars($plugin_type) . '</a>' . "\n";
}
?>
</div>
<br />
<?php
foreach ($plugins as $plugin_type => $plugin_list) {
$key = 'plugins-' . preg_replace('/[^a-z]/', '', strtolower($plugin_type));
sort($plugin_list);
?>
<table class="data_full_width" id="<?php echo $key; ?>">
<caption class="tblHeaders">
<a class="top" href="#serverinfo"><?php
echo __('Begin');
echo PMA_CommonFunctions::getInstance()->getImage('s_asc.png');
?></a>
<?php echo htmlspecialchars($plugin_type); ?>
</caption>
<thead>
<tr>
<th><?php echo __('Plugin'); ?></th>
<th><?php echo __('Module'); ?></th>
<th><?php echo __('Library'); ?></th>
<th><?php echo __('Version'); ?></th>
<th><?php echo __('Author'); ?></th>
<th><?php echo __('License'); ?></th>
</tr>
</thead>
<tbody>
<?php
$odd_row = false;
foreach ($plugin_list as $plugin) {
$odd_row = !$odd_row;
?>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
<th><?php echo htmlspecialchars($plugin['plugin_name']); ?></th>
<td><?php echo htmlspecialchars($plugin['module_name']); ?></td>
<td><?php echo htmlspecialchars($plugin['module_library']); ?></td>
<td><?php echo htmlspecialchars($plugin['module_version']); ?></td>
<td><?php echo htmlspecialchars($plugin['module_author']); ?></td>
<td><?php echo htmlspecialchars($plugin['module_license']); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
</div>
<div id="plugins_modules">
<table class="data_full_width">
<thead>
<tr>
<th><?php echo __('Module'); ?></th>
<th><?php echo __('Description'); ?></th>
<th><?php echo __('Library'); ?></th>
<th><?php echo __('Version'); ?></th>
<th><?php echo __('Author'); ?></th>
<th><?php echo __('License'); ?></th>
</tr>
</thead>
<tbody>
<?php
$odd_row = false;
foreach ($modules as $module_name => $module) {
$odd_row = !$odd_row;
?>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
<th rowspan="2"><?php echo htmlspecialchars($module_name); ?></th>
<td><?php echo htmlspecialchars($module['info']['module_description']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_library']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_version']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_author']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_license']); ?></td>
</tr>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
<td colspan="5">
<table>
<tbody>
<?php
foreach ($module['plugins'] as $plugin_type => $plugin_list) {
?>
<tr class="noclick">
<td><b class="plugin-type"><?php echo htmlspecialchars($plugin_type); ?></b></td>
<td>
<?php
for ($i = 0; $i < count($plugin_list); $i++) {
echo ($i != 0 ? '<br />' : '') . htmlspecialchars($plugin_list[$i]['plugin_name']);
if (!$plugin_list[$i]['is_active']) {
echo ' <small class="attention">' . __('disabled') . '</small>';
}
}
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>