Translated using Weblate.
[phpmyadmin.git] / server_plugins.php
blob7aa0516937e9d019e971c7dea6fd14d3b55c66b3
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 * JS includes
24 $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.16.custom.js';
25 $GLOBALS['js_include'][] = 'jquery/jquery.cookie.js';
26 $GLOBALS['js_include'][] = 'jquery/jquery.tablesorter.js';
27 $GLOBALS['js_include'][] = 'server_plugins.js';
29 /**
30 * Does the common work
32 require './libraries/server_common.inc.php';
35 /**
36 * Displays the links
38 require './libraries/server_links.inc.php';
40 /**
41 * Displays the sub-page heading
43 echo '<h2>' . "\n"
44 . ($GLOBALS['cfg']['MainPageIconic']
45 ? '<img class="icon" src="' . $pmaThemeImage . 'b_engine.png"'
46 .' width="16" height="16" alt="" />' : '')
47 . "\n" . __('Plugins') . "\n"
48 . '</h2>' . "\n";
50 /**
51 * Prepare plugin list
53 $sql = "SELECT p.plugin_name, p.plugin_type, p.is_active, m.module_name, m.module_library,
54 m.module_version, m.module_author, m.module_description, m.module_license
55 FROM data_dictionary.plugins p
56 JOIN data_dictionary.modules m USING (module_name)
57 ORDER BY m.module_name, p.plugin_type, p.plugin_name";
58 $res = PMA_DBI_query($sql);
59 $plugins = array();
60 $modules = array();
61 while ($row = PMA_DBI_fetch_assoc($res)) {
62 $plugins[$row['plugin_type']][] = $row;
63 $modules[$row['module_name']]['info'] = $row;
64 $modules[$row['module_name']]['plugins'][$row['plugin_type']][] = $row;
66 PMA_DBI_free_result($res);
68 // sort plugin list (modules are already sorted)
69 ksort($plugins);
71 /**
72 * Displays the page
75 <script type="text/javascript">
76 pma_theme_image = '<?php echo $GLOBALS['pmaThemeImage']; ?>';
77 </script>
78 <div id="pluginsTabs">
79 <ul>
80 <li><a href="#plugins_plugins"><?php echo __('Plugins'); ?></a></li>
81 <li><a href="#plugins_modules"><?php echo __('Modules'); ?></a></li>
82 </ul>
84 <div id="plugins_plugins">
85 <div id="sectionlinks">
86 <?php
87 foreach ($plugins as $plugin_type => $plugin_list) {
88 $key = 'plugins-' . preg_replace('/[^a-z]/', '', strtolower($plugin_type));
89 echo '<a href="#' . $key . '">' . htmlspecialchars($plugin_type) . '</a>' . "\n";
92 </div>
93 <br />
94 <?php
95 foreach ($plugins as $plugin_type => $plugin_list) {
96 $key = 'plugins-' . preg_replace('/[^a-z]/', '', strtolower($plugin_type));
97 sort($plugin_list);
99 <table class="data_full_width" id="<?php echo $key; ?>">
100 <caption class="tblHeaders">
101 <a class="top" href="#serverinfo"><?php
102 echo __('Begin');
103 echo $GLOBALS['cfg']['MainPageIconic']
104 ? '<img src="' . $GLOBALS['pmaThemeImage'] .
105 's_asc.png" width="11" height="9" align="middle" alt="" />'
106 : ''; ?></a>
107 <?php echo htmlspecialchars($plugin_type); ?>
108 </caption>
109 <thead>
110 <tr>
111 <th><?php echo __('Plugin'); ?></th>
112 <th><?php echo __('Module'); ?></th>
113 <th><?php echo __('Library'); ?></th>
114 <th><?php echo __('Version'); ?></th>
115 <th><?php echo __('Author'); ?></th>
116 <th><?php echo __('License'); ?></th>
117 </tr>
118 </thead>
119 <tbody>
120 <?php
121 $odd_row = false;
122 foreach ($plugin_list as $plugin) {
123 $odd_row = !$odd_row;
125 <tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
126 <th><?php echo htmlspecialchars($plugin['plugin_name']); ?></th>
127 <td><?php echo htmlspecialchars($plugin['module_name']); ?></td>
128 <td><?php echo htmlspecialchars($plugin['module_library']); ?></td>
129 <td><?php echo htmlspecialchars($plugin['module_version']); ?></td>
130 <td><?php echo htmlspecialchars($plugin['module_author']); ?></td>
131 <td><?php echo htmlspecialchars($plugin['module_license']); ?></td>
132 </tr>
133 <?php
136 </tbody>
137 </table>
138 <?php
141 </div>
142 <div id="plugins_modules">
143 <table class="data_full_width">
144 <thead>
145 <tr>
146 <th><?php echo __('Module'); ?></th>
147 <th><?php echo __('Description'); ?></th>
148 <th><?php echo __('Library'); ?></th>
149 <th><?php echo __('Version'); ?></th>
150 <th><?php echo __('Author'); ?></th>
151 <th><?php echo __('License'); ?></th>
152 </tr>
153 </thead>
154 <tbody>
155 <?php
156 $odd_row = false;
157 foreach ($modules as $module_name => $module) {
158 $odd_row = !$odd_row;
160 <tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
161 <th rowspan="2"><?php echo htmlspecialchars($module_name); ?></th>
162 <td><?php echo htmlspecialchars($module['info']['module_description']); ?></td>
163 <td><?php echo htmlspecialchars($module['info']['module_library']); ?></td>
164 <td><?php echo htmlspecialchars($module['info']['module_version']); ?></td>
165 <td><?php echo htmlspecialchars($module['info']['module_author']); ?></td>
166 <td><?php echo htmlspecialchars($module['info']['module_license']); ?></td>
167 </tr>
168 <tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
169 <td colspan="5">
170 <table>
171 <tbody>
172 <?php
173 foreach ($module['plugins'] as $plugin_type => $plugin_list) {
175 <tr class="noclick">
176 <td><b class="plugin-type"><?php echo htmlspecialchars($plugin_type); ?></b></td>
177 <td>
178 <?php
179 for ($i = 0; $i < count($plugin_list); $i++) {
180 echo ($i != 0 ? '<br />' : '') . htmlspecialchars($plugin_list[$i]['plugin_name']);
181 if (!$plugin_list[$i]['is_active']) {
182 echo ' <small class="attention">' . __('disabled') . '</small>';
186 </td>
187 </tr>
188 <?php
191 </tbody>
192 </table>
193 </td>
194 </tr>
195 <?php
198 </tbody>
199 </table>
200 </div>
201 </div>
202 <?php
204 * Sends the footer
206 require './libraries/footer.inc.php';