Merge remote-tracking branch 'origin/master' into drizzle
[phpmyadmin.git] / server_plugins.php
blobd85701c04c10eda9e9eae1598410c721df302da4
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package phpMyAdmin
6 */
8 /**
9 * no need for variables importing
10 * @ignore
12 if (! defined('PMA_NO_VARIABLES_IMPORT')) {
13 define('PMA_NO_VARIABLES_IMPORT', true);
16 /**
17 * requirements
19 require_once './libraries/common.inc.php';
21 /**
22 * Does the common work
24 require './libraries/server_common.inc.php';
27 /**
28 * Displays the links
30 require './libraries/server_links.inc.php';
33 /**
34 * Displays the sub-page heading
36 echo '<h2>' . "\n"
37 . ($GLOBALS['cfg']['MainPageIconic']
38 ? '<img class="icon" src="' . $pmaThemeImage . 'b_engine.png"'
39 .' width="16" height="16" alt="" />' : '')
40 . "\n" . __('Plugins') . "\n"
41 . '</h2>' . "\n";
44 /**
45 * Prepare plugin list
47 $sql = "SELECT p.plugin_name, p.plugin_type, p.is_active, m.module_name, m.module_library,
48 m.module_version, m.module_author, m.module_description, m.module_license
49 FROM data_dictionary.plugins p
50 JOIN data_dictionary.modules m USING (module_name)
51 ORDER BY m.module_name, p.plugin_type, p.plugin_name";
52 $res = PMA_DBI_query($sql);
53 $modules = array();
54 while ($row = PMA_DBI_fetch_assoc($res)) {
55 $modules[$row['module_name']]['info'] = $row;
56 $modules[$row['module_name']]['plugins'][$row['plugin_type']][] = $row;
58 PMA_DBI_free_result($res);
60 /**
61 * Displays the page
64 <table class="data">
65 <thead>
66 <tr>
67 <th><?php echo __('Module'); ?></th>
68 <th><?php echo __('Description'); ?></th>
69 <th><?php echo __('Library'); ?></th>
70 <th><?php echo __('Version'); ?></th>
71 <th><?php echo __('Author'); ?></th>
72 <th><?php echo __('License'); ?></th>
73 </tr>
74 </thead>
75 <tbody>
76 <?php
77 $odd_row = false;
78 foreach ($modules as $module_name => $module) {
79 $odd_row = !$odd_row;
81 <tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
82 <th rowspan="2"><?php echo htmlspecialchars($module_name); ?></th>
83 <td><?php echo htmlspecialchars($module['info']['module_description']); ?></td>
84 <td><?php echo htmlspecialchars($module['info']['module_library']); ?></td>
85 <td><?php echo htmlspecialchars($module['info']['module_version']); ?></td>
86 <td><?php echo htmlspecialchars($module['info']['module_author']); ?></td>
87 <td><?php echo htmlspecialchars($module['info']['module_license']); ?></td>
88 </tr>
89 <tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
90 <td colspan="5">
91 <table>
92 <tbody>
93 <?php
94 foreach ($module['plugins'] as $plugin_type => $plugin_list) {
96 <tr class="noclick">
97 <td><b class="plugin-type"><?php echo htmlspecialchars($plugin_type); ?></b></td>
98 <td>
99 <?php
100 for ($i = 0; $i < count($plugin_list); $i++) {
101 echo ($i != 0 ? '<br />' : '') . htmlspecialchars($plugin_list[$i]['plugin_name']);
102 if (!$plugin_list[$i]['is_active']) {
103 echo ' <small class="attention">' . __('disabled') . '</small>';
107 </td>
108 </tr>
109 <?php
112 </tbody>
113 </table>
114 </td>
115 </tr>
116 <?php
119 </tbody>
120 </table>
121 <?php
123 * Sends the footer
125 require './libraries/footer.inc.php';