Translated using Weblate (Tatar)
[phpmyadmin.git] / server_plugins.php
blobffaf6ab701f7715be041d635f8bedb13608f329d
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package PhpMyAdmin
6 */
8 /**
9 * requirements
11 require_once 'libraries/common.inc.php';
13 /**
14 * JS includes
16 $response = PMA_Response::getInstance();
17 $header = $response->getHeader();
18 $scripts = $header->getScripts();
19 $scripts->addFile('jquery/jquery.tablesorter.js');
20 $scripts->addFile('server_plugins.js');
22 /**
23 * Does the common work
25 require 'libraries/server_common.inc.php';
27 /**
28 * Displays the sub-page heading
30 echo '<h2>' . "\n"
31 . PMA_Util::getImage('b_engine.png')
32 . "\n" . __('Plugins') . "\n"
33 . '</h2>' . "\n";
35 /**
36 * Prepare plugin list
38 $sql = "SELECT p.plugin_name, p.plugin_type, p.is_active, m.module_name, m.module_library,
39 m.module_version, m.module_author, m.module_description, m.module_license
40 FROM data_dictionary.plugins p
41 JOIN data_dictionary.modules m USING (module_name)
42 ORDER BY m.module_name, p.plugin_type, p.plugin_name";
43 $res = PMA_DBI_query($sql);
44 $plugins = array();
45 $modules = array();
46 while ($row = PMA_DBI_fetch_assoc($res)) {
47 $plugins[$row['plugin_type']][] = $row;
48 $modules[$row['module_name']]['info'] = $row;
49 $modules[$row['module_name']]['plugins'][$row['plugin_type']][] = $row;
51 PMA_DBI_free_result($res);
53 // sort plugin list (modules are already sorted)
54 ksort($plugins);
56 /**
57 * Displays the page
60 <script type="text/javascript">
61 pma_theme_image = '<?php echo $GLOBALS['pmaThemeImage']; ?>';
62 </script>
63 <div id="pluginsTabs">
64 <ul>
65 <li><a href="#plugins_plugins"><?php echo __('Plugins'); ?></a></li>
66 <li><a href="#plugins_modules"><?php echo __('Modules'); ?></a></li>
67 </ul>
69 <div id="plugins_plugins">
70 <div id="sectionlinks">
71 <?php
72 foreach ($plugins as $plugin_type => $plugin_list) {
73 $key = 'plugins-' . preg_replace('/[^a-z]/', '', strtolower($plugin_type));
74 echo '<a href="#' . $key . '">' . htmlspecialchars($plugin_type) . '</a>' . "\n";
77 </div>
78 <br />
79 <?php
80 foreach ($plugins as $plugin_type => $plugin_list) {
81 $key = 'plugins-' . preg_replace('/[^a-z]/', '', strtolower($plugin_type));
82 sort($plugin_list);
84 <table class="data_full_width" id="<?php echo $key; ?>">
85 <caption class="tblHeaders">
86 <a class="top" href="#serverinfo"><?php
87 echo __('Begin');
88 echo PMA_Util::getImage('s_asc.png');
89 ?></a>
90 <?php echo htmlspecialchars($plugin_type); ?>
91 </caption>
92 <thead>
93 <tr>
94 <th><?php echo __('Plugin'); ?></th>
95 <th><?php echo __('Module'); ?></th>
96 <th><?php echo __('Library'); ?></th>
97 <th><?php echo __('Version'); ?></th>
98 <th><?php echo __('Author'); ?></th>
99 <th><?php echo __('License'); ?></th>
100 </tr>
101 </thead>
102 <tbody>
103 <?php
104 $odd_row = false;
105 foreach ($plugin_list as $plugin) {
106 $odd_row = !$odd_row;
108 <tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
109 <th><?php echo htmlspecialchars($plugin['plugin_name']); ?></th>
110 <td><?php echo htmlspecialchars($plugin['module_name']); ?></td>
111 <td><?php echo htmlspecialchars($plugin['module_library']); ?></td>
112 <td><?php echo htmlspecialchars($plugin['module_version']); ?></td>
113 <td><?php echo htmlspecialchars($plugin['module_author']); ?></td>
114 <td><?php echo htmlspecialchars($plugin['module_license']); ?></td>
115 </tr>
116 <?php
119 </tbody>
120 </table>
121 <?php
124 </div>
125 <div id="plugins_modules">
126 <table class="data_full_width">
127 <thead>
128 <tr>
129 <th><?php echo __('Module'); ?></th>
130 <th><?php echo __('Description'); ?></th>
131 <th><?php echo __('Library'); ?></th>
132 <th><?php echo __('Version'); ?></th>
133 <th><?php echo __('Author'); ?></th>
134 <th><?php echo __('License'); ?></th>
135 </tr>
136 </thead>
137 <tbody>
138 <?php
139 $odd_row = false;
140 foreach ($modules as $module_name => $module) {
141 $odd_row = !$odd_row;
143 <tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
144 <th rowspan="2"><?php echo htmlspecialchars($module_name); ?></th>
145 <td><?php echo htmlspecialchars($module['info']['module_description']); ?></td>
146 <td><?php echo htmlspecialchars($module['info']['module_library']); ?></td>
147 <td><?php echo htmlspecialchars($module['info']['module_version']); ?></td>
148 <td><?php echo htmlspecialchars($module['info']['module_author']); ?></td>
149 <td><?php echo htmlspecialchars($module['info']['module_license']); ?></td>
150 </tr>
151 <tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
152 <td colspan="5">
153 <table>
154 <tbody>
155 <?php
156 foreach ($module['plugins'] as $plugin_type => $plugin_list) {
158 <tr class="noclick">
159 <td><b class="plugin-type"><?php echo htmlspecialchars($plugin_type); ?></b></td>
160 <td>
161 <?php
162 for ($i = 0; $i < count($plugin_list); $i++) {
163 echo ($i != 0 ? '<br />' : '') . htmlspecialchars($plugin_list[$i]['plugin_name']);
164 if (!$plugin_list[$i]['is_active']) {
165 echo ' <small class="attention">' . __('disabled') . '</small>';
169 </td>
170 </tr>
171 <?php
174 </tbody>
175 </table>
176 </td>
177 </tr>
178 <?php
181 </tbody>
182 </table>
183 </div>
184 </div>