Translated using Weblate (Dutch)
[phpmyadmin.git] / libraries / server_engines.lib.php
blobf8c9710171d5669972c8a9a4997f2756876e6ed1
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 /**
5 * functions for displaying server engines
7 * @usedby server_engines.php
9 * @package PhpMyAdmin
11 if (! defined('PHPMYADMIN')) {
12 exit;
15 /**
16 * setup HTML for server Engines information
18 * @return string
20 function PMA_getHtmlForServerEngines()
22 /**
23 * Did the user request information about a certain storage engine?
25 $html = '';
26 if (empty($_REQUEST['engine'])
27 || ! PMA_StorageEngine::isValid($_REQUEST['engine'])
28 ) {
29 $html .= PMA_getHtmlForAllServerEngines();
30 } else {
31 $html .= PMA_getHtmlForSpecifiedServerEngines();
34 return $html;
37 /**
38 * setup HTML for server all Engines information
40 * @return string
42 function PMA_getHtmlForAllServerEngines()
44 /**
45 * Displays the table header
47 $html = '<table class="noclick">' . "\n"
48 . '<thead>' . "\n"
49 . '<tr><th>' . __('Storage Engine') . '</th>' . "\n"
50 . ' <th>' . __('Description') . '</th>' . "\n"
51 . '</tr>' . "\n"
52 . '</thead>' . "\n"
53 . '<tbody>' . "\n";
56 /**
57 * Listing the storage engines
59 $odd_row = true;
60 foreach (PMA_StorageEngine::getStorageEngines() as $engine => $details) {
61 $html .= '<tr class="'
62 . ($odd_row ? 'odd' : 'even')
63 . ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED'
64 ? ' disabled' : '')
65 . '">' . "\n"
66 . ' <td><a rel="newpage" href="server_engines.php'
67 . PMA_URL_getCommon(array('engine' => $engine)) . '">' . "\n"
68 . ' ' . htmlspecialchars($details['Engine']) . "\n"
69 . ' </a></td>' . "\n"
70 . ' <td>' . htmlspecialchars($details['Comment']) . '</td>' . "\n"
71 . '</tr>' . "\n";
72 $odd_row = !$odd_row;
75 unset($odd_row, $engine, $details);
76 $html .= '</tbody>' . "\n"
77 . '</table>' . "\n";
79 return $html;
82 /**
83 * setup HTML for a given Storage Engine
85 * @return string
87 function PMA_getHtmlForSpecifiedServerEngines()
89 /**
90 * Displays details about a given Storage Engine
92 $html = '';
93 $engine_plugin = PMA_StorageEngine::getEngine($_REQUEST['engine']);
94 $html .= '<h2>' . "\n"
95 . PMA_Util::getImage('b_engine.png')
96 . ' ' . htmlspecialchars($engine_plugin->getTitle()) . "\n"
97 . ' ' . PMA_Util::showMySQLDocu($engine_plugin->getMysqlHelpPage())
98 . "\n" . '</h2>' . "\n\n";
99 $html .= '<p>' . "\n"
100 . ' <em>' . "\n"
101 . ' ' . htmlspecialchars($engine_plugin->getComment()) . "\n"
102 . ' </em>' . "\n"
103 . '</p>' . "\n\n";
104 $infoPages = $engine_plugin->getInfoPages();
105 if (! empty($infoPages) && is_array($infoPages)) {
106 $html .= '<p>' . "\n"
107 . ' <strong>[</strong>' . "\n";
108 if (empty($_REQUEST['page'])) {
109 $html .= ' <strong>' . __('Variables') . '</strong>' . "\n";
110 } else {
111 $html .= ' <a href="server_engines.php'
112 . PMA_URL_getCommon(array('engine' => $_REQUEST['engine']))
113 . '">' . __('Variables') . '</a>' . "\n";
115 foreach ($infoPages as $current => $label) {
116 $html .= ' <strong>|</strong>' . "\n";
117 if (isset($_REQUEST['page']) && $_REQUEST['page'] == $current) {
118 $html .= ' <strong>' . $label . '</strong>' . "\n";
119 } else {
120 $html .= ' <a href="server_engines.php'
121 . PMA_URL_getCommon(
122 array('engine' => $_REQUEST['engine'], 'page' => $current)
124 . '">' . htmlspecialchars($label) . '</a>' . "\n";
127 unset($current, $label);
128 $html .= ' <strong>]</strong>' . "\n"
129 . '</p>' . "\n\n";
131 unset($infoPages, $page_output);
132 if (! empty($_REQUEST['page'])) {
133 $page_output = $engine_plugin->getPage($_REQUEST['page']);
135 if (! empty($page_output)) {
136 $html .= $page_output;
137 } else {
138 $html .= '<p> ' . $engine_plugin->getSupportInformationMessage() . "\n"
139 . '</p>' . "\n"
140 . $engine_plugin->getHtmlVariables();
143 return $html;