clarify code behavior
[phpmyadmin/sankalp_k.git] / server_engines.php
blob62cf545d41d76fbe6924e8d224e1b415cb641fff
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * display list of server enignes and additonal information about them
6 * @version $Id$
7 * @todo falcon storage enginge is not listed under dev.mysql.com/doc/refman but dev.mysql.com/doc/falcon/
8 * @package phpMyAdmin
9 */
11 /**
12 * no need for variables importing
13 * @ignore
15 if (! defined('PMA_NO_VARIABLES_IMPORT')) {
16 define('PMA_NO_VARIABLES_IMPORT', true);
19 /**
20 * requirements
22 require_once './libraries/common.inc.php';
24 /**
25 * Does the common work
27 require './libraries/server_common.inc.php';
28 require './libraries/StorageEngine.class.php';
31 /**
32 * Displays the links
34 require './libraries/server_links.inc.php';
36 /**
37 * Did the user request information about a certain storage engine?
39 if (empty($_REQUEST['engine'])
40 || ! PMA_StorageEngine::isValid($_REQUEST['engine'])) {
42 /**
43 * Displays the sub-page heading
45 echo '<h2>' . "\n"
46 . ($GLOBALS['cfg']['MainPageIconic']
47 ? '<img class="icon" src="' . $pmaThemeImage . 'b_engine.png"'
48 .' width="16" height="16" alt="" />' : '')
49 . "\n" . $strStorageEngines . "\n"
50 . '</h2>' . "\n";
53 /**
54 * Displays the table header
56 echo '<table>' . "\n"
57 . '<thead>' . "\n"
58 . '<tr><th>' . $strStorageEngine . '</th>' . "\n"
59 . ' <th>' . $strDescription . '</th>' . "\n"
60 . '</tr>' . "\n"
61 . '</thead>' . "\n"
62 . '<tbody>' . "\n";
65 /**
66 * Listing the storage engines
68 $odd_row = true;
69 foreach (PMA_StorageEngine::getStorageEngines() as $engine => $details) {
70 echo '<tr class="'
71 . ($odd_row ? 'odd' : 'even')
72 . ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED'
73 ? ' disabled'
74 : '')
75 . '">' . "\n"
76 . ' <td><a href="./server_engines.php'
77 . PMA_generate_common_url(array('engine' => $engine)) . '">' . "\n"
78 . ' ' . htmlspecialchars($details['Engine']) . "\n"
79 . ' </a></td>' . "\n"
80 . ' <td>' . htmlspecialchars($details['Comment']) . '</td>' . "\n"
81 . '</tr>' . "\n";
82 $odd_row = !$odd_row;
84 unset($odd_row, $engine, $details);
85 echo '</tbody>' . "\n"
86 . '</table>' . "\n";
88 } else {
90 /**
91 * Displays details about a given Storage Engine
94 $engine_plugin = PMA_StorageEngine::getEngine($_REQUEST['engine']);
95 echo '<h2>' . "\n"
96 . ($GLOBALS['cfg']['MainPageIconic']
97 ? '<img class="icon" src="' . $pmaThemeImage . 'b_engine.png"'
98 .' width="16" height="16" alt="" />' : '')
99 . ' ' . htmlspecialchars($engine_plugin->getTitle()) . "\n"
100 . ' ' . PMA_showMySQLDocu('', $engine_plugin->getMysqlHelpPage()) . "\n"
101 . '</h2>' . "\n\n";
102 echo '<p>' . "\n"
103 . ' <em>' . "\n"
104 . ' ' . htmlspecialchars($engine_plugin->getComment()) . "\n"
105 . ' </em>' . "\n"
106 . '</p>' . "\n\n";
107 $infoPages = $engine_plugin->getInfoPages();
108 if (!empty($infoPages) && is_array($infoPages)) {
109 echo '<p>' . "\n"
110 . ' <strong>[</strong>' . "\n";
111 if (empty($_REQUEST['page'])) {
112 echo ' <strong>' . $strServerTabVariables . '</strong>' . "\n";
113 } else {
114 echo ' <a href="./server_engines.php'
115 . PMA_generate_common_url(array('engine' => $_REQUEST['engine'])) . '">'
116 . $strServerTabVariables . '</a>' . "\n";
118 foreach ($infoPages as $current => $label) {
119 echo ' <strong>|</strong>' . "\n";
120 if (isset($_REQUEST['page']) && $_REQUEST['page'] == $current) {
121 echo ' <strong>' . $label . '</strong>' . "\n";
122 } else {
123 echo ' <a href="./server_engines.php'
124 . PMA_generate_common_url(
125 array('engine' => $_REQUEST['engine'], 'page' => $current))
126 . '">' . htmlspecialchars($label) . '</a>' . "\n";
129 unset($current, $label);
130 echo ' <strong>]</strong>' . "\n"
131 . '</p>' . "\n\n";
133 unset($infoPages, $page_output);
134 if (!empty($_REQUEST['page'])) {
135 $page_output = $engine_plugin->getPage($_REQUEST['page']);
137 if (!empty($page_output)) {
138 echo $page_output;
139 } else {
140 echo '<p> ' . $engine_plugin->getSupportInformationMessage() . "\n"
141 . '</p>' . "\n"
142 . $engine_plugin->getHtmlVariables();
147 * Sends the footer
149 require_once './libraries/footer.inc.php';