transformation_overview.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Lists available transformation plugins
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. use PhpMyAdmin\Response;
  9. use PhpMyAdmin\Transformations;
  10. /**
  11. * Gets some core libraries and displays a top message if required
  12. */
  13. require_once './libraries/common.inc.php';
  14. $response = Response::getInstance();
  15. $header = $response->getHeader();
  16. $header->disableMenuAndConsole();
  17. $types = Transformations::getAvailableMIMEtypes();
  18. ?>
  19. <h2><?php echo __('Available MIME types'); ?></h2>
  20. <?php
  21. foreach ($types['mimetype'] as $key => $mimetype) {
  22. if (isset($types['empty_mimetype'][$mimetype])) {
  23. echo '<i>' , htmlspecialchars($mimetype) , '</i><br />';
  24. } else {
  25. echo htmlspecialchars($mimetype) , '<br />';
  26. }
  27. }
  28. $transformation_types = array(
  29. 'transformation', 'input_transformation'
  30. );
  31. $label = array(
  32. 'transformation' => __('Available browser display transformations'),
  33. 'input_transformation' => __('Available input transformations')
  34. );
  35. $th = array(
  36. 'transformation' => __('Browser display transformation'),
  37. 'input_transformation' => __('Input transformation')
  38. );
  39. ?>
  40. <br />
  41. <?php foreach ($transformation_types as $ttype) { ?>
  42. <a name="<?php echo $ttype; ?>"></a>
  43. <h2><?php echo $label[$ttype] ?></h2>
  44. <table width="90%">
  45. <thead>
  46. <tr>
  47. <th><?php echo $th[$ttype] ?></th>
  48. <th><?php echo _pgettext('for MIME transformation', 'Description'); ?></th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. <?php
  53. foreach ($types[$ttype] as $key => $transform) {
  54. $desc = Transformations::getDescription($types[$ttype . '_file'][$key]);
  55. ?>
  56. <tr>
  57. <td><?php echo htmlspecialchars($transform); ?></td>
  58. <td><?php echo htmlspecialchars($desc); ?></td>
  59. </tr>
  60. <?php
  61. }
  62. ?>
  63. </tbody>
  64. </table>
  65. <?php
  66. } // End of foreach ($transformation_types)