Vlastní motivy

phpMyAdmin comes with support for third party themes. You can download additional themes from our website at <https://www.phpmyadmin.net/themes/>.

Nastavení

Themes are configured with $cfg['ThemeManager'] and $cfg['ThemeDefault']. Under ./public/themes/, you should not delete the directory pmahomme or its underlying structure, because this is the system theme used by phpMyAdmin. pmahomme contains all images and styles, for backwards compatibility and for all themes that would not include images or css-files. If $cfg['ThemeManager'] is enabled, you can select your favorite theme on the main page. Your selected theme will be stored in a cookie.

Creating custom theme

Pro vytvoření vzhledu:

  • make a new subdirectory (for example „your_theme_name“) under ./public/themes/.
  • copy the files and directories from pmahomme to „your_theme_name“
  • edit the css-files in „your_theme_name/css“
  • put your new images in „your_theme_name/img“
  • edit _variables.scss in „your_theme_name/scss“
  • edit theme.json in „your_theme_name“ to contain theme metadata (see below)
  • make a new screenshot of your theme and save it under „your_theme_name/screen.png“

Metadata motivu

Změněno ve verzi 4.8.0: Before 4.8.0 the theme metadata was passed in the info.inc.php file. It has been replaced by theme.json to allow easier parsing (without need to handle PHP code) and to support additional features.

In theme directory there is file theme.json which contains theme metadata. Currently it consists of:

name

Display name of the theme.

Toto pole je povinné.

version

Theme version, can be quite arbitrary and does not have to match phpMyAdmin version.

Toto pole je povinné.

description

Theme description. this will be shown on the website.

Toto pole je povinné.

author

Theme author name.

Toto pole je povinné.

url

Link to theme author website. It’s good idea to have way for getting support there.

supports

Array of supported phpMyAdmin major versions.

Toto pole je povinné.

For example, the definition for Original theme shipped with phpMyAdmin 4.8:

{
    "name": "Original",
    "version": "4.8",
    "description": "Original phpMyAdmin theme",
    "author": "phpMyAdmin developers",
    "url": "https://www.phpmyadmin.net/",
    "supports": ["4.8"]
}

Sdílení obrázků

If you do not want to use your own symbols and buttons, remove the directory „img“ in „your_theme_name“. phpMyAdmin will use the default icons and buttons (from the system-theme pmahomme).