Removing old documentation
[openemr.git] / phpmyadmin / libraries / server_engines.lib.php
blobeddf7d4326828621672b836e0586fda0b01ad32a
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";
55 /**
56 * Listing the storage engines
58 $odd_row = true;
59 foreach (PMA_StorageEngine::getStorageEngines() as $engine => $details) {
60 $html .= '<tr class="'
61 . ($odd_row ? 'odd' : 'even')
62 . ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED'
63 ? ' disabled' : '')
64 . '">' . "\n"
65 . ' <td><a rel="newpage" href="server_engines.php'
66 . PMA_URL_getCommon(array('engine' => $engine)) . '">' . "\n"
67 . ' ' . htmlspecialchars($details['Engine']) . "\n"
68 . ' </a></td>' . "\n"
69 . ' <td>' . htmlspecialchars($details['Comment']) . '</td>' . "\n"
70 . '</tr>' . "\n";
71 $odd_row = !$odd_row;
74 unset($odd_row, $engine, $details);
75 $html .= '</tbody>' . "\n"
76 . '</table>' . "\n";
78 return $html;
81 /**
82 * setup HTML for a given Storage Engine
84 * @return string
86 function PMA_getHtmlForSpecifiedServerEngines()
88 /**
89 * Displays details about a given Storage Engine
91 $html = '';
92 $engine_plugin = PMA_StorageEngine::getEngine($_REQUEST['engine']);
93 $html .= '<h2>' . "\n"
94 . PMA_Util::getImage('b_engine.png')
95 . ' ' . htmlspecialchars($engine_plugin->getTitle()) . "\n"
96 . ' ' . PMA_Util::showMySQLDocu($engine_plugin->getMysqlHelpPage())
97 . "\n" . '</h2>' . "\n\n";
98 $html .= '<p>' . "\n"
99 . ' <em>' . "\n"
100 . ' ' . htmlspecialchars($engine_plugin->getComment()) . "\n"
101 . ' </em>' . "\n"
102 . '</p>' . "\n\n";
103 $infoPages = $engine_plugin->getInfoPages();
104 if (! empty($infoPages) && is_array($infoPages)) {
105 $html .= '<p>' . "\n"
106 . ' <strong>[</strong>' . "\n";
107 if (empty($_REQUEST['page'])) {
108 $html .= ' <strong>' . __('Variables') . '</strong>' . "\n";
109 } else {
110 $html .= ' <a href="server_engines.php'
111 . PMA_URL_getCommon(array('engine' => $_REQUEST['engine']))
112 . '">' . __('Variables') . '</a>' . "\n";
114 foreach ($infoPages as $current => $label) {
115 $html .= ' <strong>|</strong>' . "\n";
116 if (isset($_REQUEST['page']) && $_REQUEST['page'] == $current) {
117 $html .= ' <strong>' . $label . '</strong>' . "\n";
118 } else {
119 $html .= ' <a href="server_engines.php'
120 . PMA_URL_getCommon(
121 array('engine' => $_REQUEST['engine'], 'page' => $current)
123 . '">' . htmlspecialchars($label) . '</a>' . "\n";
126 unset($current, $label);
127 $html .= ' <strong>]</strong>' . "\n"
128 . '</p>' . "\n\n";
130 unset($infoPages, $page_output);
131 if (! empty($_REQUEST['page'])) {
132 $page_output = $engine_plugin->getPage($_REQUEST['page']);
134 if (! empty($page_output)) {
135 $html .= $page_output;
136 } else {
137 $html .= '<p> ' . $engine_plugin->getSupportInformationMessage() . "\n"
138 . '</p>' . "\n"
139 . $engine_plugin->getHtmlVariables();
142 return $html;