Do not compare db if not defined.
[phpmyadmin/last10db.git] / server_collations.php
blob66be80e86be694048c071f5d41b171c22498bab6
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 /**
6 * requirements
7 */
8 if ( ! defined( 'PMA_NO_VARIABLES_IMPORT' ) ) {
9 define( 'PMA_NO_VARIABLES_IMPORT', true );
11 require_once('./libraries/common.lib.php');
13 /**
14 * Does the common work
16 require('./libraries/server_common.inc.php');
19 /**
20 * Displays the links
22 require('./libraries/server_links.inc.php');
25 /**
26 * Displays the sub-page heading
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";
36 /**
37 * Checks the MySQL version
39 if (PMA_MYSQL_INT_VERSION < 40100) {
40 // TODO: Some nice Message :-)
41 require_once('./libraries/footer.inc.php');
45 /**
46 * Includes the required charset library
48 require_once('./libraries/mysql_charsets.lib.php');
51 /**
52 * Outputs the result
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";
60 $i = 0;
61 $table_row_count = count($mysql_charsets) + $mysql_collations_count;
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";
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;
97 unset($table_row_count);
98 echo '</table>' . "\n"
99 . '</div>' . "\n";
101 require_once('./libraries/footer.inc.php');