2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Code for displaying language selection
8 if (! defined('PHPMYADMIN')) {
13 * Sorts available languages by their true english names
15 * @param array the array to be sorted
16 * @param mixed a required parameter
17 * @return the sorted array
20 function PMA_language_cmp(&$a, &$b) {
21 return (strcmp($a[1], $b[1]));
22 } // end of the 'PMA_language_cmp()' function
25 * Displays for for language selection
29 function PMA_select_language($use_fieldset = FALSE) {
33 <form method
="post" action
="index.php" target
="_parent">
35 if (isset($GLOBALS['collation_connection'])) {
36 echo ' <input type="hidden" name="collation_connection" value="'
37 . htmlspecialchars($GLOBALS['collation_connection']) . '" />' . "\n";
39 if (isset($GLOBALS['convcharset'])) {
40 echo ' <input type="hidden" name="convcharset" value="'
41 . htmlspecialchars($GLOBALS['convcharset']) . '" />' . "\n";
43 if (strlen($GLOBALS['db'])) {
44 echo ' <input type="hidden" name="db" value="'
45 . htmlspecialchars($GLOBALS['db']) . '" />' . "\n";
47 if (strlen($GLOBALS['table'])) {
48 echo ' <input type="hidden" name="table" value="'
49 . htmlspecialchars($GLOBALS['table']) . '" />' . "\n";
51 if (isset($GLOBALS['server'])) {
52 echo ' <input type="hidden" name="server" value="'
53 . ((int)$GLOBALS['server']) . '" />' . "\n";
56 $language_title = $GLOBALS['strLanguage'] . ($GLOBALS['strLanguage'] != 'Language' ?
' - Language' : '') . ' <a href="./translators.html" target="documentation">' .
57 ($cfg['ReplaceHelpImg'] ?
58 '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_info.png" width="11" height="11" alt="Info" />' :
61 echo '<fieldset><legend xml:lang="en" dir="ltr">' . $language_title . '</legend>';
63 echo '<bdo xml:lang="en" dir="ltr">' . $language_title . ':</bdo>';
67 <select name
="lang" onchange
="this.form.submit();" xml
:lang
="en" dir
="ltr">
70 uasort($GLOBALS['available_languages'], 'PMA_language_cmp');
71 foreach ($GLOBALS['available_languages'] AS $id => $tmplang) {
72 $lang_name = ucfirst(substr(strrchr($tmplang[0], '|'), 1));
74 // Include native name if non empty
75 if (!empty($tmplang[3])) {
76 $lang_name = $tmplang[3] . ' - '
80 // Include charset if it makes sense
81 if (!defined('PMA_REMOVED_NON_UTF_8')) {
82 $lang_name .= ' (' . substr($id, strpos($id, '-') +
1) . ')';
85 //Is current one active?
87 $selected = ' selected="selected"';
93 echo '<option value="' . $id . '"' . $selected . '>' . $lang_name
108 echo '<fieldset class="tblFooters">';
112 <input type
="submit" value
="Go" />
122 } // End of function PMA_select_language