themes.rst.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. .. _themes:
  2. Custom Themes
  3. =============
  4. phpMyAdmin comes with support for third party themes. You can download
  5. additonal themes from our website at <https://www.phpmyadmin.net/themes/>.
  6. Configuration
  7. -------------
  8. Themes are configured with :config:option:`$cfg['ThemeManager']` and
  9. :config:option:`$cfg['ThemeDefault']`. Under :file:`./themes/`, you should not
  10. delete the directory ``pmahomme`` or its underlying structure, because this is
  11. the system theme used by phpMyAdmin. ``pmahomme`` contains all images and
  12. styles, for backwards compatibility and for all themes that would not include
  13. images or css-files. If :config:option:`$cfg['ThemeManager']` is enabled, you
  14. can select your favorite theme on the main page. Your selected theme will be
  15. stored in a cookie.
  16. Creating custom theme
  17. ---------------------
  18. To create a theme:
  19. * make a new subdirectory (for example "your\_theme\_name") under :file:`./themes/`.
  20. * copy the files and directories from ``pmahomme`` to "your\_theme\_name"
  21. * edit the css-files in "your\_theme\_name/css"
  22. * put your new images in "your\_theme\_name/img"
  23. * edit :file:`layout.inc.php` in "your\_theme\_name"
  24. * edit :file:`theme.json` in "your\_theme\_name" to contain theme metadata (see below)
  25. * make a new screenshot of your theme and save it under
  26. "your\_theme\_name/screen.png"
  27. Theme metadata
  28. ++++++++++++++
  29. .. versionchanged:: 4.8.0
  30. Before 4.8.0 the theme metadata was passed in the :file:`info.inc.php` file.
  31. It has been replaced by :file:`theme.json` to allow easier parsing (without
  32. need to handle PHP code) and to support additional features.
  33. In theme directory there is file :file:`theme.json` which contains theme
  34. metadata. Currently it consists of:
  35. .. describe:: name
  36. Display name of the theme.
  37. **This field is required.**
  38. .. describe:: version
  39. Theme version, can be quite arbirary and does not have to match phpMyAdmin version.
  40. **This field is required.**
  41. .. describe:: desciption
  42. Theme description. this will be shown on the website.
  43. **This field is required.**
  44. .. describe:: author
  45. Theme author name.
  46. **This field is required.**
  47. .. describe:: url
  48. Link to theme author website. It's good idea to have way for getting
  49. support there.
  50. .. describe:: supports
  51. Array of supported phpMyAdmin major versions.
  52. **This field is required.**
  53. For example, the definition for Original theme shipped with phpMyAdnin 4.8:
  54. .. code-block:: json
  55. {
  56. "name": "Original",
  57. "version": "4.8",
  58. "description": "Original phpMyAdmin theme",
  59. "author": "phpMyAdmin developers",
  60. "url": "https://www.phpmyadmin.net/",
  61. "supports": ["4.8"]
  62. }
  63. Sharing images
  64. ++++++++++++++
  65. If you do not want to use your own symbols and buttons, remove the
  66. directory "img" in "your\_theme\_name". phpMyAdmin will use the
  67. default icons and buttons (from the system-theme ``pmahomme``).