Words.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Helper functions for RTE
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. namespace PhpMyAdmin\Rte;
  9. /**
  10. * PhpMyAdmin\Rte\Words class
  11. *
  12. * @package PhpMyAdmin
  13. */
  14. class Words
  15. {
  16. /**
  17. * This function is used to retrieve some language strings that are used
  18. * in features that are common to routines, triggers and events.
  19. *
  20. * @param string $index The index of the string to get
  21. *
  22. * @return string The requested string or an empty string, if not available
  23. */
  24. public static function get($index)
  25. {
  26. global $_PMA_RTE;
  27. switch ($_PMA_RTE) {
  28. case 'RTN':
  29. $words = array(
  30. 'add' => __('Add routine'),
  31. 'docu' => 'STORED_ROUTINES',
  32. 'export' => __('Export of routine %s'),
  33. 'human' => __('routine'),
  34. 'no_create' => __(
  35. 'You do not have the necessary privileges to create a routine.'
  36. ),
  37. 'no_edit' => __(
  38. 'No routine with name %1$s found in database %2$s. '
  39. . 'You might be lacking the necessary privileges to edit this routine.'
  40. ),
  41. 'no_view' => __(
  42. 'No routine with name %1$s found in database %2$s. '
  43. . 'You might be lacking the necessary privileges to view/export this routine.'
  44. ),
  45. 'not_found' => __('No routine with name %1$s found in database %2$s.'),
  46. 'nothing' => __('There are no routines to display.'),
  47. 'title' => __('Routines'),
  48. );
  49. break;
  50. case 'TRI':
  51. $words = array(
  52. 'add' => __('Add trigger'),
  53. 'docu' => 'TRIGGERS',
  54. 'export' => __('Export of trigger %s'),
  55. 'human' => __('trigger'),
  56. 'no_create' => __(
  57. 'You do not have the necessary privileges to create a trigger.'
  58. ),
  59. 'not_found' => __('No trigger with name %1$s found in database %2$s.'),
  60. 'nothing' => __('There are no triggers to display.'),
  61. 'title' => __('Triggers'),
  62. );
  63. break;
  64. case 'EVN':
  65. $words = array(
  66. 'add' => __('Add event'),
  67. 'docu' => 'EVENTS',
  68. 'export' => __('Export of event %s'),
  69. 'human' => __('event'),
  70. 'no_create' => __(
  71. 'You do not have the necessary privileges to create an event.'
  72. ),
  73. 'not_found' => __('No event with name %1$s found in database %2$s.'),
  74. 'nothing' => __('There are no events to display.'),
  75. 'title' => __('Events'),
  76. );
  77. break;
  78. default:
  79. $words = array();
  80. break;
  81. }
  82. return isset($words[$index]) ? $words[$index] : '';
  83. } // end self::get()
  84. }