Text_Plain_SqlEditor.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * SQL editing with syntax highlighted CodeMirror editor
  5. *
  6. * @package PhpMyAdmin-Transformations
  7. * @subpackage SQL
  8. */
  9. namespace PhpMyAdmin\Plugins\Transformations\Input;
  10. use PhpMyAdmin\Plugins\Transformations\Abs\CodeMirrorEditorTransformationPlugin;
  11. /**
  12. * SQL editing with syntax highlighted CodeMirror editor
  13. *
  14. * @package PhpMyAdmin-Transformations
  15. * @subpackage SQL
  16. */
  17. // @codingStandardsIgnoreLine
  18. class Text_Plain_SqlEditor extends CodeMirrorEditorTransformationPlugin
  19. {
  20. /**
  21. * Gets the transformation description of the specific plugin
  22. *
  23. * @return string
  24. */
  25. public static function getInfo()
  26. {
  27. return __(
  28. 'Syntax highlighted CodeMirror editor for SQL.'
  29. );
  30. }
  31. /**
  32. * Returns the array of scripts (filename) required for plugin
  33. * initialization and handling
  34. *
  35. * @return array javascripts to be included
  36. */
  37. public function getScripts()
  38. {
  39. $scripts = array();
  40. if ($GLOBALS['cfg']['CodemirrorEnable']) {
  41. $scripts[] = 'vendor/codemirror/lib/codemirror.js';
  42. $scripts[] = 'vendor/codemirror/mode/sql/sql.js';
  43. $scripts[] = 'transformations/sql_editor.js';
  44. }
  45. return $scripts;
  46. }
  47. /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
  48. /**
  49. * Gets the transformation name of the specific plugin
  50. *
  51. * @return string
  52. */
  53. public static function getName()
  54. {
  55. return "SQL";
  56. }
  57. /**
  58. * Gets the plugin`s MIME type
  59. *
  60. * @return string
  61. */
  62. public static function getMIMEType()
  63. {
  64. return "Text";
  65. }
  66. /**
  67. * Gets the plugin`s MIME subtype
  68. *
  69. * @return string
  70. */
  71. public static function getMIMESubtype()
  72. {
  73. return "Plain";
  74. }
  75. }