PageRenderTime 96ms CodeModel.GetById 41ms RepoModel.GetById 1ms app.codeStats 0ms

/xampp/phpMyAdmin/libraries/display_select_lang.lib.php

https://github.com/edmondscommerce/XAMPP-Magento-Demo-Site
PHP | 110 lines | 73 code | 13 blank | 24 comment | 12 complexity | a15726a43c2fc2a60b0883ea909cc48b MD5 | raw file
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Code for displaying language selection
  5. *
  6. * @version $Id: display_select_lang.lib.php 11449 2008-08-01 19:00:36Z lem9 $
  7. */
  8. if (! defined('PHPMYADMIN')) {
  9. exit;
  10. }
  11. /**
  12. * Sorts available languages by their true english names
  13. *
  14. * @param array the array to be sorted
  15. * @param mixed a required parameter
  16. * @return the sorted array
  17. * @access private
  18. */
  19. function PMA_language_cmp(&$a, &$b) {
  20. return (strcmp($a[1], $b[1]));
  21. } // end of the 'PMA_language_cmp()' function
  22. /**
  23. * Displays for for language selection
  24. *
  25. * @access public
  26. */
  27. function PMA_select_language($use_fieldset = FALSE, $show_doc = TRUE) {
  28. global $cfg, $lang;
  29. ?>
  30. <form method="post" action="index.php" target="_parent">
  31. <?php
  32. $_form_params = array(
  33. 'db' => $GLOBALS['db'],
  34. 'table' => $GLOBALS['table'],
  35. );
  36. echo PMA_generate_common_hidden_inputs($_form_params);
  37. // For non-English, display "Language" with emphasis because it's
  38. // not a proper word in the current language; we show it to help
  39. // people recognize the dialog
  40. $language_title = $GLOBALS['strLanguage']
  41. . ($GLOBALS['strLanguage'] != 'Language' ? ' - <em>Language</em>' : '');
  42. if ($show_doc) {
  43. $language_title .= ' <a href="./translators.html" target="documentation">' .
  44. ($cfg['ReplaceHelpImg']
  45. ? '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_info.png" width="11" height="11" alt="Info" />'
  46. : '(*)') . '</a>';
  47. }
  48. if ($use_fieldset) {
  49. echo '<fieldset><legend xml:lang="en" dir="ltr">' . $language_title . '</legend>';
  50. } else {
  51. echo '<bdo xml:lang="en" dir="ltr">' . $language_title . ':</bdo>';
  52. }
  53. ?>
  54. <select name="lang" onchange="this.form.submit();" xml:lang="en" dir="ltr">
  55. <?php
  56. uasort($GLOBALS['available_languages'], 'PMA_language_cmp');
  57. foreach ($GLOBALS['available_languages'] as $id => $tmplang) {
  58. $lang_name = ucfirst(substr(strrchr($tmplang[0], '|'), 1));
  59. // Include native name if non empty
  60. if (!empty($tmplang[3])) {
  61. $lang_name = $tmplang[3] . ' - '
  62. . $lang_name;
  63. }
  64. //Is current one active?
  65. if ($lang == $id) {
  66. $selected = ' selected="selected"';
  67. } else {
  68. $selected = '';
  69. }
  70. echo ' ';
  71. echo '<option value="' . $id . '"' . $selected . '>' . $lang_name
  72. . '</option>' . "\n";
  73. }
  74. ?>
  75. </select>
  76. <?php
  77. if ($use_fieldset) {
  78. echo '</fieldset>';
  79. }
  80. ?>
  81. <noscript>
  82. <?php
  83. if ($use_fieldset) {
  84. echo '<fieldset class="tblFooters">';
  85. }
  86. ?>
  87. <input type="submit" value="Go" />
  88. <?php
  89. if ($use_fieldset) {
  90. echo '</fieldset>';
  91. }
  92. ?>
  93. </noscript>
  94. </form>
  95. <?php
  96. } // End of function PMA_select_language
  97. ?>