server_collations.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. *
  5. * @package PhpMyAdmin
  6. */
  7. /**
  8. * requirements
  9. */
  10. require_once 'libraries/common.inc.php';
  11. /**
  12. * Does the common work
  13. */
  14. require 'libraries/server_common.inc.php';
  15. /**
  16. * Displays the sub-page heading
  17. */
  18. echo '<h2>' . "\n"
  19. . ' ' . PMA_Util::getImage('s_asci.png')
  20. . '' . __('Character Sets and Collations') . "\n"
  21. . '</h2>' . "\n";
  22. /**
  23. * Includes the required charset library
  24. */
  25. require_once 'libraries/mysql_charsets.lib.php';
  26. /**
  27. * Outputs the result
  28. */
  29. echo '<div id="div_mysql_charset_collations">' . "\n"
  30. . '<table class="data noclick">' . "\n"
  31. . '<tr><th>' . __('Collation') . '</th>' . "\n"
  32. . ' <th>' . __('Description') . '</th>' . "\n"
  33. . '</tr>' . "\n";
  34. $i = 0;
  35. $table_row_count = count($mysql_charsets) + count($mysql_collations);
  36. foreach ($mysql_charsets as $current_charset) {
  37. if ($i >= $table_row_count / 2) {
  38. $i = 0;
  39. echo '</table>' . "\n"
  40. . '<table class="data noclick">' . "\n"
  41. . '<tr><th>' . __('Collation') . '</th>' . "\n"
  42. . ' <th>' . __('Description') . '</th>' . "\n"
  43. . '</tr>' . "\n";
  44. }
  45. $i++;
  46. echo '<tr><th colspan="2" class="right">' . "\n"
  47. . ' ' . htmlspecialchars($current_charset) . "\n"
  48. . (empty($mysql_charsets_descriptions[$current_charset])
  49. ? ''
  50. : ' (<i>' . htmlspecialchars(
  51. $mysql_charsets_descriptions[$current_charset]
  52. ) . '</i>)' . "\n")
  53. . ' </th>' . "\n"
  54. . '</tr>' . "\n";
  55. $odd_row = true;
  56. foreach ($mysql_collations[$current_charset] as $current_collation) {
  57. $i++;
  58. echo '<tr class="'
  59. . ($odd_row ? 'odd' : 'even')
  60. . ($mysql_default_collations[$current_charset] == $current_collation
  61. ? ' marked'
  62. : '')
  63. . ($mysql_collations_available[$current_collation] ? '' : ' disabled')
  64. . '">' . "\n"
  65. . ' <td>' . htmlspecialchars($current_collation) . '</td>' . "\n"
  66. . ' <td>' . PMA_getCollationDescr($current_collation) . '</td>' . "\n"
  67. . '</tr>' . "\n";
  68. $odd_row = !$odd_row;
  69. }
  70. }
  71. unset($table_row_count);
  72. echo '</table>' . "\n"
  73. . '</div>' . "\n";
  74. ?>