server_common.lib.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Shared code for server pages
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. if (! defined('PHPMYADMIN')) {
  9. exit;
  10. }
  11. /**
  12. * Returns the html for the sub-page heading
  13. *
  14. * @param string $type Sub page type
  15. * @param string $link Link to the official MySQL documentation
  16. * @param bool $is_image Display image or icon, true: image, false: icon
  17. *
  18. * @return string
  19. */
  20. function PMA_getHtmlForSubPageHeader($type, $link='', $is_image=true)
  21. {
  22. //array contains Sub page icon and text
  23. $header = array();
  24. $header['variables']['image'] = 's_vars.png';
  25. $header['variables']['text'] = __('Server variables and settings');
  26. $header['engines']['image'] = 'b_engine.png';
  27. $header['engines']['text'] = __('Storage Engines');
  28. $header['plugins']['image'] = 'b_engine.png';
  29. $header['plugins']['text'] = __('Plugins');
  30. $header['binlog']['image'] = 's_tbl.png';
  31. $header['binlog']['text'] = __('Binary log');
  32. $header['collations']['image'] = 's_asci.png';
  33. $header['collations']['text'] = __('Character Sets and Collations');
  34. $header['replication']['image'] = 's_replication.png';
  35. $header['replication']['text'] = __('Replication');
  36. $header['database_statistics']['image'] = 's_db.png';
  37. $header['database_statistics']['text'] = __('Databases statistics');
  38. $header['databases']['image'] = 's_db.png';
  39. $header['databases']['text'] = __('Databases');
  40. $header['privileges']['image'] = 'b_usrlist.png';
  41. $header['privileges']['text'] = __('Privileges');
  42. if ($is_image) {
  43. $html = '<h2>' . "\n"
  44. . PMA_Util::getImage($header[$type]['image'])
  45. . ' ' . $header[$type]['text'] . "\n"
  46. . $link . '</h2>' . "\n";
  47. } else {
  48. $html = '<h2>' . "\n"
  49. . PMA_Util::getIcon($header[$type]['image'])
  50. . ' ' . $header[$type]['text'] . "\n"
  51. . $link . '</h2>' . "\n";
  52. }
  53. return $html;
  54. }
  55. ?>