server_engines.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * display list of server engines and additonal information about them
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. /**
  9. * requirements
  10. */
  11. require_once 'libraries/common.inc.php';
  12. /**
  13. * Does the common work
  14. */
  15. require 'libraries/server_common.inc.php';
  16. require 'libraries/StorageEngine.class.php';
  17. /**
  18. * Did the user request information about a certain storage engine?
  19. */
  20. if (empty($_REQUEST['engine'])
  21. || ! PMA_StorageEngine::isValid($_REQUEST['engine'])
  22. ) {
  23. /**
  24. * Displays the sub-page heading
  25. */
  26. echo '<h2>' . "\n"
  27. . PMA_Util::getImage('b_engine.png')
  28. . "\n" . __('Storage Engines') . "\n"
  29. . '</h2>' . "\n";
  30. /**
  31. * Displays the table header
  32. */
  33. echo '<table class="noclick">' . "\n"
  34. . '<thead>' . "\n"
  35. . '<tr><th>' . __('Storage Engine') . '</th>' . "\n"
  36. . ' <th>' . __('Description') . '</th>' . "\n"
  37. . '</tr>' . "\n"
  38. . '</thead>' . "\n"
  39. . '<tbody>' . "\n";
  40. /**
  41. * Listing the storage engines
  42. */
  43. $odd_row = true;
  44. foreach (PMA_StorageEngine::getStorageEngines() as $engine => $details) {
  45. echo '<tr class="'
  46. . ($odd_row ? 'odd' : 'even')
  47. . ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED'
  48. ? ' disabled'
  49. : '')
  50. . '">' . "\n"
  51. . ' <td><a rel="newpage" href="server_engines.php'
  52. . PMA_generate_common_url(array('engine' => $engine)) . '">' . "\n"
  53. . ' ' . htmlspecialchars($details['Engine']) . "\n"
  54. . ' </a></td>' . "\n"
  55. . ' <td>' . htmlspecialchars($details['Comment']) . '</td>' . "\n"
  56. . '</tr>' . "\n";
  57. $odd_row = !$odd_row;
  58. }
  59. unset($odd_row, $engine, $details);
  60. echo '</tbody>' . "\n"
  61. . '</table>' . "\n";
  62. } else {
  63. /**
  64. * Displays details about a given Storage Engine
  65. */
  66. $engine_plugin = PMA_StorageEngine::getEngine($_REQUEST['engine']);
  67. echo '<h2>' . "\n"
  68. . PMA_Util::getImage('b_engine.png')
  69. . ' ' . htmlspecialchars($engine_plugin->getTitle()) . "\n"
  70. . ' ' . PMA_Util::showMySQLDocu('', $engine_plugin->getMysqlHelpPage()) . "\n"
  71. . '</h2>' . "\n\n";
  72. echo '<p>' . "\n"
  73. . ' <em>' . "\n"
  74. . ' ' . htmlspecialchars($engine_plugin->getComment()) . "\n"
  75. . ' </em>' . "\n"
  76. . '</p>' . "\n\n";
  77. $infoPages = $engine_plugin->getInfoPages();
  78. if (! empty($infoPages) && is_array($infoPages)) {
  79. echo '<p>' . "\n"
  80. . ' <strong>[</strong>' . "\n";
  81. if (empty($_REQUEST['page'])) {
  82. echo ' <strong>' . __('Variables') . '</strong>' . "\n";
  83. } else {
  84. echo ' <a href="server_engines.php'
  85. . PMA_generate_common_url(array('engine' => $_REQUEST['engine']))
  86. . '">' . __('Variables') . '</a>' . "\n";
  87. }
  88. foreach ($infoPages as $current => $label) {
  89. echo ' <strong>|</strong>' . "\n";
  90. if (isset($_REQUEST['page']) && $_REQUEST['page'] == $current) {
  91. echo ' <strong>' . $label . '</strong>' . "\n";
  92. } else {
  93. echo ' <a href="server_engines.php'
  94. . PMA_generate_common_url(
  95. array('engine' => $_REQUEST['engine'], 'page' => $current)
  96. )
  97. . '">' . htmlspecialchars($label) . '</a>' . "\n";
  98. }
  99. }
  100. unset($current, $label);
  101. echo ' <strong>]</strong>' . "\n"
  102. . '</p>' . "\n\n";
  103. }
  104. unset($infoPages, $page_output);
  105. if (! empty($_REQUEST['page'])) {
  106. $page_output = $engine_plugin->getPage($_REQUEST['page']);
  107. }
  108. if (! empty($page_output)) {
  109. echo $page_output;
  110. } else {
  111. echo '<p> ' . $engine_plugin->getSupportInformationMessage() . "\n"
  112. . '</p>' . "\n"
  113. . $engine_plugin->getHtmlVariables();
  114. }
  115. }
  116. ?>