2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Code for displaying language selection
9 if (! defined('PHPMYADMIN')) {
14 * Sorts available languages by their true english names
16 * @param array the array to be sorted
17 * @param mixed a required parameter
18 * @return the sorted array
21 function PMA_language_cmp(&$a, &$b) {
22 return (strcmp($a[1], $b[1]));
23 } // end of the 'PMA_language_cmp()' function
26 * Displays for for language selection
30 function PMA_select_language($use_fieldset = FALSE, $show_doc = TRUE) {
34 <form method
="post" action
="index.php" target
="_parent">
36 $_form_params = array(
37 'db' => $GLOBALS['db'],
38 'table' => $GLOBALS['table'],
40 echo PMA_generate_common_hidden_inputs($_form_params);
42 // For non-English, display "Language" with emphasis because it's
43 // not a proper word in the current language; we show it to help
44 // people recognize the dialog
45 $language_title = $GLOBALS['strLanguage']
46 . ($GLOBALS['strLanguage'] != 'Language' ?
' - <em>Language</em>' : '');
48 $language_title .= ' <a href="./translators.html" target="documentation">' .
49 ($cfg['ReplaceHelpImg']
50 ?
'<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_info.png" width="11" height="11" alt="Info" />'
54 echo '<fieldset><legend xml:lang="en" dir="ltr">' . $language_title . '</legend>';
56 echo '<bdo xml:lang="en" dir="ltr">' . $language_title . ':</bdo>';
60 <select name
="lang" onchange
="this.form.submit();" xml
:lang
="en" dir
="ltr">
63 uasort($GLOBALS['available_languages'], 'PMA_language_cmp');
64 foreach ($GLOBALS['available_languages'] as $id => $tmplang) {
65 $lang_name = ucfirst(substr(strrchr($tmplang[0], '|'), 1));
67 // Include native name if non empty
68 if (!empty($tmplang[3])) {
69 $lang_name = $tmplang[3] . ' - '
73 //Is current one active?
75 $selected = ' selected="selected"';
81 echo '<option value="' . $id . '"' . $selected . '>' . $lang_name
96 echo '<fieldset class="tblFooters">';
100 <input type
="submit" value
="Go" />
110 } // End of function PMA_select_language