2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * This file generates the CSS code for the sprites of a theme
6 * @package PhpMyAdmin-theme
9 // unplanned execution path
10 if (!defined('PMA_MINIMUM_COMMON')) {
14 $bg = $_SESSION['PMA_Theme']->getImgPath() . 'sprites.png';
17 .icon
, .footnotemarker
{
19 padding
: 0 !important
;
22 background
-image
: url('<?php echo $bg; ?>') !important
;
23 background
-repeat
: no
-repeat
!important
;
24 background
-position
: top left
!important
;
28 /* Check if there is a valid data file for sprites */
29 if (is_readable($_SESSION['PMA_Theme']->getPath() . '/sprites.lib.php')) {
30 include_once $_SESSION['PMA_Theme']->getPath() . '/sprites.lib.php';
32 if (function_exists('PMA_sprites')) {
33 $sprites = PMA_sprites();
35 $template = ".ic_%s { background-position: 0 -%upx !important;%s%s }\n";
36 foreach ($sprites as $name => $data) {
37 // generate the CSS code for each icon
40 // if either the height or width of an icon is 16px,
41 // then it's pointless to set this as a parameter,
42 //since it will be inherited from the "icon" class
43 if ($data['width'] != 16) {
44 $width = " width: " . $data['width'] . "px;";
46 if ($data['height'] != 16) {
47 $height = " height: " . $data['height'] . "px;";
52 ($data['position'] * 16),
57 // Here we map some of the classes that we
58 // defined above to other CSS selectors.
59 // The indexes of the array correspond to
60 // already defined classes and the values
61 // are the selectors that we want to map to.
63 's_sortable' => 'img.sortableIcon',
64 's_asc' => 'th.headerSortUp img.sortableIcon',
65 's_desc' => 'th.headerSortDown img.sortableIcon'
67 $template = "%s { background-position: 0 -%upx; "
68 . "height: %upx; width: %upx; }\n";
69 foreach ($elements as $key => $value) {
70 if (isset($sprites[$key])) { // If the CSS class has been defined
74 ($sprites[$key]['position'] * 16),
75 $sprites[$key]['height'],
76 $sprites[$key]['width']