3 * Code for displaying language selection
8 * Sorts available languages by their true english names
10 * @param array the array to be sorted
11 * @param mixed a required parameter
12 * @return the sorted array
15 function PMA_language_cmp( &$a, &$b ) {
16 return (strcmp($a[1], $b[1]));
17 } // end of the 'PMA_language_cmp()' function
20 * Displays for for language selection
24 function PMA_select_language($use_fieldset = FALSE) {
28 <form method
="post" action
="index.php" target
="_parent">
30 if (isset($GLOBALS['collation_connection'])) {
31 echo ' <input type="hidden" name="collation_connection" value="'
32 . htmlspecialchars($GLOBALS['collation_connection']) . '" />' . "\n";
34 if (isset($GLOBALS['convcharset'])) {
35 echo ' <input type="hidden" name="convcharset" value="'
36 . htmlspecialchars($GLOBALS['convcharset']) . '" />' . "\n";
38 if (isset($GLOBALS['db'])) {
39 echo ' <input type="hidden" name="db" value="'
40 . htmlspecialchars($GLOBALS['db']) . '" />' . "\n";
42 if (isset($GLOBALS['table'])) {
43 echo ' <input type="hidden" name="table" value="'
44 . htmlspecialchars($GLOBALS['table']) . '" />' . "\n";
46 if (isset($GLOBALS['server'])) {
47 echo ' <input type="hidden" name="server" value="'
48 . ((int)$GLOBALS['server']) . '" />' . "\n";
51 $language_title = $GLOBALS['strLanguage'] . ($GLOBALS['strLanguage'] != 'Language' ?
' - Language' : '') . ' <a href="./translators.html" target="documentation">' .
52 ( $cfg['ReplaceHelpImg'] ?
53 '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_info.png" width="11" height="11" alt="Info" />' :
56 echo '<fieldset><legend xml:lang="en" dir="ltr">' . $language_title . '</legend>';
58 echo '<bdo xml:lang="en" dir="ltr">' . $language_title . ':</bdo>';
62 <select name
="lang" onchange
="this.form.submit();" xml
:lang
="en" dir
="ltr">
65 uasort($GLOBALS['available_languages'], 'PMA_language_cmp');
66 foreach ($GLOBALS['available_languages'] AS $id => $tmplang) {
67 $lang_name = ucfirst(substr(strrchr($tmplang[0], '|'), 1));
69 // Include native name if non empty
70 if (!empty($tmplang[3])) {
71 $lang_name = $tmplang[3] . ' - '
75 // Include charset if it makes sense
76 if (!defined('PMA_REMOVED_NON_UTF_8')) {
77 $lang_name .= ' (' . substr($id, strpos($id, '-') +
1) . ')';
80 //Is current one active?
82 $selected = ' selected="selected"';
88 echo '<option value="' . $id . '"' . $selected . '>' . $lang_name
103 echo '<fieldset class="tblFooters">';
107 <input type
="submit" value
="Go" />
117 } // End of function PMA_select_language