server_plugins.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * object the server plugin page
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. /**
  9. * requirements
  10. */
  11. require_once 'libraries/common.inc.php';
  12. /**
  13. * JS includes
  14. */
  15. $response = PMA_Response::getInstance();
  16. $header = $response->getHeader();
  17. $scripts = $header->getScripts();
  18. $scripts->addFile('jquery/jquery.tablesorter.js');
  19. $scripts->addFile('server_plugins.js');
  20. /**
  21. * Does the common work
  22. */
  23. require 'libraries/server_common.inc.php';
  24. require 'libraries/server_plugins.lib.php';
  25. /**
  26. * Prepare plugin list
  27. */
  28. $sql = "SELECT p.plugin_name, p.plugin_type, p.is_active, m.module_name,
  29. m.module_library, m.module_version, m.module_author,
  30. m.module_description, m.module_license
  31. FROM data_dictionary.plugins p
  32. JOIN data_dictionary.modules m USING (module_name)
  33. ORDER BY m.module_name, p.plugin_type, p.plugin_name";
  34. $res = $GLOBALS['dbi']->query($sql);
  35. $plugins = array();
  36. $modules = array();
  37. while ($row = $GLOBALS['dbi']->fetchAssoc($res)) {
  38. $plugins[$row['plugin_type']][] = $row;
  39. $modules[$row['module_name']]['info'] = $row;
  40. $modules[$row['module_name']]['plugins'][$row['plugin_type']][] = $row;
  41. }
  42. $GLOBALS['dbi']->freeResult($res);
  43. // sort plugin list (modules are already sorted)
  44. ksort($plugins);
  45. /**
  46. * Displays the page
  47. */
  48. $response->addHTML(PMA_getHtmlForSubPageHeader('plugins'));
  49. $response->addHTML(PMA_getPluginAndModuleInfo($plugins, $modules));
  50. exit;
  51. ?>