2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Code for displaying language selection
10 * Sorts available languages by their true english names
12 * @param array the array to be sorted
13 * @param mixed a required parameter
14 * @return the sorted array
17 function PMA_language_cmp(&$a, &$b) {
18 return (strcmp($a[1], $b[1]));
19 } // end of the 'PMA_language_cmp()' function
22 * Displays for for language selection
26 function PMA_select_language($use_fieldset = FALSE) {
30 <form method
="post" action
="index.php" target
="_parent">
32 if (isset($GLOBALS['collation_connection'])) {
33 echo ' <input type="hidden" name="collation_connection" value="'
34 . htmlspecialchars($GLOBALS['collation_connection']) . '" />' . "\n";
36 if (isset($GLOBALS['convcharset'])) {
37 echo ' <input type="hidden" name="convcharset" value="'
38 . htmlspecialchars($GLOBALS['convcharset']) . '" />' . "\n";
40 if (strlen($GLOBALS['db'])) {
41 echo ' <input type="hidden" name="db" value="'
42 . htmlspecialchars($GLOBALS['db']) . '" />' . "\n";
44 if (strlen($GLOBALS['table'])) {
45 echo ' <input type="hidden" name="table" value="'
46 . htmlspecialchars($GLOBALS['table']) . '" />' . "\n";
48 if (isset($GLOBALS['server'])) {
49 echo ' <input type="hidden" name="server" value="'
50 . ((int)$GLOBALS['server']) . '" />' . "\n";
53 $language_title = $GLOBALS['strLanguage'] . ($GLOBALS['strLanguage'] != 'Language' ?
' - Language' : '') . ' <a href="./translators.html" target="documentation">' .
54 ($cfg['ReplaceHelpImg'] ?
55 '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_info.png" width="11" height="11" alt="Info" />' :
58 echo '<fieldset><legend xml:lang="en" dir="ltr">' . $language_title . '</legend>';
60 echo '<bdo xml:lang="en" dir="ltr">' . $language_title . ':</bdo>';
64 <select name
="lang" onchange
="this.form.submit();" xml
:lang
="en" dir
="ltr">
67 uasort($GLOBALS['available_languages'], 'PMA_language_cmp');
68 foreach ($GLOBALS['available_languages'] AS $id => $tmplang) {
69 $lang_name = ucfirst(substr(strrchr($tmplang[0], '|'), 1));
71 // Include native name if non empty
72 if (!empty($tmplang[3])) {
73 $lang_name = $tmplang[3] . ' - '
77 // Include charset if it makes sense
78 if (!defined('PMA_REMOVED_NON_UTF_8')) {
79 $lang_name .= ' (' . substr($id, strpos($id, '-') +
1) . ')';
82 //Is current one active?
84 $selected = ' selected="selected"';
90 echo '<option value="' . $id . '"' . $selected . '>' . $lang_name
105 echo '<fieldset class="tblFooters">';
109 <input type
="submit" value
="Go" />
119 } // End of function PMA_select_language