array('title' => $title, 'desc' => $description); * @param string Prefix for the SHOW VARIABLES query. * @return string The table that was generated based on the given information. */ function PMA_generateEngineDetails($variables, $like = null) { /** * Get the variables! */ if (!empty($variables)) { $sql_query = 'SHOW ' . (PMA_MYSQL_INT_VERSION >= 40102 ? 'GLOBAL ' : '') . 'VARIABLES' . (empty($like) ? '' : ' LIKE \'' . $like . '\'') . ';'; $res = PMA_DBI_query($sql_query); $mysql_vars = array(); while ($row = PMA_DBI_fetch_row($res)) { if (isset($variables[$row[0]])) { $mysql_vars[$row[0]] = $row[1]; } } PMA_DBI_free_result($res); unset($res, $row, $sql_query); } if (empty($mysql_vars)) { return '

' . "\n" . ' ' . $GLOBALS['strNoDetailsForEngine'] . "\n" . '

' . "\n"; } $dt_table = '' . "\n"; $odd_row = false; $has_content = false; foreach ($variables as $var => $details) { if (!isset($mysql_vars[$var])) { continue; } if (!isset($details['type'])) { $details['type'] = PMA_ENGINE_DETAILS_TYPE_PLAINTEXT; } $is_num = $details['type'] == PMA_ENGINE_DETAILS_TYPE_SIZE || $details['type'] == PMA_ENGINE_DETAILS_TYPE_NUMERIC; $dt_table .= '' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . '' . "\n"; $odd_row = !$odd_row; $has_content = true; } if (!$has_content) { return ''; } $dt_table .= '
' . "\n"; if (!empty($variables[$var]['desc'])) { $dt_table .= ' ' . PMA_showHint($details['desc']) . "\n"; } $dt_table .= ' ' . htmlspecialchars( empty($details['title']) ? $var : $details['title'] ) . "\n" . ' '; switch ($details['type']) { case PMA_ENGINE_DETAILS_TYPE_SIZE: $parsed_size = PMA_formatByteDown($mysql_vars[$var]); $dt_table .= $parsed_size[0] . ' ' . $parsed_size[1]; unset($parsed_size); break; case PMA_ENGINE_DETAILS_TYPE_NUMERIC: $dt_table .= PMA_formatNumber($mysql_vars[$var]) . ' '; break; default: $dt_table .= htmlspecialchars($mysql_vars[$var]) . ' '; } $dt_table .= '
' . "\n"; return $dt_table; } /** * Did the user request information about a certain storage engine? */ if ( empty($_REQUEST['engine']) || empty($mysql_storage_engines[$_REQUEST['engine']]) ) { /** * Displays the sub-page heading */ echo '

' . "\n" . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '' ) . "\n" . $strStorageEngines . "\n" . '

' . "\n"; /** * Displays the table header */ echo '' . "\n" . '' . "\n" . '' . "\n"; if (PMA_MYSQL_INT_VERSION >= 40102) { echo ' ' . "\n"; } echo '' . "\n" . '' . "\n" . '' . "\n"; /** * Listing the storage engines */ $odd_row = true; foreach ($mysql_storage_engines as $engine => $details) { echo '' . "\n" . ' ' . "\n"; if (PMA_MYSQL_INT_VERSION >= 40102) { echo ' ' . "\n"; } echo '' . "\n"; $odd_row = !$odd_row; } unset($odd_row, $engine, $details); echo '' . "\n" . '
' . $strStorageEngine . '' . $strDescription . '
' . "\n" . ' ' . htmlspecialchars($details['Engine']) . "\n" . ' ' . "\n" . ' ' . htmlspecialchars($details['Comment']) . "\n" . '
' . "\n"; } else { /** * Displays details about a given Storage Engine */ $engine_plugin = PMA_StorageEngine::getEngine($_REQUEST['engine']); echo '

' . "\n" . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '' ) . ' ' . htmlspecialchars($engine_plugin->getTitle()) . "\n" . ' ' . PMA_showMySQLDocu( '', $engine_plugin->getMysqlHelpPage() ) . "\n" . '

' . "\n\n"; if (PMA_MYSQL_INT_VERSION >= 40102) { echo '

' . "\n" . ' ' . "\n" . ' ' . htmlspecialchars($engine_plugin->getComment()) . "\n" . ' ' . "\n" . '

' . "\n\n"; } $infoPages = $engine_plugin->getInfoPages(); if (!empty($infoPages) && is_array($infoPages)) { echo '

' . "\n" . ' [' . "\n"; if (empty($_REQUEST['page'])) { echo ' ' . $strServerTabVariables . '' . "\n"; } else { echo ' ' . $strServerTabVariables . '' . "\n"; } foreach ($infoPages as $current => $label) { echo ' |' . "\n"; if (isset($_REQUEST['page']) && $_REQUEST['page'] == $current) { echo ' ' . $label . '' . "\n"; } else { echo ' ' . htmlspecialchars($label) . '' . "\n"; } } unset($current, $label); echo ' ]' . "\n" . '

' . "\n\n"; } unset($infoPages, $page_output); if (!empty($_REQUEST['page'])) { $page_output = $engine_plugin->getPage($_REQUEST['page']); } if (!empty($page_output)) { echo $page_output; } else { echo '

' . $engine_plugin->getSupportInformationMessage() . "\n" . '

' . "\n" . PMA_generateEngineDetails($engine_plugin->getVariables(), $engine_plugin->getVariablesLikePattern()); } } /** * Sends the footer */ require_once('./libraries/footer.inc.php'); ?>