Text_Plain_Sql.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Text Plain SQL Transformations plugin for phpMyAdmin
  5. *
  6. * @package PhpMyAdmin-Transformations
  7. * @subpackage SQL
  8. */
  9. namespace PhpMyAdmin\Plugins\Transformations\Output;
  10. use PhpMyAdmin\Response;
  11. use PhpMyAdmin\Plugins\Transformations\Abs\SQLTransformationsPlugin;
  12. /**
  13. * Handles the sql transformation for text plain
  14. *
  15. * @package PhpMyAdmin-Transformations
  16. * @subpackage SQL
  17. */
  18. // @codingStandardsIgnoreLine
  19. class Text_Plain_Sql extends SQLTransformationsPlugin
  20. {
  21. /**
  22. * No-arg constructor
  23. */
  24. public function __construct()
  25. {
  26. if (!empty($GLOBALS['cfg']['CodemirrorEnable'])) {
  27. $response = Response::getInstance();
  28. $scripts = $response->getHeader()
  29. ->getScripts();
  30. $scripts->addFile('vendor/codemirror/lib/codemirror.js');
  31. $scripts->addFile('vendor/codemirror/mode/sql/sql.js');
  32. $scripts->addFile('vendor/codemirror/addon/runmode/runmode.js');
  33. $scripts->addFile('functions.js');
  34. }
  35. }
  36. /**
  37. * Gets the plugin`s MIME type
  38. *
  39. * @return string
  40. */
  41. public static function getMIMEType()
  42. {
  43. return "Text";
  44. }
  45. /**
  46. * Gets the plugin`s MIME subtype
  47. *
  48. * @return string
  49. */
  50. public static function getMIMESubtype()
  51. {
  52. return "Plain";
  53. }
  54. }