Translated using Weblate (Bulgarian)
[phpmyadmin.git] / server_engines.php
blobfca316e42f94ce825a294478fbfe3df5bffad5ea
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * display list of server engines and additional information about them
6 * @package PhpMyAdmin
7 */
9 /**
10 * requirements
12 require_once 'libraries/common.inc.php';
14 /**
15 * Does the common work
17 require 'libraries/server_common.inc.php';
18 require 'libraries/StorageEngine.class.php';
20 /**
21 * start output
23 $response = PMA_Response::getInstance();
24 $response->addHTML(PMA_getServerEnginesHtml());
26 exit;
29 /**
30 * setup HTML for server Engines information
32 * @param null
34 * @return string
36 function PMA_getServerEnginesHtml()
38 /**
39 * Did the user request information about a certain storage engine?
41 $html = '';
42 if (empty($_REQUEST['engine'])
43 || ! PMA_StorageEngine::isValid($_REQUEST['engine'])
44 ) {
45 $html .= PMA_getAllServerEnginesHtml();
46 } else {
47 $html .= PMA_getSpecifiedServerEnginesHtml();
50 return $html;
53 /**
54 * setup HTML for server all Engines information
56 * @param null
58 * @return string
60 function PMA_getAllServerEnginesHtml()
62 /**
63 * Displays the sub-page heading
65 $html = '<h2>' . "\n"
66 . PMA_Util::getImage('b_engine.png')
67 . "\n" . __('Storage Engines') . "\n"
68 . '</h2>' . "\n";
70 /**
71 * Displays the table header
73 $html .= '<table class="noclick">' . "\n"
74 . '<thead>' . "\n"
75 . '<tr><th>' . __('Storage Engine') . '</th>' . "\n"
76 . ' <th>' . __('Description') . '</th>' . "\n"
77 . '</tr>' . "\n"
78 . '</thead>' . "\n"
79 . '<tbody>' . "\n";
82 /**
83 * Listing the storage engines
85 $odd_row = true;
86 foreach (PMA_StorageEngine::getStorageEngines() as $engine => $details) {
87 $html .= '<tr class="'
88 . ($odd_row ? 'odd' : 'even')
89 . ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED'
90 ? ' disabled' : '')
91 . '">' . "\n"
92 . ' <td><a rel="newpage" href="server_engines.php'
93 . PMA_generate_common_url(array('engine' => $engine)) . '">' . "\n"
94 . ' ' . htmlspecialchars($details['Engine']) . "\n"
95 . ' </a></td>' . "\n"
96 . ' <td>' . htmlspecialchars($details['Comment']) . '</td>' . "\n"
97 . '</tr>' . "\n";
98 $odd_row = !$odd_row;
101 unset($odd_row, $engine, $details);
102 $html .= '</tbody>' . "\n"
103 . '</table>' . "\n";
105 return $html;
109 * setup HTML for a given Storage Engine
111 * @param null
113 * @return string
115 function PMA_getSpecifiedServerEnginesHtml()
118 * Displays details about a given Storage Engine
120 $html = '';
121 $engine_plugin = PMA_StorageEngine::getEngine($_REQUEST['engine']);
122 $html .= '<h2>' . "\n"
123 . PMA_Util::getImage('b_engine.png')
124 . ' ' . htmlspecialchars($engine_plugin->getTitle()) . "\n"
125 . ' ' . PMA_Util::showMySQLDocu('', $engine_plugin->getMysqlHelpPage())
126 . "\n" . '</h2>' . "\n\n";
127 $html .= '<p>' . "\n"
128 . ' <em>' . "\n"
129 . ' ' . htmlspecialchars($engine_plugin->getComment()) . "\n"
130 . ' </em>' . "\n"
131 . '</p>' . "\n\n";
132 $infoPages = $engine_plugin->getInfoPages();
133 if (! empty($infoPages) && is_array($infoPages)) {
134 $html .= '<p>' . "\n"
135 . ' <strong>[</strong>' . "\n";
136 if (empty($_REQUEST['page'])) {
137 $html .= ' <strong>' . __('Variables') . '</strong>' . "\n";
138 } else {
139 $html .= ' <a href="server_engines.php'
140 . PMA_generate_common_url(array('engine' => $_REQUEST['engine']))
141 . '">' . __('Variables') . '</a>' . "\n";
143 foreach ($infoPages as $current => $label) {
144 $html .= ' <strong>|</strong>' . "\n";
145 if (isset($_REQUEST['page']) && $_REQUEST['page'] == $current) {
146 $html .= ' <strong>' . $label . '</strong>' . "\n";
147 } else {
148 $html .= ' <a href="server_engines.php'
149 . PMA_generate_common_url(
150 array('engine' => $_REQUEST['engine'], 'page' => $current)
152 . '">' . htmlspecialchars($label) . '</a>' . "\n";
155 unset($current, $label);
156 $html .= ' <strong>]</strong>' . "\n"
157 . '</p>' . "\n\n";
159 unset($infoPages, $page_output);
160 if (! empty($_REQUEST['page'])) {
161 $page_output = $engine_plugin->getPage($_REQUEST['page']);
163 if (! empty($page_output)) {
164 $html .= $page_output;
165 } else {
166 $html .= '<p> ' . $engine_plugin->getSupportInformationMessage() . "\n"
167 . '</p>' . "\n"
168 . $engine_plugin->getHtmlVariables();
171 return $html;