Customizing phpMyAdmin
From ThemesWiki
| Official Page |
| Project Documentation |
| Download |
|
Contents |
[edit] General customization
This section describes settings that have an impact on many panels. These settings modify the appearance of titles in windows, of information icons, and how the list of tables is sorted. The whole visual style of all pages is controlled by the theme system, which is covered here altogether.
[edit] Window titles configuration
W hen the left and right panels are displayed, the window's title changes to reflect which MySQL server, database, and table are active. phpMyAdmin also shows some information about the web server's host name if $cfg['ShowHttpHostTitle']is set to TRUE. What is displayed depends on another setting $cfg['SetHttpHostTitle']. If this setting is empty (as it is by default), the true web server's host name appears in the title. We can put another string, such as "my Web server", and this will be shown instead of the true host name.life experience associate degree
Seeing the web server's host name can come in handy when we have many phpMyAdmin windows open, thus being connected to more than one web server. Of course, each phpMyAdmin window can itself give access to many MySQL servers.
[edit] Icon configuration
When various warning, error, or information messages are displayed, they can be accompanied by an icon, if $cfg['ErrorIconic'] is set to TRUE. Another parameter, $cfg['ReplaceHelpImg'], when set to TRUE, displays a small icon containing a question mark at every place where documentation is available for a specific subject. These two parameters are set to TRUE by default, thus producing:
They can be independently set to FALSE. Setting both to FALSE would give:
[edit] Natural sort order for database and table names
Usu ally, computers sort items in lexical order, which gives the following results for a list of tables:
table1
table10
table2
table3
phpMyAdmin implements "natural sort order" by default, as specified by $cfg['NaturalOrder'] being TRUE. Th us the database and table lists in left and right panels are sorted as:
table1
table2
table3
table10
[edit] Site-specific header and footer
Some users may want to display a company logo, a link to the helpdesk, or other information on the phpMyAdmin interface. In the main phpMyAdmin directory, for this purpose, we can create two scripts config.header.inc.php and config. footer.inc.php. We can put our own PHP or XHTML code in these scripts, and it will appear either at the beginning (for header) or end of page (for footer) in case of the following:
- On the cookie login page
- On the right panel
For example, creating a config.footer.inc.php containing these lines:
<hr /> <em>All the information on this page is confidential.</em>
would produce the intended message on all pages:
[edit] MySQL documentation links
phpMyAdmin displays links to the MySQL documentation at various places on its interface. These links refer to the exact point in the official MySQL documentation to learn about a MySQL command. We can customize the location, language, and manual type referred to, with the following confi guration parameters:
$cfg[ 'MySQLManualBase'] = 'http://www.mysql.com/doc/en'; $cfg['MySQLManualType'] = 'searchable';
You may take a look at http://www.mysql.com/documentation to see the languages in which the manual is available, and change the parameters accordingly. For the manual type, the most up-to-date possible values are explained as comments in config.inc.php. Users who prefer to keep a copy of this documentation on a local server would specify a local link here.online degree program
The $cfg['ReplaceHelpImg'] param eter controls how the links are displayed. Its default value of TRUE makes phpMyAdmin display small question-mark icons. However, if it has FALSEvalue, we are shown the Documentation link.
[edit] Themes
A theme system is available in phpMyAdmin starting with version 2.6.0. The color parameters and the various icons are located in a directory structure under the themes subdirectory. For each available theme, there is a subdirectory named after the theme. It contains:
- layout.inc.php for the theme parameters
- css directory with the various CSS scripts
- img directory containing the icons
- screen.png, a screenshot of this theme
The downloaded kit contains two themes, and more themes are available at http://phpmyadmin.net/home_page/themes.php.
[edit] Theme configuration
In config.inc.php, the $cfg['ThemePath'] para meter contains 'themes'by default, indicating which subdirectory the required structure is located in. This could be changed to point to another directory where our company's specific phpMyAdmin themes are located.
The default chosen theme is specifi ed in $cfg['ThemeDefault']<code>, and is set to 'original'. If no theme selection is available for users, this theme will be used.
| The originalsubdirectory should never be deleted; phpMyAdmin relies on it for normal operations. |
[edit] Theme selection
On the Homepage, we can offer a theme selector to users. Setting $cfg['ThemeManager'] to T RUE (the default) shows the selector: To help choose a suitable theme, the color palette icon next to Theme/Style brings us screenshots of the available themes. We can then click on take it under the theme we want. The chosen theme is remembered in a cookie. By default, the remembered theme applies to all servers we connect to. To make phpMyAdmin remember one theme per MySQL server, we set $cfg[ThemePerServer] to TRUE.
[edit] The color picker
Here is a feature the custom color picker that may seem frivolous but has its utility. We'll discuss fi rst the how and then the why.
Located on the homepage, the small rainbow icon gives access to a picker, which controls the background color of both panels. The phpMyAdmin team merged the MooRainbow code from Djamil Legato (http://moorainbow.woolly-sheep.net) to offer this feature.
You can operate the picker in many ways moving the slider, moving the mouse in the big square, or directly entering values in the fields. When you are done, you click Select to clear the picker.
The purpose of this feature is to help users who are working simultaneously on many MySQL servers, and like to have visual clues about each server. Another possible scenario a busy database administrator who takes calls from customers and opens many phpMyAdmin windows. He then assigns priorities using the color picker, say red for top priority you get the idea.
[edit] Sliders
You'll see on some pages, a small plus sign followed by a controlling label either Options or Details. A click on the label opens a slider to reveal a section of the interface, which is believed to be less often used in day-to-day work. As some persons prefer to immediately see the whole interface at the expense of screen space there is a configuration parameter that controls how the sliders are initially set Website design:
$cfg['InitialSlidersState'] = 'closed';
The default value of closed means that sliders must be opened by a click on the label; you might have guessed that the reverse value is open. This Javascript feature comes from the Mootools library located at http://m
[edit] Additional References
For instructions on Installing PhpMyAdmin, click here
[edit] Source
The source of this content is Chapter 3: Customizing phpMyAdmin of Mastering phpMyAdmin 3.1 for Effective MySQL Management by Marc Delisle(Packt Publishing, 2009).
