Add OK and Cancel button for grid editing
[phpmyadmin/arisferyanto.git] / libraries / display_select_lang.lib.php
blobf112fdcfd6869ba3506a35633b48f986ea831701
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Code for displaying language selection
6 * @package PhpMyAdmin
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 /**
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
18 * @access private
20 function PMA_language_cmp(&$a, &$b)
22 return (strcmp($a[1], $b[1]));
23 } // end of the 'PMA_language_cmp()' function
25 /**
26 * Displays for for language selection
28 * @access public
30 function PMA_select_language($use_fieldset = false, $show_doc = true)
32 global $cfg, $lang;
35 <form method="post" action="index.php" target="_parent">
36 <?php
37 $_form_params = array(
38 'db' => $GLOBALS['db'],
39 'table' => $GLOBALS['table'],
41 echo PMA_generate_common_hidden_inputs($_form_params);
43 // For non-English, display "Language" with emphasis because it's
44 // not a proper word in the current language; we show it to help
45 // people recognize the dialog
46 $language_title = __('Language')
47 . (__('Language') != 'Language' ? ' - <em>Language</em>' : '');
48 if ($show_doc) {
49 $language_title .= PMA_showDocu('faq7_2');
51 if ($use_fieldset) {
52 echo '<fieldset><legend xml:lang="en" dir="ltr">' . $language_title . '</legend>';
53 } else {
54 echo '<bdo xml:lang="en" dir="ltr">' . $language_title . ':</bdo>';
58 <select name="lang" class="autosubmit" xml:lang="en" dir="ltr">
59 <?php
61 uasort($GLOBALS['available_languages'], 'PMA_language_cmp');
62 foreach ($GLOBALS['available_languages'] as $id => $tmplang) {
63 $lang_name = PMA_langName($tmplang);
65 //Is current one active?
66 if ($lang == $id) {
67 $selected = ' selected="selected"';
68 } else {
69 $selected = '';
72 echo ' ';
73 echo '<option value="' . $id . '"' . $selected . '>' . $lang_name
74 . '</option>' . "\n";
78 </select>
79 <?php
80 if ($use_fieldset) {
81 echo '</fieldset>';
85 <noscript>
86 <?php
87 if ($use_fieldset) {
88 echo '<fieldset class="tblFooters">';
92 <input type="submit" value="Go" />
93 <?php
94 if ($use_fieldset) {
95 echo '</fieldset>';
99 </noscript>
100 </form>
101 <?php
102 } // End of function PMA_select_language