Rev Author Line No. Line
250 kaklik 1 <?php
2 /* $Id: server_collations.php,v 2.15 2005/12/07 12:58:14 cybot_tm Exp $ */
3 // vim: expandtab sw=4 ts=4 sts=4:
4  
5 /**
6 * requirements
7 */
8 if ( ! defined( 'PMA_NO_VARIABLES_IMPORT' ) ) {
9 define( 'PMA_NO_VARIABLES_IMPORT', true );
10 }
11 require_once('./libraries/common.lib.php');
12  
13 /**
14 * Does the common work
15 */
16 require('./libraries/server_common.inc.php');
17  
18  
19 /**
20 * Displays the links
21 */
22 require('./libraries/server_links.inc.php');
23  
24  
25 /**
26 * Displays the sub-page heading
27 */
28 echo '<h2>' . "\n"
29 . ' ' . ($GLOBALS['cfg']['MainPageIconic']
30 ? '<img class="icon" src="'. $GLOBALS['pmaThemeImage'] . 's_asci.png" alt="" />'
31 : '')
32 . '' . $strCharsetsAndCollations . "\n"
33 . '</h2>' . "\n";
34  
35  
36 /**
37 * Checks the MySQL version
38 */
39 if (PMA_MYSQL_INT_VERSION < 40100) {
40 // TODO: Some nice Message :-)
41 require_once('./libraries/footer.inc.php');
42 }
43  
44  
45 /**
46 * Includes the required charset library
47 */
48 require_once('./libraries/mysql_charsets.lib.php');
49  
50  
51 /**
52 * Outputs the result
53 */
54 echo '<div id="div_mysql_charset_collations">' . "\n"
55 . '<table class="data">' . "\n"
56 . '<tr><th>' . $strCollation . '</th>' . "\n"
57 . ' <th>' . $strDescription . '</th>' . "\n"
58 . '</tr>' . "\n";
59  
60 $i = 0;
61 $table_row_count = count($mysql_charsets) + $mysql_collations_count;
62  
63 foreach ($mysql_charsets as $current_charset) {
64 if ($i >= $table_row_count / 2) {
65 $i = 0;
66 echo '</table>' . "\n"
67 . '<table class="data">' . "\n"
68 . '<tr><th>' . $strCollation . '</th>' . "\n"
69 . ' <th>' . $strDescription . '</th>' . "\n"
70 . '</tr>' . "\n";
71 }
72 $i++;
73 echo '<tr><th colspan="2" align="right">' . "\n"
74 . ' ' . htmlspecialchars($current_charset) . "\n"
75 . (empty($mysql_charsets_descriptions[$current_charset])
76 ? ''
77 : ' (<i>' . htmlspecialchars(
78 $mysql_charsets_descriptions[$current_charset]) . '</i>)' . "\n")
79 . ' </th>' . "\n"
80 . '</tr>' . "\n";
81 $odd_row = true;
82 foreach ($mysql_collations[$current_charset] as $current_collation) {
83 $i++;
84 echo '<tr class="'
85 . ( $odd_row ? 'odd' : 'even' )
86 . ($mysql_default_collations[$current_charset] == $current_collation
87 ? ' marked'
88 : '')
89 . ($mysql_collations_available[$current_collation] ? '' : ' disabled')
90 . '">' . "\n"
91 . ' <td>' . htmlspecialchars($current_collation) . '</td>' . "\n"
92 . ' <td>' . PMA_getCollationDescr($current_collation) . '</td>' . "\n"
93 . '</tr>' . "\n";
94 $odd_row = !$odd_row;
95 }
96 }
97 unset($table_row_count);
98 echo '</table>' . "\n"
99 . '</div>' . "\n";
100  
101 require_once('./libraries/footer.inc.php');
102  
103 ?>