Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Foellmann <foellmann@foe-services.de>2014-04-05 17:35:38 +0400
committerChristian Foellmann <foellmann@foe-services.de>2014-04-05 17:35:38 +0400
commit9eb27ef6ebc763ddc6f6278462b8ffeed6de0e36 (patch)
treed3b4a1c7ae68cafb05b9d60040c9c22d457cee62 /libraries/server_collations.lib.php
parentd472216554769ba596795f23a70c1809fa8897a3 (diff)
INIT phpmyadmin 4.1.12 multilanguage
Diffstat (limited to 'libraries/server_collations.lib.php')
-rw-r--r--libraries/server_collations.lib.php110
1 files changed, 110 insertions, 0 deletions
diff --git a/libraries/server_collations.lib.php b/libraries/server_collations.lib.php
new file mode 100644
index 0000000000..3c34d4ce5d
--- /dev/null
+++ b/libraries/server_collations.lib.php
@@ -0,0 +1,110 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+
+/**
+ * functions for displaying server Character Sets and Collations
+ *
+ * @usedby server_collations.php
+ *
+ * @package PhpMyAdmin
+ */
+if (! defined('PHPMYADMIN')) {
+ exit;
+}
+
+/**
+ * Returns the html for server Character Sets and Collations.
+ *
+ * @param Array $mysql_charsets Mysql Charsets list
+ * @param Array $mysql_collations Mysql Collations list
+ * @param Array $mysql_charsets_descriptions Charsets descriptions
+ * @param Array $mysql_default_collations Default Collations list
+ * @param Array $mysql_collations_available Available Collations list
+ *
+ * @return string
+ */
+function PMA_getHtmlForCharsets($mysql_charsets, $mysql_collations,
+ $mysql_charsets_descriptions, $mysql_default_collations,
+ $mysql_collations_available
+) {
+ /**
+ * Outputs the result
+ */
+ $html = '<div id="div_mysql_charset_collations">' . "\n"
+ . '<table class="data noclick">' . "\n"
+ . '<tr><th>' . __('Collation') . '</th>' . "\n"
+ . ' <th>' . __('Description') . '</th>' . "\n"
+ . '</tr>' . "\n";
+
+ $i = 0;
+ $table_row_count = count($mysql_charsets) + count($mysql_collations);
+
+ foreach ($mysql_charsets as $current_charset) {
+ if ($i >= $table_row_count / 2) {
+ $i = 0;
+ $html .= '</table>' . "\n"
+ . '<table class="data noclick">' . "\n"
+ . '<tr><th>' . __('Collation') . '</th>' . "\n"
+ . ' <th>' . __('Description') . '</th>' . "\n"
+ . '</tr>' . "\n";
+ }
+ $i++;
+ $html .= '<tr><th colspan="2" class="right">' . "\n"
+ . ' ' . htmlspecialchars($current_charset) . "\n"
+ . (empty($mysql_charsets_descriptions[$current_charset])
+ ? ''
+ : ' (<i>' . htmlspecialchars(
+ $mysql_charsets_descriptions[$current_charset]
+ ) . '</i>)' . "\n")
+ . ' </th>' . "\n"
+ . '</tr>' . "\n";
+
+ $html .= PMA_getHtmlForCollationCurrentCharset(
+ $current_charset,
+ $mysql_collations,
+ $i,
+ $mysql_default_collations,
+ $mysql_collations_available
+ );
+ }
+ unset($table_row_count);
+ $html .= '</table>' . "\n"
+ . '</div>' . "\n";
+
+ return $html;
+}
+
+/**
+ * Returns the html for Collations of Current Charset.
+ *
+ * @param String $current_charset Current Charset
+ * @param Array $mysql_collations Collations list
+ * @param int &$i Display Index
+ * @param Array $mysql_default_collations Default Collations list
+ * @param Array $mysql_collations_available Available Collations list
+ *
+ * @return string
+ */
+function PMA_getHtmlForCollationCurrentCharset(
+ $current_charset, $mysql_collations, &$i,
+ $mysql_default_collations, $mysql_collations_available
+) {
+ $odd_row = true;
+ $html = '';
+ foreach ($mysql_collations[$current_charset] as $current_collation) {
+ $i++;
+ $html .= '<tr class="'
+ . ($odd_row ? 'odd' : 'even')
+ . ($mysql_default_collations[$current_charset] == $current_collation
+ ? ' marked'
+ : '')
+ . ($mysql_collations_available[$current_collation] ? '' : ' disabled')
+ . '">' . "\n"
+ . ' <td>' . htmlspecialchars($current_collation) . '</td>' . "\n"
+ . ' <td>' . PMA_getCollationDescr($current_collation) . '</td>' . "\n"
+ . '</tr>' . "\n";
+ $odd_row = !$odd_row;
+ }
+ return $html;
+}
+?>