[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_5-20526-g3db0cb1
Rouslan Placella
roccivic at users.sourceforge.net
Fri Sep 30 20:53:53 CEST 2011
The branch, master has been updated
via 3db0cb1a18466e9daa766b5f1dfa4a1f23abe57d (commit)
via ef2e103adb48b20dce0422de02b7dd2aa0fae22e (commit)
via b8d454f851b4b594e2ae7488ff36a8e0f5263c80 (commit)
via 2b5a70cd4881ecd3e36c0c9bd3662338465d4223 (commit)
via 2a24125ecc3778dde653a62748ae42fca3f28ac9 (commit)
via 5d5f4ac9086f600c859c35adf7f837088031eca5 (commit)
via ec54aacbd13ceff4d00aaebc5681fab6c1c7f614 (commit)
via 19e69ed770a8e77ae7670376cf78de7bee9d0a31 (commit)
via d17814f463678cec54e6d9f469eb8f273668264e (commit)
via b1c60c7d19d88c16b6ea591b2219a0793c2d961f (commit)
via 1431d02c8f2b3b45f2b4640bb1ef887ae2e47a0f (commit)
from 20f6ee84d699e000367a9a0c7f975eb4373f708b (commit)
- Log -----------------------------------------------------------------
commit 3db0cb1a18466e9daa766b5f1dfa4a1f23abe57d
Author: Rouslan Placella <rouslan at placella.com>
Date: Fri Sep 30 19:52:25 2011 +0100
Deleted old sprites
commit ef2e103adb48b20dce0422de02b7dd2aa0fae22e
Merge: 20f6ee8 b8d454f
Author: Rouslan Placella <rouslan at placella.com>
Date: Fri Sep 30 19:51:05 2011 +0100
Merge branch 'sprites'
commit b8d454f851b4b594e2ae7488ff36a8e0f5263c80
Author: Rouslan Placella <rouslan at placella.com>
Date: Fri Sep 30 16:44:06 2011 +0100
Fixed unit tests
commit 2b5a70cd4881ecd3e36c0c9bd3662338465d4223
Author: Rouslan Placella <rouslan at placella.com>
Date: Tue Sep 27 16:32:51 2011 +0100
More readable generation of CSS code for sprites
commit 2a24125ecc3778dde653a62748ae42fca3f28ac9
Author: Rouslan Placella <rouslan at placella.com>
Date: Tue Sep 27 16:29:18 2011 +0100
Prevent the CSS background attribute from being overridden for the 'icon' class
commit 5d5f4ac9086f600c859c35adf7f837088031eca5
Author: Rouslan Placella <rouslan at placella.com>
Date: Tue Sep 27 16:11:02 2011 +0100
JS syntax error
commit ec54aacbd13ceff4d00aaebc5681fab6c1c7f614
Author: Rouslan Placella <rouslan at placella.com>
Date: Mon Sep 26 21:19:09 2011 +0100
Fix some closure-compiler errors
commit 19e69ed770a8e77ae7670376cf78de7bee9d0a31
Author: Rouslan Placella <rouslan at placella.com>
Date: Mon Sep 26 21:10:11 2011 +0100
Changed the way the attributes are fetched from the object returned by PMA_getImage() in JS
Stops the 'closure-compiler' from erroring out
commit d17814f463678cec54e6d9f469eb8f273668264e
Author: Rouslan Placella <rouslan at placella.com>
Date: Mon Sep 26 20:54:59 2011 +0100
Replaced use of hard coded images with the sprite-aware PMA_getImage() functions (both PHP and JS).
commit b1c60c7d19d88c16b6ea591b2219a0793c2d961f
Author: Rouslan Placella <rouslan at placella.com>
Date: Mon Sep 26 20:47:22 2011 +0100
Regenerated the sprites
commit 1431d02c8f2b3b45f2b4640bb1ef887ae2e47a0f
Author: Rouslan Placella <rouslan at placella.com>
Date: Mon Sep 26 20:46:28 2011 +0100
Made PMA aware of the presence of sprites + added a script for generating sprites from icons
-----------------------------------------------------------------------
Summary of changes:
db_operations.php | 10 +-
db_structure.php | 14 +-
db_tracking.php | 2 +-
js/db_search.js | 2 +-
js/db_structure.js | 2 +-
js/functions.js | 2 +-
js/get_image.js.php | 130 +++++++++++++++++
js/navigation.js | 8 +-
js/pmd/history.js | 6 +-
js/server_status.js | 2 +-
js/server_status_monitor.js | 22 ++--
js/server_synchronize.js | 4 +-
js/server_variables.js | 8 +-
js/tbl_select.js | 2 +-
libraries/Theme.class.php | 12 ++
libraries/auth/cookie.auth.lib.php | 6 +-
libraries/common.lib.php | 114 +++++++++++----
libraries/config/FormDisplay.tpl.php | 12 +-
libraries/db_links.inc.php | 26 ++--
libraries/db_structure.lib.php | 14 +-
libraries/display_create_database.lib.php | 2 +-
libraries/display_create_table.lib.php | 2 +-
libraries/display_export.lib.php | 2 +-
libraries/display_import.lib.php | 2 +-
libraries/display_tbl.lib.php | 14 +-
libraries/footer.inc.php | 3 +-
libraries/header.inc.php | 26 ++--
libraries/header_scripts.inc.php | 2 +
libraries/navigation_header.inc.php | 14 +--
libraries/schema/User_Schema.class.php | 2 +-
libraries/server_links.inc.php | 28 ++--
libraries/sql_query_form.lib.php | 3 +-
libraries/tbl_links.inc.php | 22 ++--
libraries/user_preferences.inc.php | 12 +-
navigation.php | 20 ++--
querywindow.php | 6 +-
scripts/create-release.sh | 5 +
scripts/generate-sprites | 140 ++++++++++++++++++
server_binlog.php | 2 +-
server_collations.php | 2 +-
server_databases.php | 6 +-
server_engines.php | 6 +-
server_replication.php | 2 +-
server_status.php | 22 ++--
server_synchronize.php | 2 +-
server_variables.php | 2 +-
tbl_create.php | 6 +-
tbl_structure.php | 4 +-
tbl_tracking.php | 2 +-
.../common/PMA_buildActionTitles_test.php | 2 +
test/libraries/common/PMA_getIcon_test.php | 5 +
test/libraries/common/PMA_showDocu_test.php | 14 ++-
test/libraries/common/PMA_showPHPDocu_test.php | 12 ++-
themes/original/css/theme_left.css.php | 31 +----
themes/original/css/theme_right.css.php | 140 ------------------
themes/original/img/iconsprites.png | Bin 16363 -> 0 bytes
themes/original/img/more.png | Bin 119 -> 117 bytes
themes/original/img/sprites.png | Bin 0 -> 23875 bytes
themes/original/sprites.lib.php | 126 ++++++++++++++++
themes/pmahomme/css/theme_left.css.php | 26 ----
themes/pmahomme/css/theme_right.css.php | 152 +-------------------
themes/pmahomme/img/iconsprites.png | Bin 35190 -> 0 bytes
themes/pmahomme/img/more.png | Bin 119 -> 117 bytes
themes/pmahomme/img/sprites.png | Bin 0 -> 57711 bytes
themes/pmahomme/sprites.lib.php | 147 +++++++++++++++++++
themes/sprites.css.php | 81 +++++++++++
66 files changed, 939 insertions(+), 556 deletions(-)
create mode 100644 js/get_image.js.php
create mode 100755 scripts/generate-sprites
delete mode 100644 themes/original/img/iconsprites.png
create mode 100644 themes/original/img/sprites.png
create mode 100644 themes/original/sprites.lib.php
delete mode 100644 themes/pmahomme/img/iconsprites.png
create mode 100644 themes/pmahomme/img/sprites.png
create mode 100644 themes/pmahomme/sprites.lib.php
create mode 100644 themes/sprites.css.php
diff --git a/db_operations.php b/db_operations.php
index 0bfedb0..fa0f108 100644
--- a/db_operations.php
+++ b/db_operations.php
@@ -401,7 +401,7 @@ if ($db != 'mysql') {
<legend>
<?php
if ($cfg['PropertiesIconic']) {
- echo '<img class="icon ic_b_edit" src="themes/dot.gif" alt="" />';
+ echo PMA_getImage('b_edit.png');
}
echo __('Rename database to') . ':';
?>
@@ -427,7 +427,7 @@ if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase'])
<fieldset class="caution">
<legend><?php
if ($cfg['PropertiesIconic']) {
- echo '<img class="icon ic_b_deltbl" src="themes/dot.gif" alt="" />';
+ echo PMA_getImage('b_deltbl.png');
}
echo __('Remove database');
?></legend>
@@ -473,7 +473,7 @@ echo __('Remove database');
<legend>
<?php
if ($cfg['PropertiesIconic']) {
- echo '<img class="icon ic_b_edit" src="themes/dot.gif" alt="" />';
+ echo PMA_getImage('b_edit.png');
}
echo __('Copy database to') . ':';
$drop_clause = 'DROP TABLE / DROP VIEW';
@@ -537,7 +537,7 @@ echo __('Remove database');
. '<fieldset>' . "\n"
. ' <legend>';
if ($cfg['PropertiesIconic']) {
- echo '<img class="icon ic_s_asci" src="themes/dot.gif" alt="" />';
+ echo PMA_getImage('s_asci.png');
}
echo ' <label for="select_db_collation">' . __('Collation') . ':</label>' . "\n"
. ' </legend>' . "\n"
@@ -584,7 +584,7 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
*/
echo '<div class="operations_full_width"><fieldset><a href="schema_edit.php?' . $url_query . '">';
if ($cfg['PropertiesIconic']) {
- echo '<img class="icon ic_b_edit" src="themes/dot.gif" alt="" />';
+ echo PMA_getImage('b_edit.png');
}
echo __('Edit or export relational schema') . '</a></fieldset></div>';
} // end if
diff --git a/db_structure.php b/db_structure.php
index 3926eae..faa5e02 100644
--- a/db_structure.php
+++ b/db_structure.php
@@ -307,12 +307,14 @@ foreach ($tables as $keyname => $each_table) {
if (PMA_Tracker::isActive()) {
if (PMA_Tracker::isTracked($GLOBALS["db"], $truename)) {
$tracking_icon = '<a href="tbl_tracking.php?' . $url_query
- . '&table=' . $truename . '"><img class="icon ic_eye" src="themes/dot.gif" alt="'
- . __('Tracking is active.') . '" title="' . __('Tracking is active.') . '" /></a>';
+ . '&table=' . $truename . '">'
+ . PMA_getImage('eye.png', __('Tracking is active.'))
+ . '</a>';
} elseif (PMA_Tracker::getVersion($GLOBALS["db"], $truename) > 0) {
$tracking_icon = '<a href="tbl_tracking.php?' . $url_query
- . '&table=' . $truename . '"><img class="icon ic_eye" src="themes/dot.gif" alt="'
- . __('Tracking is not active.') . '" title="' . __('Tracking is not active.') . '" /></a>';
+ . '&table=' . $truename . '">'
+ . PMA_getImage('eye.png', __('Tracking is not active.'))
+ . '</a>';
}
}
@@ -377,10 +379,10 @@ foreach ($tables as $keyname => $each_table) {
</th>
<?php if ($server_slave_status) { ?><td align="center"><?php
echo $ignored
- ? ' <img class="icon ic_s_cancel" src="themes/dot.gif" alt ) ng is not active.') . '" /></a>'; rWcd+ @Ñ{Oÿ °Ñ{Oÿ uWcd+ :Xcd+ 5xcd+ (tdd+ °Ñ{Oÿ @dd+ Æ{Oÿ pÅ{Oÿ k0Wcd+ 6 è è! è! @Ñ{Oÿ °Ñ{Oÿ xäsdd+ Ç{Oÿ Wcd+ 0Wcd+ @Ñ{Oÿ `Wcd+ Ñ{Oÿ Àß×dd+ uWcd+ Ð×dd+ ØÔ×dd+ ¨Ù×dd+ :Xcd+ xäsdd+ Ç{Oÿ pÆ{Oÿ k0Wcd+ à! à! @Ñ{Oÿ °Ñ{Oÿ H®Sdd+ È{Oÿ Wcd+ 0Wcd+ @Ñ{Oÿ `Wcd+ Ñ{Oÿ pÑ{Oÿ hÑ{Oÿ 8;xcd+ p °Ñ{Oÿ uWcd+ :Xcd+ È{Oÿ PÇ{Oÿ k0Wcd+ G H I J K M N O P @Ñ{Oÿ °Ñ{Oÿ He*dd+ Ê{Oÿ Wcd+ 0Wcd+ @Ñ{Oÿ 0ß×dd+ uWcd+ ðsdd+ dd+ Ð×dd+ ØÔ×dd+ ¨Ù×dd+ :Xcd+ He*dd+ Ê{Oÿ `È{Oÿ k0Wcd+ 8e*dd+ Ê{Oÿ È{Oÿ k0Wcd+ (e*dd+ Ê{Oÿ ÀÈ{Oÿ k0Wcd+ e*dd+ Ê{Oÿ ðÈ{Oÿ k0Wcd+ ¨Þ×dd+ uWcd+ ¨Ù×dd+ pÃ{Oÿ èdd+ eWcd+ ØÔ×dd+ É{Oÿ yèdd+ eWcd+ Ð×dd+ ÀÉ{Oÿ Zèdd+ eWcd+ Ødd+ ðsdd+ dd+ Ð×dd+ Øôsdd+ ØÔ×dd+ ¨Ù×dd+ :Xcd+ 8;xcd+ ]Ócd+ °Ñ{Oÿ p+dd+ pË{Oÿ @Ê{Oÿ k0Wcd+ 5 6 7 8 : < = > ? @ B D @Ñ{Oÿ °Ñ{Oÿ à]Ðcd+ °Ñ{Oÿ uWcd+ 5xcd+ ðÉ{Oÿ ]Ócd+ eWcd+ 5xcd+ Õ_ at fÆS Qöl±íÁscd+ °Ñ{Oÿ à]Ðcd+ Ì{Oÿ PË{Oÿ k0Wcd+ u]ÞÓ 4Q ÷U^Qʧ ¶uª¹ñìò*Äv@Ñ{Oÿ °Ñ{Oÿ H®cd+ ôØcd+ ðÒ{Oÿ ¦ ;ed+ ¦ ;ed+ FÖcd+ Ñ{Oÿ °Ò{Oÿ hÑ{Oÿ ÐÍ{Oÿ ÿsdd+ uWcd+ Øôsdd+ 0Ô{Oÿ ¢ ;ed+ Ó{Oÿ Î{Oÿ ÿÿÿÿÿÿÿÿ¢ ;ed+ ¸Ñ{Oÿ ="NOT REPLICATED" />'
+ ? PMA_getImage('s_cancel.png', 'NOT REPLICATED')
: ''.
$do
- ? ' <img class="icon ic_s_success" src="themes/dot.gif" alt="REPLICATED" />'
+ ? PMA_getImage('s_success.png', 'REPLICATED')
: ''; ?></td><?php } ?>
<td align="center"><?php echo $browse_table; ?></td>
<td align="center">
diff --git a/db_tracking.php b/db_tracking.php
index c876204..2f5645a 100644
--- a/db_tracking.php
+++ b/db_tracking.php
@@ -98,7 +98,7 @@ if (PMA_DBI_num_rows($all_tables_result) > 0) {
$drop_image_or_text = '';
if (true == $GLOBALS['cfg']['PropertiesIconic']) {
- $drop_image_or_text .= '<img class="icon ic_b_drop" src="themes/dot.gif" alt="' . __('Delete tracking data for this table') . '" title="' . __('Delete tracking data for this table') . '" />';
+ $drop_image_or_text .= PMA_getImage('b_drop.png', __('Delete tracking data for this table'));
}
if ('both' === $GLOBALS['cfg']['PropertiesIconic'] || false === $GLOBALS['cfg']['PropertiesIconic']) {
$drop_image_or_text .= __('Drop');
diff --git a/js/db_search.js b/js/db_search.js
index aef5047..79efddb 100644
--- a/js/db_search.js
+++ b/js/db_search.js
@@ -88,7 +88,7 @@ $(document).ready(function() {
});
/** Hide the table link in the initial search result */
- $("#table-info").prepend('<img id="table-image" class="icon ic_s_tbl" src="./themes/dot.gif" />').hide();
+ $("#table-info").prepend(PMA_getImage('s_tbl.png', '', {'id': 'table-image'}).toString()).hide();
/** Hide the browse and deleted results in the new search criteria */
$('#buttonGo').click(function(){
diff --git a/js/db_structure.js b/js/db_structure.js
index c3b280a..a6229c7 100644
--- a/js/db_structure.js
+++ b/js/db_structure.js
@@ -219,7 +219,7 @@ $(document).ready(function() {
PMA_ajaxShowMessage(data.message);
//Fetch inner span of this anchor
//and replace the icon with its disabled version
- var span = $this_anchor.html().replace(/ic_b_empty/, 'ic_bd_empty');
+ var span = $this_anchor.html().replace(/b_empty/, 'bd_empty');
PMA_adjustTotals($this_anchor);
//To disable further attempts to truncate the table,
diff --git a/js/functions.js b/js/functions.js
index f67b6a9..b8db515 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -2843,7 +2843,7 @@ $(function() {
});
var img = topmenu.find('li:first-child img');
if (img.length) {
- img.clone().attr('class', 'icon ic_b_more').prependTo(link);
+ $(PMA_getImage('b_more.png').toString()).prependTo(link);
}
var submenu = $('<li />', {'class': 'submenu'})
.append(link)
diff --git a/js/get_image.js.php b/js/get_image.js.php
new file mode 100644
index 0000000..07ccc5e
--- /dev/null
+++ b/js/get_image.js.php
@@ -0,0 +1,130 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Provides the functionality for retreiving images
+ * which may be actual images or an icon from a sprite
+ *
+ * @package phpMyAdmin
+ */
+chdir('..');
+
+// Send correct type:
+header('Content-Type: text/javascript; charset=UTF-8');
+header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
+
+// Avoid loading the full common.inc.php because this would add many
+// non-js-compatible stuff like DOCTYPE
+define('PMA_MINIMUM_COMMON', true);
+require_once './libraries/common.inc.php';
+
+// Get the data for the sprites, if it's available
+if (is_readable($_SESSION['PMA_Theme']->getPath() . '/sprites.lib.php')) {
+ include $_SESSION['PMA_Theme']->getPath() . '/sprites.lib.php';
+}
+$sprites = array();
+if (function_exists('PMA_sprites')) {
+ $sprites = PMA_sprites();
+}
+// We only need the keys from the array of sprites data,
+// since they contain the (partial) class names
+$keys = array();
+foreach ($sprites as $key => $value) {
+ $keys[] = "'$key'";
+}
+
+?>
+/**
+ * Returns an HTML IMG tag for a particular image from a theme,
+ * which may be an actual file or an icon from a sprite
+ *
+ * @param string image The name of the file to get
+ * @param string alternate Used to set 'alt' and 'title' attributes of the image
+ * @param object attributes An associative array of other attributes
+ *
+ * @return Object The requested image, this object has two methods:
+ * .toString() - Returns the IMG tag for the requested image
+ * .attr(name) - Returns a particular attribute of the IMG
+ * tag given it's name
+ * And one property:
+ * .isSprite - Whether the image is a sprite or not
+ */
+function PMA_getImage(image, alternate, attributes) {
+ var in_array = function (needle, haystack) {
+ for (i in haystack) {
+ if (haystack[i] == needle) {
+ return true;
+ }
+ }
+ return false;
+ };
+ var sprites = [
+ <?php echo implode($keys, ",\n ") . "\n"; ?>
+ ];
+ // custom image object, it will eventually be returned by this functions
+ var retval = {
+ data: {
+ // this is private
+ alt: '',
+ title: '',
+ src: 'themes/dot.gif',
+ },
+ isSprite: true,
+ attr: function (name) {
+ if (this.data[name] == undefined) {
+ return '';
+ } else {
+ return this.data[name];
+ }
+ },
+ toString: function () {
+ var retval = '<' + 'img';
+ for (var i in this.data) {
+ retval += ' ' + i + '="' + this.data[i] + '"';
+ }
+ retval += ' /' + '>';
+ return retval;
+ }
+ };
+ // initialise missing parameters
+ if (attributes == undefined) {
+ attributes = {};
+ }
+ if (alternate == undefined) {
+ alternate = '';
+ }
+ // set alt
+ if (attributes.alt != undefined) {
+ retval.data.alt = attributes.alt;
+ } else {
+ retval.data.alt = alternate;
+ }
+ // set title
+ if (attributes.title != undefined) {
+ retval.data.title = attributes.title;
+ } else {
+ retval.data.title = alternate;
+ }
+ // set src
+ var klass = image.replace('.gif', '').replace('.png', '');
+ if (in_array(klass, sprites)) {
+ // it's an icon from a sprite
+ retval.data.class = 'icon ic_' + klass;
+ } else {
+ // it's an image file
+ retval.isSprite = false;
+ retval.data.src = "<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>" + image;
+ }
+ // set all other attrubutes
+ for (var i in attributes) {
+ if (i == 'src') {
+ // do not allow to override the 'src' attribute
+ continue;
+ } else if (i == 'class') {
+ retval.data[i] += ' ' + attributes[i];
+ } else {
+ retval.data[i] = attributes[i];
+ }
+ }
+
+ return retval;
+};
diff --git a/js/navigation.js b/js/navigation.js
index e4d7a20..724d9f9 100644
--- a/js/navigation.js
+++ b/js/navigation.js
@@ -29,13 +29,17 @@ function toggle(id, only_open)
if (el.style.display == 'none' || only_open) {
el.style.display = '';
if (img) {
- img.className = 'icon ic_b_minus';
+ var newimg = PMA_getImage('b_minus.png');
+ img.className = newimg.attr('class');
+ img.src = newimg.attr('src');
img.alt = '-';
}
} else {
el.style.display = 'none';
if (img) {
- img.className = 'icon ic_b_plus';
+ var newimg = PMA_getImage('b_plus.png');
+ img.className = newimg.attr('class');
+ img.src = newimg.attr('src');
img.alt = '+';
}
}
diff --git a/js/pmd/history.js b/js/pmd/history.js
index fdc76c8..edace46 100644
--- a/js/pmd/history.js
+++ b/js/pmd/history.js
@@ -73,12 +73,12 @@ function display(init,finit)
else {
str +='<img src="' + pmaThemeImage + 'pmd/and_icon.png" onclick="and_or('+i+')" title="AND"/></td>';
}
- str +='<td style="padding-left: 5px;" align="right"><img class="icon ic_b_sbrowse" src="themes/dot.gif" title="column name"/></td><td width="175" style="padding-left: 5px">' + history_array[i].get_column_name();
+ str +='<td style="padding-left: 5px;" align="right">' + PMA_getImage('b_sbrowse.png', 'column name') + '</td><td width="175" style="padding-left: 5px">' + history_array[i].get_column_name();
if (history_array[i].get_type() == "GroupBy" || history_array[i].get_type() == "OrderBy") {
- str += '</td><td align="center"><img class="icon ic_b_info" src="themes/dot.gif" title="'+detail(i)+'"/><td title="' + detail(i) +'">' + history_array[i].get_type() + '</td></td><td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_delete('+ i +')><img class="icon ic_b_drop" src="themes/dot.gif" title="Delete"></td></tr></thead>';
+ str += '</td><td align="center">' + PMA_getImage('b_info.png', detail(i)) + '<td title="' + detail(i) +'">' + history_array[i].get_type() + '</td></td><td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_delete('+ i +')>' + PMA_getImage('b_drop.png', 'Delete') + '</td></tr></thead>';
}
else {
- str += '</td><td align="center"><img class="icon ic_b_info" src="themes/dot.gif" title="'+detail(i)+'"/></td><td title="' + detail(i) +'">' + history_array[i]. get_type() + '</td><td <td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_edit('+ i +')><img class="icon ic_b_edit" src="themes/dot.gif" title="Edit"/></td><td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_delete('+ i +')><img src="themes/original/img/b_drop.png" title="Delete"></td></tr></thead>';
+ str += '</td><td align="center">' + PMA_getImage('b_info.png', detail(i)) + '</td><td title="' + detail(i) +'">' + history_array[i]. get_type() + '</td><td <td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_edit('+ i +')>' + PMA_getImage('b_edit.png', PMA_messages['strEdit']) + '</td><td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_delete('+ i +')><img src="themes/original/img/b_drop.png" title="Delete"></td></tr></thead>';
}
i++;
if(i >= history_array.length) {
diff --git a/js/server_status.js b/js/server_status.js
index 594e8d9..86da8ea 100644
--- a/js/server_status.js
+++ b/js/server_status.js
@@ -715,7 +715,7 @@ function serverResponseError() {
};
$('#emptyDialog').attr('title', PMA_messages['strRefreshFailed']);
$('#emptyDialog').html(
- '<img class="icon ic_s_attention" src="themes/dot.gif" alt=""> ' +
+ PMA_getImage('s_attention.png') +
PMA_messages['strInvalidResponseExplanation']
);
$('#emptyDialog').dialog({ buttons: btns });
diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js
index 12a41d3..1f68f22 100644
--- a/js/server_status_monitor.js
+++ b/js/server_status_monitor.js
@@ -585,9 +585,9 @@ $(function() {
$('a[href="#pauseCharts"]').click(function() {
runtime.redrawCharts = ! runtime.redrawCharts;
if (! runtime.redrawCharts) {
- $(this).html('<img src="themes/dot.gif" class="icon ic_play" alt="" /> ' + PMA_messages['strResumeMonitor']);
+ $(this).html(PMA_getImage('play.png') + ' ' + PMA_messages['strResumeMonitor']);
} else {
- $(this).html('<img src="themes/dot.gif" class="icon ic_pause" alt="" /> ' + PMA_messages['strPauseMonitor']);
+ $(this).html(PMA_getImage('pause.png') + ' ' + PMA_messages['strPauseMonitor']);
if (! runtime.charts) {
initGrid();
$('a[href="#settingsPopup"]').show();
@@ -613,7 +613,7 @@ $(function() {
$.get('server_status.php?' + url_query, vars,
function(data) {
var logVars = $.parseJSON(data),
- icon = 'ic_s_success', msg='', str='';
+ icon = PMA_getImage('s_success.png'), msg='', str='';
if (logVars['general_log'] == 'ON') {
if (logVars['slow_query_log'] == 'ON') {
@@ -628,28 +628,28 @@ $(function() {
}
if (msg.length == 0) {
- icon = 'ic_s_error';
+ icon = PMA_getImage('s_error.png');
msg = PMA_messages['strBothLogOff'];
}
str = '<b>' + PMA_messages['strCurrentSettings'] + '</b><br><div class="smallIndent">';
- str += '<img src="themes/dot.gif" class="icon ' + icon + '" alt=""/> ' + msg + '<br />';
+ str += icon + msg + '<br />';
if (logVars['log_output'] != 'TABLE') {
- str += '<img src="themes/dot.gif" class="icon ic_s_error" alt=""/> ' + PMA_messages['strLogOutNotTable'] + '<br />';
+ str += PMA_getImage('s_error.png') + ' ' + PMA_messages['strLogOutNotTable'] + '<br />';
} else {
- str += '<img src="themes/dot.gif" class="icon ic_s_success" alt=""/> ' + PMA_messages['strLogOutIsTable'] + '<br />';
+ str += PMA_getImage('s_success.png') + ' ' + PMA_messages['strLogOutIsTable'] + '<br />';
}
if (logVars['slow_query_log'] == 'ON') {
if (logVars['long_query_time'] > 2) {
- str += '<img src="themes/dot.gif" class="icon ic_s_attention" alt=""/> '
+ str += PMA_getImage('s_attention.png') + ' '
+ $.sprintf(PMA_messages['strSmallerLongQueryTimeAdvice'], logVars['long_query_time'])
+ '<br />';
}
if (logVars['long_query_time'] < 2) {
- str += '<img src="themes/dot.gif" class="icon ic_s_success" alt=""/> '
+ str += PMA_getImage('s_success.png') + ' '
+ $.sprintf(PMA_messages['strLongQueryTimeSet'], logVars['long_query_time'])
+ '<br />';
}
@@ -1660,7 +1660,7 @@ $(function() {
// Append a tooltip to the count column, if there exist one
if ($('#logTable th:last').html() == '#') {
- $('#logTable th:last').append(' <img class="qroupedQueryInfoIcon icon ic_b_docs" src="themes/dot.gif" alt="" />');
+ $('#logTable th:last').append(' ' + PMA_getImage('b_docs.png', '', {'class': 'qroupedQueryInfoIcon'}));
var qtipContent = PMA_messages['strCountColumnExplanation'];
if (groupInserts) {
@@ -1861,4 +1861,4 @@ $(function() {
// Run the monitor once loaded
$(function() {
$('a[href="#pauseCharts"]').trigger('click');
-});
\ No newline at end of file
+});
diff --git a/js/server_synchronize.js b/js/server_synchronize.js
index 8425423..a58253b 100644
--- a/js/server_synchronize.js
+++ b/js/server_synchronize.js
@@ -96,8 +96,8 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
insert_rows.align = "center";
var tick_image = document.createElement("img");
- tick_image.src = 'themes/dot.gif';
- tick_image.className = "icon ic_s_success";
+ tick_image.src = PMA_getImage('s_success.png').attr('src');
+ tick_image.className = PMA_getImage('s_success.png').attr('class');
if (update_size == '' && insert_size == '' && remove_size == '') {
/**
diff --git a/js/server_variables.js b/js/server_variables.js
index cb4f8c3..93bc348 100644
--- a/js/server_variables.js
+++ b/js/server_variables.js
@@ -4,9 +4,9 @@ $(function() {
var $tmpDiv, charWidth;
// Global vars
- editLink = '<a href="#" class="editLink" onclick="return editVariable(this);"><img class="icon ic_b_edit" src="themes/dot.gif" alt=""> '+PMA_messages['strEdit']+'</a>';
- saveLink = '<a href="#" class="saveLink"><img class="icon ic_b_save" src="themes/dot.gif" alt=""> '+PMA_messages['strSave']+'</a> ';
- cancelLink = '<a href="#" class="cancelLink"><img class="icon ic_b_close" src="themes/dot.gif" alt=""> '+PMA_messages['strCancel']+'</a> ';
+ editLink = '<a href="#" class="editLink" onclick="return editVariable(this);">' + PMA_getImage('b_edit.png') + ' ' + PMA_messages['strEdit'] + '</a>';
+ saveLink = '<a href="#" class="saveLink">' + PMA_getImage('b_save.png') + ' ' + PMA_messages['strSave'] + '</a> ';
+ cancelLink = '<a href="#" class="cancelLink">' + PMA_getImage('b_close.png') + ' ' + PMA_messages['strCancel'] + '</a> ';
$.ajaxSetup({
cache:false
@@ -190,4 +190,4 @@ function editVariable(link)
});
return false;
-}
\ No newline at end of file
+}
diff --git a/js/tbl_select.js b/js/tbl_select.js
index 1808b73..faffeef 100644
--- a/js/tbl_select.js
+++ b/js/tbl_select.js
@@ -120,7 +120,7 @@ $(document).ready(function() {
'ST_Intersects',
'ST_Overlaps',
'ST_Touches',
- 'ST_Within',
+ 'ST_Within'
];
var tempArray = [
diff --git a/libraries/Theme.class.php b/libraries/Theme.class.php
index 817e4c3..0dbeb5e 100644
--- a/libraries/Theme.class.php
+++ b/libraries/Theme.class.php
@@ -311,6 +311,18 @@ class PMA_Theme
}
include $_css_file;
+
+ if ($type != 'print') {
+ $_sprites_data_file = $this->getPath() . '/sprites.lib.php';
+ $_sprites_css_file = './themes/sprites.css.php';
+ if ( (file_exists($_sprites_data_file) && is_readable($_sprites_data_file))
+ && (file_exists($_sprites_css_file) && is_readable($_sprites_css_file))
+ ) {
+ include $_sprites_data_file;
+ include $_sprites_css_file;
+ }
+ }
+
return true;
}
diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php
index b196461..c50f2e3 100644
--- a/libraries/auth/cookie.auth.lib.php
+++ b/libraries/auth/cookie.auth.lib.php
@@ -132,8 +132,6 @@ function PMA_auth()
// Defines the charset to be used
header('Content-Type: text/html; charset=utf-8');
- // Defines the "item" image depending on text direction
- $item_img = 'ic_item_' . $GLOBALS['text_dir'];
/* HTML header; do not show here the PMA version to improve security */
$page_title = 'phpMyAdmin ';
@@ -198,9 +196,9 @@ if (top != self) {
<?php
echo __('Log in');
echo '<a href="./Documentation.html" target="documentation" ' .
- 'title="' . __('phpMyAdmin documentation') . '">';
+ 'title="' . __('phpMyAdmin documentation') . '"> ';
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
- echo '<img class="icon ic_b_help_s" src="themes/dot.gif" alt="' . __('phpMyAdmin documentation') . '" />';
+ echo PMA_getImage('b_help.png', __('phpMyAdmin documentation'));
} else {
echo '(*)';
}
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 2aabf6f..2cc2278 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -71,54 +71,107 @@ function PMA_pow($base, $exp, $use_function = false)
}
/**
- * string PMA_getIcon(string $icon)
+ * Returns an HTML IMG tag for a particular icon from a theme,
+ * which may be an actual file or an icon from a sprite.
+ * This function takes into account the PropertiesIconic
+ * configuration setting and wraps the image tag in a span tag.
*
* @param string $icon name of icon file
* @param string $alternate alternate text
* @param boolean $force_text whether to force alternate text to be displayed
- * @param boolean $noSprite If true, the image source will be not replaced
- * with a CSS Sprite
*
- * @return html img tag
+ * @return string an html snippet
*/
-function PMA_getIcon($icon, $alternate = '', $force_text = false, $noSprite = false)
+function PMA_getIcon($icon, $alternate = '', $force_text = false)
{
// $cfg['PropertiesIconic'] is true or both
$include_icon = ($GLOBALS['cfg']['PropertiesIconic'] !== false);
// $cfg['PropertiesIconic'] is false or both
// OR we have no $include_icon
$include_text = ($force_text || true !== $GLOBALS['cfg']['PropertiesIconic']);
- $alternate = htmlspecialchars($alternate);
- $button = '';
// Always use a span (we rely on this in js/sql.js)
- $button .= '<span class="nowrap">';
-
+ $button = '<span class="nowrap">';
if ($include_icon) {
- if ($noSprite) {
- $button .= '<img src="' . $GLOBALS['pmaThemeImage'] . $icon . '"'
- . ' class="icon" width="16" height="16" />';
- } else {
- $button .= '<img src="themes/dot.gif"' . ' title="'
- . $alternate . '" alt="' . $alternate . '"' . ' class="icon ic_'
- . str_replace(array('.gif','.png'), '', $icon) . '" />';
- }
+ $button .= PMA_getImage($icon, $alternate);
}
-
if ($include_icon && $include_text) {
$button .= ' ';
}
-
if ($include_text) {
$button .= $alternate;
}
-
$button .= '</span>';
return $button;
}
/**
+ * Returns an HTML IMG tag for a particular image from a theme,
+ * which may be an actual file or an icon from a sprite
+ *
+ * @param string $image The name of the file to get
+ * @param string $alternate Used to set 'alt' and 'title' attributes of the image
+ * @param array $attributes An associative array of other attributes
+ *
+ * @return string an html IMG tag
+ */
+function PMA_getImage($image, $alternate = '', $attributes = array())
+{
+ $url = '';
+ $is_sprite = false;
+ $alternate = htmlspecialchars($alternate);
+
+ // Check if we have the requested image as a sprite
+ // and set $url accordingly
+ if (is_readable($_SESSION['PMA_Theme']->getPath() . '/sprites.lib.php')) {
+ include_once $_SESSION['PMA_Theme']->getPath() . '/sprites.lib.php';
+ $sprites = PMA_sprites();
+ $class = str_replace(array('.gif','.png'), '', $image);
+ if (array_key_exists($class, $sprites)) {
+ $is_sprite = true;
+ $url = 'themes/dot.gif';
+ } else {
+ $url = $GLOBALS['pmaThemeImage'] . $image;
+ }
+ } else {
+ $url = $GLOBALS['pmaThemeImage'] . $image;
+ }
+ // set class attribute
+ if ($is_sprite) {
+ if (isset($attributes['class'])) {
+ $attributes['class'] = "icon ic_$class " . $attributes['class'];
+ } else {
+ $attributes['class'] = "icon ic_$class";
+ }
+ }
+ // set all other attributes
+ $attr_str = '';
+ foreach ($attributes as $key => $value) {
+ if (! in_array($key, array('alt', 'title'))) {
+ $attr_str .= " $key=\"$value\"";
+ }
+ }
+ // override the alt attribute
+ if (isset($attributes['alt'])) {
+ $alt = $attributes['alt'];
+ } else {
+ $alt = $alternate;
+ }
+ // override the title attribute
+ if (isset($attributes['title'])) {
+ $title = $attributes['title'];
+ } else {
+ $title = $alternate;
+ }
+ // generate the IMG tag
+ $template = '<img src="%s" title="%s" alt="%s"%s />';
+ $retval = sprintf($template, $url, $title, $alt, $attr_str);
+
+ return $retval;
+}
+
+/**
* Displays the maximum size for an upload
*
* @param integer $max_upload_size the size
@@ -409,11 +462,9 @@ function PMA_showMySQLDocu($chapter, $link, $big_icon = false, $anchor = '', $ju
if ($just_open) {
return $open_link;
} elseif ($big_icon) {
- return $open_link . '<img class="icon ic_b_sqlhelp" src="themes/dot.gif" alt="'
- . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
+ return $open_link . PMA_getImage('b_sqlhelp.png', __('Documentation')) . '</a>';
} elseif ($GLOBALS['cfg']['ReplaceHelpImg']) {
- return $open_link . '<img class="icon ic_b_help_s" src="themes/dot.gif" alt="'
- . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
+ return $open_link . PMA_getImage('b_help.png', __('Documentation')) . '</a>';
} else {
return '[' . $open_link . __('Documentation') . '</a>]';
}
@@ -433,8 +484,8 @@ function PMA_showDocu($anchor)
{
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
return '<a href="Documentation.html#' . $anchor . '" target="documentation">'
- . '<img class="icon ic_b_help_s" src="themes/dot.gif" alt="'
- . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
+ . PMA_getImage('b_help.png', __('Documentation'))
+ . '</a>';
} else {
return '[<a href="Documentation.html#' . $anchor . '" target="documentation">'
. __('Documentation') . '</a>]';
@@ -456,8 +507,8 @@ function PMA_showPHPDocu($target)
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
return '<a href="' . $url . '" target="documentation">'
- . '<img class="icon ic_b_help_s" src="themes/dot.gif" alt="'
- . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
+ . PMA_getImage('b_help.png', __('Documentation'))
+ . '</a>';
} else {
return '[<a href="' . $url . '" target="documentation">' . __('Documentation') . '</a>]';
}
@@ -503,7 +554,7 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice')
// footnotemarker used in js/tooltip.js
return '<sup class="footnotemarker">' . $nr . '</sup>' .
- '<img class="footnotemarker footnote_' . $nr . ' ic_b_help" src="themes/dot.gif" alt="" />';
+ PMA_getImage('b_help.png', '', array('class' => 'footnotemarker footnote_' . $nr));
}
/**
@@ -1686,9 +1737,8 @@ function PMA_generate_html_tab($tab, $url_params = array(), $base_dir='')
// avoid generating an alt tag, because it only illustrates
// the text that follows and if browser does not display
// images, the text is duplicated
- $image = '<img class="icon %1$s" src="' . $base_dir . 'themes/dot.gif"'
- .' width="16" height="16" alt="" />%2$s';
- $tab['text'] = sprintf($image, htmlentities($tab['icon']), $tab['text']);
+ $tab['text'] = PMA_getImage(htmlentities($tab['icon'])) . $tab['text'];
+
} elseif (empty($tab['text'])) {
// check to not display an empty link-text
$tab['text'] = '?';
diff --git a/libraries/config/FormDisplay.tpl.php b/libraries/config/FormDisplay.tpl.php
index c4bdacc..a9e509a 100644
--- a/libraries/config/FormDisplay.tpl.php
+++ b/libraries/config/FormDisplay.tpl.php
@@ -159,8 +159,8 @@ function display_input($path, $name, $description = '', $type, $value, $value_is
<label for="<?php echo htmlspecialchars($path) ?>"><?php echo $name ?></label>
<?php if (!empty($opts['doc']) || !empty($opts['wiki'])) { ?>
<span class="doc">
- <?php if (!empty($opts['doc'])) { ?><a href="<?php echo $base_dir . $opts['doc'] ?>" target="documentation"><img class="icon ic_b_help_s" src="<?php echo $base_dir; ?>themes/dot.gif" alt="Doc" title="<?php echo __('Documentation') ?>" /></a><?php } ?>
- <?php if (!empty($opts['wiki'])){ ?><a href="<?php echo $opts['wiki'] ?>" target="wiki"><img class="icon ic_b_info" src="<?php echo $base_dir; ?>themes/dot.gif" alt="Wiki" title="Wiki" /></a><?php } ?>
+ <?php if (!empty($opts['doc'])) { ?><a href="<?php echo $base_dir . $opts['doc'] ?>" target="documentation"><?php echo PMA_getImage('b_help.png', __('Documentation')); ?></a><?php } ?>
+ <?php if (!empty($opts['wiki'])){ ?><a href="<?php echo $opts['wiki'] ?>" target="wiki"><?php echo PMA_getImage('b_info.png', __('Wiki')) ?></a><?php } ?>
</span>
<?php } ?>
<?php if ($option_is_disabled) { ?>
@@ -234,17 +234,17 @@ function display_input($path, $name, $description = '', $type, $value, $value_is
}
if ($is_setup_script && isset($opts['userprefs_comment']) && $opts['userprefs_comment']) {
?>
- <a class="userprefs-comment" title="<?php echo htmlspecialchars($opts['userprefs_comment']) ?>"><img alt="comment" class="icon ic_b_tblops" src="<?php echo $base_dir; ?>themes/dot.gif" /></a>
+ <a class="userprefs-comment" title="<?php echo htmlspecialchars($opts['userprefs_comment']) ?>"><?php echo PMA_getImage('b_tblops.png', __('Comment')); ?></a>
<?php
}
if (isset($opts['setvalue']) && $opts['setvalue']) {
?>
- <a class="set-value" href="#<?php echo htmlspecialchars("$path={$opts['setvalue']}") ?>" title="<?php echo sprintf(__('Set value: %s'), htmlspecialchars($opts['setvalue'])) ?>" style="display:none"><img alt="set-value" class="icon ic_b_edit" src="<?php echo $base_dir; ?>themes/dot.gif" /></a>
+ <a class="set-value" href="#<?php echo htmlspecialchars("$path={$opts['setvalue']}") ?>" title="<?php echo sprintf(__('Set value: %s'), htmlspecialchars($opts['setvalue'])) ?>" style="display:none"><?php echo PMA_getImage('b_edit.png'); ?></a>
<?php
}
if (isset($opts['show_restore_default']) && $opts['show_restore_default']) {
?>
- <a class="restore-default" href="#<?php echo $path ?>" title="<?php echo __('Restore default value') ?>" style="display:none"><img alt="restore-default" class="icon ic_s_reload" src="<?php echo $base_dir; ?>themes/dot.gif" /></a>
+ <a class="restore-default" href="#<?php echo $path ?>" title="<?php echo __('Restore default value') ?>" style="display:none"><?php echo PMA_getImage('s_reload.png'); ?></a>
<?php
}
// this must match with displayErrors() in scripts/config.js
@@ -411,4 +411,4 @@ function display_errors($name, $error_list)
}
echo '</dl>';
}
-?>
\ No newline at end of file
+?>
diff --git a/libraries/db_links.inc.php b/libraries/db_links.inc.php
index ed30283..8f49d3f 100644
--- a/libraries/db_links.inc.php
+++ b/libraries/db_links.inc.php
@@ -46,63 +46,63 @@ if ($num_tables == 0) {
$tab_structure['link'] = 'db_structure.php';
$tab_structure['text'] = __('Structure');
-$tab_structure['icon'] = 'ic_b_props';
+$tab_structure['icon'] = 'b_props.png';
$tab_sql['link'] = 'db_sql.php';
$tab_sql['args']['db_query_force'] = 1;
$tab_sql['text'] = __('SQL');
-$tab_sql['icon'] = 'ic_b_sql';
+$tab_sql['icon'] = 'b_sql.png';
$tab_export['text'] = __('Export');
-$tab_export['icon'] = 'ic_b_export';
+$tab_export['icon'] = 'b_export.png';
$tab_export['link'] = 'db_export.php';
$tab_search['text'] = __('Search');
-$tab_search['icon'] = 'ic_b_search';
+$tab_search['icon'] = 'b_search.png';
$tab_search['link'] = 'db_search.php';
if (PMA_Tracker::isActive()) {
$tab_tracking['text'] = __('Tracking');
- $tab_tracking['icon'] = 'ic_eye';
+ $tab_tracking['icon'] = 'eye.png';
$tab_tracking['link'] = 'db_tracking.php';
}
$tab_qbe['text'] = __('Query');
-$tab_qbe['icon'] = 'ic_s_db';
+$tab_qbe['icon'] = 's_db.png';
$tab_qbe['link'] = 'db_qbe.php';
if ($cfgRelation['designerwork']) {
$tab_designer['text'] = __('Designer');
- $tab_designer['icon'] = 'ic_b_relations';
+ $tab_designer['icon'] = 'b_relations.png';
$tab_designer['link'] = 'pmd_general.php';
}
if (! $db_is_information_schema) {
$tab_import['link'] = 'db_import.php';
$tab_import['text'] = __('Import');
- $tab_import['icon'] = 'ic_b_import';
+ $tab_import['icon'] = 'b_import.png';
$tab_operation['link'] = 'db_operations.php';
$tab_operation['text'] = __('Operations');
- $tab_operation['icon'] = 'ic_b_tblops';
+ $tab_operation['icon'] = 'b_tblops.png';
if ($is_superuser && !PMA_DRIZZLE) {
$tab_privileges['link'] = 'server_privileges.php';
$tab_privileges['args']['checkprivs'] = $db;
// stay on database view
$tab_privileges['args']['viewing_mode'] = 'db';
$tab_privileges['text'] = __('Privileges');
- $tab_privileges['icon'] = 'ic_s_rights';
+ $tab_privileges['icon'] = 's_rights.png';
}
$tab_routines['link'] = 'db_routines.php';
$tab_routines['text'] = __('Routines');
- $tab_routines['icon'] = 'ic_b_routines';
+ $tab_routines['icon'] = 'b_routines.png';
$tab_events['link'] = 'db_events.php';
$tab_events['text'] = __('Events');
- $tab_events['icon'] = 'ic_b_events';
+ $tab_events['icon'] = 'b_events.png';
$tab_triggers['link'] = 'db_triggers.php';
$tab_triggers['text'] = __('Triggers');
- $tab_triggers['icon'] = 'ic_b_triggers';
+ $tab_triggers['icon'] = 'b_triggers.png';
}
/**
diff --git a/libraries/db_structure.lib.php b/libraries/db_structure.lib.php
index d2702eb..961c64a 100644
--- a/libraries/db_structure.lib.php
+++ b/libraries/db_structure.lib.php
@@ -94,19 +94,21 @@ function PMA_SortableTableHeader($title, $sort, $initial_sort_order = 'ASC')
if ($requested_sort_order == 'ASC') {
$future_sort_order = 'DESC';
// current sort order is ASC
- $order_img = ' <img class="icon ic_s_asc" src="themes/dot.gif" alt="'. __('Ascending') . '" title="'. __('Ascending') . '" id="sort_arrow" />';
+ $order_img = ' ' . PMA_getImage('s_asc.png', __('Ascending'), array('class' => 'sort_arrow', 'title' => ''));
+ $order_img .= ' ' . PMA_getImage('s_desc.png', __('Descending'), array('class' => 'sort_arrow hide', 'title' => ''));
// but on mouse over, show the reverse order (DESC)
- $order_link_params['onmouseover'] = 'if ($(\'#sort_arrow\').length > 0) { $(\'#sort_arrow\').attr(\'class\',\'icon ic_s_desc\'); }';
+ $order_link_params['onmouseover'] = "$('.sort_arrow').toggle();";
// on mouse out, show current sort order (ASC)
- $order_link_params['onmouseout'] = 'if ($(\'#sort_arrow\').length > 0) { $(\'#sort_arrow\').attr(\'class\',\'icon ic_s_asc\'); }';
+ $order_link_params['onmouseout'] = "$('.sort_arrow').toggle();";
} else {
$future_sort_order = 'ASC';
// current sort order is DESC
- $order_img = ' <img class="icon ic_s_desc" src="themes/dot.gif" alt="'. __('Descending') . '" title="'. __('Descending') . '" id="sort_arrow" />';
+ $order_img = ' ' . PMA_getImage('s_asc.png', __('Ascending'), array('class' => 'sort_arrow hide', 'title' => ''));
+ $order_img .= ' ' . PMA_getImage('s_desc.png', __('Descending'), array('class' => 'sort_arrow', 'title' => ''));
// but on mouse over, show the reverse order (ASC)
- $order_link_params['onmouseover'] = 'if ($(\'#sort_arrow\').length > 0) { $(\'#sort_arrow\').attr(\'class\',\'icon ic_s_asc\'); }';
+ $order_link_params['onmouseover'] = "$('.sort_arrow').toggle();";
// on mouse out, show current sort order (DESC)
- $order_link_params['onmouseout'] = 'if ($(\'#sort_arrow\').length > 0) { $(\'#sort_arrow\').attr(\'class\',\'icon ic_s_desc\'); }';
+ $order_link_params['onmouseout'] = "$('.sort_arrow').toggle();";
}
}
diff --git a/libraries/display_create_database.lib.php b/libraries/display_create_database.lib.php
index eac2c1d..121e2a8 100644
--- a/libraries/display_create_database.lib.php
+++ b/libraries/display_create_database.lib.php
@@ -39,7 +39,7 @@ if ($is_create_db_priv) {
<strong><?php echo __('Create database') . ': ' . PMA_showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br />
<?php
echo '<span class="noPrivileges">'
- . ($cfg['ErrorIconic'] ? '<img class="icon ic_s_error2" src="themes/dot.gif" alt="" hspace="2" border="0" align="middle" />' : '')
+ . ($cfg['ErrorIconic'] ? PMA_getImage('s_error2.png', '', array('hspace' => 2, 'border' => 0, 'align' => 'middle')) : '')
. '' . __('No Privileges') .'</span>';
} // end create db form or message
?>
diff --git a/libraries/display_create_table.lib.php b/libraries/display_create_table.lib.php
index 8341342..bd963ae 100644
--- a/libraries/display_create_table.lib.php
+++ b/libraries/display_create_table.lib.php
@@ -41,7 +41,7 @@ $is_create_table_priv = true;
<legend>
<?php
if ($GLOBALS['cfg']['PropertiesIconic']) {
- echo '<img class="icon ic_b_newtbl" src="themes/dot.gif" alt="" />';
+ echo PMA_getImage('b_newtbl.png');
}
echo sprintf(__('Create table on database %s'), PMA_getDbLink());
?>
diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php
index b855191..8ee404c 100644
--- a/libraries/display_export.lib.php
+++ b/libraries/display_export.lib.php
@@ -76,7 +76,7 @@ if (isset($_GET['sql_query'])) {
<div class="exportoptions" id="header">
<h2>
- <img class="icon ic_b_export" src="themes/dot.gif" alt="export" />
+ <?php echo PMA_getImage('b_export.png', __('Export')); ?>
<?php
if ($export_type == 'server') {
echo __('Exporting databases from the current server');
diff --git a/libraries/display_import.lib.php b/libraries/display_import.lib.php
index 8e17e5a..611d8a6 100644
--- a/libraries/display_import.lib.php
+++ b/libraries/display_import.lib.php
@@ -123,7 +123,7 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
<div class="exportoptions" id="header">
<h2>
- <img class="icon ic_b_import" src="themes/dot.gif" alt="import" />
+ <?php echo PMA_getImage('b_import.png', __('Import')); ?>
<?php
if ($import_type == 'server') {
echo __('Importing into the current server');
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index d088698..45cda6c 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -947,10 +947,12 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$order_img = '';
} elseif ('DESC' == $sort_direction) {
$sort_order .= ' ASC';
- $order_img = ' <img class="icon ic_s_desc" src="themes/dot.gif" alt="'. __('Descending') . '" title="'. __('Descending') . '" id="soimg' . $i . '" />';
+ $order_img = ' ' . PMA_getImage('s_desc.png', __('Descending'), array('class' => "soimg$i", 'title' => ''));
+ $order_img .= ' ' . PMA_getImage('s_asc.png', __('Ascending'), array('class' => "soimg$i hide", 'title' => ''));
} else {
$sort_order .= ' DESC';
- $order_img = ' <img class="icon ic_s_asc" src="themes/dot.gif" alt="'. __('Ascending') . '" title="'. __('Ascending') . '" id="soimg' . $i . '" />';
+ $order_img = ' ' . PMA_getImage('s_asc.png', __('Ascending'), array('class' => "soimg$i", 'title' => ''));
+ $order_img .= ' ' . PMA_getImage('s_desc.png', __('Descending'), array('class' => "soimg$i hide", 'title' => ''));
}
if (preg_match('@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|LOCK IN SHARE MODE))@is', $unsorted_sql_query, $regs3)) {
@@ -971,11 +973,11 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$order_link_params = array();
if (isset($order_img) && $order_img!='') {
if (strstr($order_img, 'asc')) {
- $order_link_params['onmouseover'] = 'if ($(\'#soimg' . $i . '\').length > 0) { $(\'#soimg' . $i . '\').attr(\'class\', \'icon ic_s_desc\'); }';
- $order_link_params['onmouseout'] = 'if ($(\'#soimg' . $i . '\').length > 0) { $(\'#soimg' . $i . '\').attr(\'class\', \'icon ic_s_asc\'); }';
+ $order_link_params['onmouseover'] = "$('.soimg$i').toggle()";
+ $order_link_params['onmouseout'] = "$('.soimg$i').toggle()";
} elseif (strstr($order_img, 'desc')) {
- $order_link_params['onmouseover'] = 'if ($(\'#soimg' . $i . '\').length > 0) { $(\'#soimg' . $i . '\').attr(\'class\', \'icon ic_s_asc\'); }';
- $order_link_params['onmouseout'] = 'if ($(\'#soimg' . $i . '\').length > 0) { $(\'#soimg' . $i . '\').attr(\'class\', \'icon ic_s_desc\'); }';
+ $order_link_params['onmouseover'] = "$('.soimg$i').toggle()";
+ $order_link_params['onmouseout'] = "$('.soimg$i').toggle()";
}
}
if ($GLOBALS['cfg']['HeaderFlipType'] == 'auto') {
diff --git a/libraries/footer.inc.php b/libraries/footer.inc.php
index 9d6259d..7482ee2 100644
--- a/libraries/footer.inc.php
+++ b/libraries/footer.inc.php
@@ -162,8 +162,7 @@ setURLHash("<?php echo PMA_generate_common_url($url_params, 'text', ''); ?>");
echo '<a href="index.php' . PMA_generate_common_url($url_params) . '"'
. ' title="' . __('Open new phpMyAdmin window') . '" target="_blank">';
if ($GLOBALS['cfg']['NavigationBarIconic']) {
- echo '<img class="icon ic_window-new" src="themes/dot.gif"'
- . ' alt="' . __('Open new phpMyAdmin window') . '" />';
+ echo PMA_getImage('window-new.png', __('Open new phpMyAdmin window'));
}
if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
echo __('Open new phpMyAdmin window');
diff --git a/libraries/header.inc.php b/libraries/header.inc.php
index 54c59b2..4997ef6 100644
--- a/libraries/header.inc.php
+++ b/libraries/header.inc.php
@@ -115,13 +115,8 @@ if (isset($GLOBALS['is_ajax_request']) && !$GLOBALS['is_ajax_request']) {
: ':' . $GLOBALS['cfg']['Server']['port']
)
);
+ $separator = "<span class='separator'>»</span>\n";
$item = '<a href="%1$s?%2$s" class="item">';
- if ($GLOBALS['cfg']['NavigationBarIconic']) {
- $separator = ' <span class="separator"><img class="icon ic_item_' . $GLOBALS['text_dir'] . '" src="themes/dot.gif" alt="-" /></span>' . "\n";
- $item .= ' <img class="icon %5$s" src="themes/dot.gif" alt="" /> ' . "\n";
- } else {
- $separator = ' <span class="separator"> - </span>' . "\n";
- }
if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
$item .= '%4$s: ';
@@ -129,34 +124,41 @@ if (isset($GLOBALS['is_ajax_request']) && !$GLOBALS['is_ajax_request']) {
$item .= '%3$s</a>' . "\n";
echo '<div id="serverinfo">' . "\n";
+ if ($GLOBALS['cfg']['NavigationBarIconic']) {
+ echo PMA_getImage('s_host.png') . "\n";
+ }
printf($item,
$GLOBALS['cfg']['DefaultTabServer'],
PMA_generate_common_url(),
htmlspecialchars($server_info),
- __('Server'),
- 'ic_s_host');
+ __('Server'));
if (strlen($GLOBALS['db'])) {
echo $separator;
+ if ($GLOBALS['cfg']['NavigationBarIconic']) {
+ echo PMA_getImage('s_db.png') . "\n";
+ }
printf($item,
$GLOBALS['cfg']['DefaultTabDatabase'],
PMA_generate_common_url($GLOBALS['db']),
htmlspecialchars($GLOBALS['db']),
- __('Database'),
- 'ic_s_db');
+ __('Database'));
// if the table is being dropped, $_REQUEST['purge'] is set to '1'
// so do not display the table name in upper div
if (strlen($GLOBALS['table']) && ! (isset($_REQUEST['purge']) && $_REQUEST['purge'] == '1')) {
include_once './libraries/tbl_info.inc.php';
echo $separator;
+ if ($GLOBALS['cfg']['NavigationBarIconic']) {
+ $icon = isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'b_views.png' : 's_tbl.png';
+ echo PMA_getImage($icon) . "\n";
+ }
printf($item,
$GLOBALS['cfg']['DefaultTabTable'],
PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']),
str_replace(' ', ' ', htmlspecialchars($GLOBALS['table'])),
- (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? __('View') : __('Table')),
- (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'ic_b_views' : 'ic_s_tbl'));
+ (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? __('View') : __('Table')));
/**
* Displays table comment
diff --git a/libraries/header_scripts.inc.php b/libraries/header_scripts.inc.php
index d211e48..a6bc313 100644
--- a/libraries/header_scripts.inc.php
+++ b/libraries/header_scripts.inc.php
@@ -41,6 +41,8 @@ if (isset($GLOBALS['db'])) {
$params['db'] = $GLOBALS['db'];
}
$GLOBALS['js_include'][] = 'messages.php' . PMA_generate_common_url($params);
+// Append the theme id to this url to invalidate the cache on a theme change
+$GLOBALS['js_include'][] = 'get_image.js.php?theme=' . urlencode($_SESSION['PMA_Theme']->getId());
/**
* Here we add a timestamp when loading the file, so that users who
diff --git a/libraries/navigation_header.inc.php b/libraries/navigation_header.inc.php
index ede5ef8..a821a63 100644
--- a/libraries/navigation_header.inc.php
+++ b/libraries/navigation_header.inc.php
@@ -56,7 +56,7 @@ if ($GLOBALS['cfg']['LeftDisplayLogo']) {
echo '<a href="main.php?' . $query_url . '"'
.' title="' . __('Home') . '">'
.($GLOBALS['cfg']['MainPageIconic']
- ? '<img class="icon ic_b_home" src="themes/dot.gif" alt="' . __('Home') . '" />'
+ ? PMA_getImage('b_home.png', __('Home'))
: __('Home'))
.'</a>' . "\n";
// if we have chosen server
@@ -68,7 +68,7 @@ if ($GLOBALS['cfg']['LeftDisplayLogo']) {
.urlencode($PHP_AUTH_USER) . '" target="_parent"'
.' title="' . __('Log out') . '" >'
.($GLOBALS['cfg']['MainPageIconic']
- ? '<img class="icon ic_s_loggoff" src="themes/dot.gif" alt="' . __('Log out') . '" />'
+ ? PMA_getImage('s_loggoff.png', __('Log out'))
: __('Log out'))
.'</a>' . "\n";
} // end if ($GLOBALS['cfg']['Server']['auth_type'] != 'config'
@@ -76,8 +76,7 @@ if ($GLOBALS['cfg']['LeftDisplayLogo']) {
$anchor = 'querywindow.php?' . PMA_generate_common_url($db, $table);
if ($GLOBALS['cfg']['MainPageIconic']) {
- $query_frame_link_text =
- '<img class="icon ic_b_selboard" src="themes/dot.gif" alt="' . __('Query window') . '" />';
+ $query_frame_link_text = PMA_getImage('b_selboard.png', __('Query window'));
} else {
echo '<br />' . "\n";
$query_frame_link_text = __('Query window');
@@ -92,8 +91,7 @@ if ($GLOBALS['cfg']['LeftDisplayLogo']) {
.' title="' . __('phpMyAdmin documentation') . '" >';
if ($GLOBALS['cfg']['MainPageIconic']) {
- echo '<img class="icon ic_b_docs" src="themes/dot.gif"'
- .' alt="' . __('phpMyAdmin documentation') . '" />';
+ echo PMA_getImage('b_docs.png', __('phpMyAdmin documentation'));
}
echo '</a>';
echo ' ' . PMA_showMySQLDocu('', '', true) . "\n";
@@ -104,9 +102,7 @@ if ($GLOBALS['cfg']['LeftDisplayLogo']) {
}
echo '<a href="navigation.php?' . PMA_generate_common_url($params) . '" target="frame_navigation">';
if ($GLOBALS['cfg']['MainPageIconic']) {
- echo '<img class="icon ic_s_reload" src="themes/dot.gif"'
- . ' title="' . __('Reload navigation frame') . '"'
- . ' alt="' . __('Reload navigation frame') . '" />';
+ echo PMA_getImage('s_reload', __('Reload navigation frame'));
} else {
echo '<br />' . __('Reload navigation frame');
}
diff --git a/libraries/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php
index 26100b3..9de8327 100644
--- a/libraries/schema/User_Schema.class.php
+++ b/libraries/schema/User_Schema.class.php
@@ -376,7 +376,7 @@ class PMA_User_Schema
<?php
echo PMA_generate_common_hidden_inputs($db);
if ($cfg['PropertiesIconic']) {
- echo '<img class="icon ic_b_views" src="themes/dot.gif" />';
+ echo PMA_getImage('b_views.png');
}
echo __('Display relational schema');
?>:
diff --git a/libraries/server_links.inc.php b/libraries/server_links.inc.php
index e2ab3a7..83b8a9c 100644
--- a/libraries/server_links.inc.php
+++ b/libraries/server_links.inc.php
@@ -38,15 +38,15 @@ if (!$GLOBALS['is_ajax_request']) {
*/
$tabs = array();
- $tabs['databases']['icon'] = 'ic_s_db';
+ $tabs['databases']['icon'] = 's_db.png';
$tabs['databases']['link'] = 'server_databases.php';
$tabs['databases']['text'] = __('Databases');
- $tabs['sql']['icon'] = 'ic_b_sql';
+ $tabs['sql']['icon'] = 'b_sql.png';
$tabs['sql']['link'] = 'server_sql.php';
$tabs['sql']['text'] = __('SQL');
- $tabs['status']['icon'] = 'ic_s_status';
+ $tabs['status']['icon'] = 's_status.png';
$tabs['status']['link'] = 'server_status.php';
$tabs['status']['text'] = __('Status');
@@ -55,55 +55,55 @@ if (!$GLOBALS['is_ajax_request']) {
$tabs['process']['text'] = __('Processes');*/
if ($is_superuser && !PMA_DRIZZLE) {
- $tabs['rights']['icon'] = 'ic_s_rights';
+ $tabs['rights']['icon'] = 's_rights.png';
$tabs['rights']['link'] = 'server_privileges.php';
$tabs['rights']['text'] = __('Privileges');
}
- $tabs['export']['icon'] = 'ic_b_export';
+ $tabs['export']['icon'] = 'b_export.png';
$tabs['export']['link'] = 'server_export.php';
$tabs['export']['text'] = __('Export');
- $tabs['import']['icon'] = 'ic_b_import';
+ $tabs['import']['icon'] = 'b_import.png';
$tabs['import']['link'] = 'server_import.php';
$tabs['import']['text'] = __('Import');
- $tabs['settings']['icon'] = 'ic_b_tblops';
+ $tabs['settings']['icon'] = 'b_tblops.png';
$tabs['settings']['link'] = 'prefs_manage.php';
$tabs['settings']['text'] = __('Settings');
$tabs['settings']['active'] = in_array(basename($GLOBALS['PMA_PHP_SELF']),
array('prefs_forms.php', 'prefs_manage.php'));
- $tabs['synchronize']['icon'] = 'ic_s_sync';
+ $tabs['synchronize']['icon'] = 's_sync.png';
$tabs['synchronize']['link'] = 'server_synchronize.php';
$tabs['synchronize']['text'] = __('Synchronize');
if (! empty($binary_logs)) {
- $tabs['binlog']['icon'] = 'ic_s_tbl';
+ $tabs['binlog']['icon'] = 's_tbl.png';
$tabs['binlog']['link'] = 'server_binlog.php';
$tabs['binlog']['text'] = __('Binary log');
}
if ($is_superuser && !PMA_DRIZZLE) {
- $tabs['replication']['icon'] = 'ic_s_replication';
+ $tabs['replication']['icon'] = 's_replication.png';
$tabs['replication']['link'] = 'server_replication.php';
$tabs['replication']['text'] = __('Replication');
}
- $tabs['vars']['icon'] = 'ic_s_vars';
+ $tabs['vars']['icon'] = 's_vars.png';
$tabs['vars']['link'] = 'server_variables.php';
$tabs['vars']['text'] = __('Variables');
- $tabs['charset']['icon'] = 'ic_s_asci';
+ $tabs['charset']['icon'] = 's_asci.png';
$tabs['charset']['link'] = 'server_collations.php';
$tabs['charset']['text'] = __('Charsets');
if (PMA_DRIZZLE) {
- $tabs['plugins']['icon'] = 'ic_b_engine';
+ $tabs['plugins']['icon'] = 'b_engine.png';
$tabs['plugins']['link'] = 'server_plugins.php';
$tabs['plugins']['text'] = __('Plugins');
} else {
- $tabs['engine']['icon'] = 'ic_b_engine';
+ $tabs['engine']['icon'] = 'b_engine.png';
$tabs['engine']['link'] = 'server_engines.php';
$tabs['engine']['text'] = __('Engines');
}
diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php
index 0e4f47c..3a98339 100644
--- a/libraries/sql_query_form.lib.php
+++ b/libraries/sql_query_form.lib.php
@@ -381,8 +381,7 @@ function PMA_sqlQueryFormBookmark()
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
echo ' <a href="./Documentation.html#faqbookmark"'
.' target="documentation">'
- .'<img class="icon ic_b_help_s" src="themes/dot.gif"'
- .' alt="' . __('Documentation') . '" /></a> ';
+ . PMA_getImage('b_help.png', __('Documentation'));
} else {
echo ' (<a href="./Documentation.html#faqbookmark"'
.' target="documentation">' . __('Documentation') . '</a>): ';
diff --git a/libraries/tbl_links.inc.php b/libraries/tbl_links.inc.php
index 1d8af40..2cbf84e 100644
--- a/libraries/tbl_links.inc.php
+++ b/libraries/tbl_links.inc.php
@@ -51,30 +51,30 @@ if (! isset($db_is_information_schema)) {
*/
$tabs = array();
-$tabs['browse']['icon'] = 'ic_b_browse';
+$tabs['browse']['icon'] = 'b_browse.png';
$tabs['browse']['text'] = __('Browse');
$tabs['browse']['link'] = 'sql.php';
$tabs['browse']['args']['pos'] = 0;
-$tabs['structure']['icon'] = 'ic_b_props';
+$tabs['structure']['icon'] = 'b_props.png';
$tabs['structure']['link'] = 'tbl_structure.php';
$tabs['structure']['text'] = __('Structure');
-$tabs['sql']['icon'] = 'ic_b_sql';
+$tabs['sql']['icon'] = 'b_sql.png';
$tabs['sql']['link'] = 'tbl_sql.php';
$tabs['sql']['text'] = __('SQL');
-$tabs['search']['icon'] = 'ic_b_search';
+$tabs['search']['icon'] = 'b_search.png';
$tabs['search']['text'] = __('Search');
$tabs['search']['link'] = 'tbl_select.php';
if (!$db_is_information_schema) {
- $tabs['insert']['icon'] = 'ic_b_insrow';
+ $tabs['insert']['icon'] = 'b_insrow.png';
$tabs['insert']['link'] = 'tbl_change.php';
$tabs['insert']['text'] = __('Insert');
}
-$tabs['export']['icon'] = 'ic_b_tblexport';
+$tabs['export']['icon'] = 'b_tblexport.png';
$tabs['export']['link'] = 'tbl_export.php';
$tabs['export']['args']['single_table'] = 'true';
$tabs['export']['text'] = __('Export');
@@ -84,16 +84,16 @@ $tabs['export']['text'] = __('Export');
* for views and information_schema
*/
if (! $tbl_is_view && !$db_is_information_schema) {
- $tabs['import']['icon'] = 'ic_b_tblimport';
+ $tabs['import']['icon'] = 'b_tblimport.png';
$tabs['import']['link'] = 'tbl_import.php';
$tabs['import']['text'] = __('Import');
- $tabs['operation']['icon'] = 'ic_b_tblops';
+ $tabs['operation']['icon'] = 'b_tblops.png';
$tabs['operation']['link'] = 'tbl_operations.php';
$tabs['operation']['text'] = __('Operations');
}
if (PMA_Tracker::isActive()) {
- $tabs['tracking']['icon'] = 'ic_eye';
+ $tabs['tracking']['icon'] = 'eye.png';
$tabs['tracking']['text'] = __('Tracking');
$tabs['tracking']['link'] = 'tbl_tracking.php';
}
@@ -101,7 +101,7 @@ if (!$db_is_information_schema && !PMA_DRIZZLE) {
if (PMA_currentUserHasPrivilege('TRIGGER', $db, $table) && ! PMA_Table::isView($db, $table)) {
$tabs['triggers']['link'] = 'tbl_triggers.php';
$tabs['triggers']['text'] = __('Triggers');
- $tabs['triggers']['icon'] = 'ic_b_triggers';
+ $tabs['triggers']['icon'] = 'b_triggers.png';
}
}
@@ -109,7 +109,7 @@ if (!$db_is_information_schema && !PMA_DRIZZLE) {
* Views support a limited number of operations
*/
if ($tbl_is_view && !$db_is_information_schema) {
- $tabs['operation']['icon'] = 'ic_b_tblops';
+ $tabs['operation']['icon'] = 'b_tblops.png';
$tabs['operation']['link'] = 'view_operations.php';
$tabs['operation']['text'] = __('Operations');
}
diff --git a/libraries/user_preferences.inc.php b/libraries/user_preferences.inc.php
index 8295100..22b3725 100644
--- a/libraries/user_preferences.inc.php
+++ b/libraries/user_preferences.inc.php
@@ -20,12 +20,12 @@ if (! isset($forms[$form_param])) {
$form_param = array_shift($forms_keys);
}
$tabs_icons = array(
- 'Features' => 'ic_b_tblops',
- 'Sql_queries' => 'ic_b_sql',
- 'Left_frame' => 'ic_b_select',
- 'Main_frame' => 'ic_b_props',
- 'Import' => 'ic_b_import',
- 'Export' => 'ic_b_export');
+ 'Features' => 'b_tblops.png',
+ 'Sql_queries' => 'b_sql.png',
+ 'Left_frame' => 'b_select.png',
+ 'Main_frame' => 'b_props.png',
+ 'Import' => 'b_import.png',
+ 'Export' => 'b_export.png');
echo '<ul id="topmenu2">';
echo PMA_generate_html_tab(
array(
diff --git a/navigation.php b/navigation.php
index 1db459c..300bdb5 100644
--- a/navigation.php
+++ b/navigation.php
@@ -110,6 +110,8 @@ require_once './libraries/header_http.inc.php';
echo PMA_includeJS('navigation.js');
echo PMA_includeJS('functions.js');
echo PMA_includeJS('messages.php');
+ // Append the theme id to this url to invalidate the cache on a theme change
+ echo PMA_includeJS('get_image.js.php?theme=' . urlencode($_SESSION['PMA_Theme']->getId()));
?>
<script type="text/javascript">
// <![CDATA[
@@ -227,10 +229,8 @@ if (! $GLOBALS['server']) {
// or $GLOBALS['cfg']['Servers']['only_db'] is defined and is not an array)
// In this case, the database should not be collapsible/expandable
-$img_plus = '<img class="icon ic_b_plus" id="el%dImg" src="themes/dot.gif"'
- .' alt="+" />';
-$img_minus = '<img class="icon ic_b_minus" id="el%dImg" src="themes/dot.gif"'
- .' alt="-" />';
+$img_plus = PMA_getImage('b_plus.png', '+', array('id' => 'el%dImg'));
+$img_minus = PMA_getImage('b_minus.png', '-', array('id' => 'el%dImg'));
$href_left = '<a onclick="if (toggle(\'%d\')) return false;"'
.' href="navigation.php?%s" target="_self">';
@@ -300,7 +300,7 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
$class = '';
$GLOBALS['cfg']['AjaxEnable'] ? $class="ajax" : '';
echo '<ul id="newtable"><li><a target="frame_content" href="tbl_create.php' . PMA_generate_common_url(array('db' => $GLOBALS['db'])) . '" class="'.$class .'" >'
- .'<img class="icon ic_b_snewtbl" src="themes/dot.gif" id="icon_newtable" alt="' . _pgettext('short form', 'Create table') . '" />'
+ . PMA_getImage('b_snewtbl.png', _pgettext('short form', 'Create table'), array('id' => "icon_newtable"))
. _pgettext('short form', 'Create table') . '</a></li></ul>';
}
} elseif ($GLOBALS['cfg']['LeftFrameLight']) {
@@ -594,15 +594,13 @@ function PMA_displayTableList($tables, $visible = false,
. $GLOBALS['common_url_query']
.'&table=' . urlencode($table['Name'])
.'&goto=' . $GLOBALS['cfg']['LeftDefaultTabTable']
- . '" >'
- .'<img src="themes/dot.gif"';
+ . '" >';
+ $attr = array('id' => 'icon_' . htmlspecialchars($table_db . '.' . $table['Name']));
if ('VIEW' === strtoupper($table['Comment'])) {
- echo ' class="icon ic_s_views"';
+ echo PMA_getImage('s_views.png', htmlspecialchars($link_title), $attr);
} else {
- echo ' class="icon ic_b_sbrowse"';
+ echo PMA_getImage('b_browse.png', htmlspecialchars($link_title), $attr);
}
- echo ' id="icon_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
- .' alt="' . htmlspecialchars($link_title) . '" /></a>' . "\n";
// link for the table name itself
$href = $GLOBALS['cfg']['DefaultTabTable'] . '?'
diff --git a/querywindow.php b/querywindow.php
index 9cffbe6..c18d2a6 100644
--- a/querywindow.php
+++ b/querywindow.php
@@ -60,17 +60,17 @@ if ($no_js) {
$tabs = false;
} else {
$tabs = array();
- $tabs['sql']['icon'] = 'ic_b_sql';
+ $tabs['sql']['icon'] = 'b_sql.png';
$tabs['sql']['text'] = __('SQL');
$tabs['sql']['fragment'] = '#';
$tabs['sql']['attr'] = 'onclick="PMA_querywindowCommit(\'sql\');return false;"';
$tabs['sql']['active'] = (bool) ($querydisplay_tab == 'sql');
- $tabs['import']['icon'] = 'ic_b_import';
+ $tabs['import']['icon'] = 'b_import.png';
$tabs['import']['text'] = __('Import files');
$tabs['import']['fragment'] = '#';
$tabs['import']['attr'] = 'onclick="PMA_querywindowCommit(\'files\');return false;"';
$tabs['import']['active'] = (bool) ($querydisplay_tab == 'files');
- $tabs['history']['icon'] = 'ic_b_bookmark';
+ $tabs['history']['icon'] = 'b_bookmark.png';
$tabs['history']['text'] = __('SQL history');
$tabs['history']['fragment'] = '#';
$tabs['history']['attr'] = 'onclick="PMA_querywindowCommit(\'history\');return false;"';
diff --git a/scripts/create-release.sh b/scripts/create-release.sh
index d411a67..9227616 100755
--- a/scripts/create-release.sh
+++ b/scripts/create-release.sh
@@ -133,6 +133,11 @@ if [ -f ./scripts/compress-js ] ; then
rm -rf sources
fi
+if [ -f ./scripts/generate-sprites ] ; then
+ echo "* Generating sprites"
+ ./scripts/generate-sprites . || exit 1
+fi
+
echo "* Removing unneeded files"
# Remove test directory from package to avoid Path disclosure messages
diff --git a/scripts/generate-sprites b/scripts/generate-sprites
new file mode 100755
index 0000000..6ea9aef
--- /dev/null
+++ b/scripts/generate-sprites
@@ -0,0 +1,140 @@
+#!/bin/sh
+# vim: expandtab sw=4 ts=4 sts=4:
+
+# Check for proper number of command line args.
+if [ $# -ne 1 ]; then
+ echo "Usage: `basename $0` {path_to_pma_root_folder}"
+ exit 65
+fi
+
+# Check if we have ImageMagick
+hash identify 2>&- || {
+ echo "ERROR: ImageMagick not found on the system!"
+ echo "Quitting..."
+ exit 1
+}
+
+# Compress image, if possible
+HAVE_PNGCRUSH=1
+hash pngcrush 2>&- || {
+ HAVE_PNGCRUSH=0
+ echo "WARNING: 'pngcrush' not found, will not be able to compress the sprites"
+}
+
+# Icons that should not be included in the sprite
+BLACKLIST="vertical_line.png spacer.png"
+
+# Output filename for the sprite image
+OUTPUT="sprites.png"
+
+# Library file that will contain the information about
+# individual images that are part of the sprite
+LIBRARY="../sprites.lib.php"
+
+if [ -d $1/themes ]; then
+ cd $1/themes
+
+ # For each theme
+ for d in $(ls -d */); do
+ # Go to folder that contains the images
+ cd "$d"img
+ echo "Processing folder: $PWD"
+ FILES=''
+ for f in $(ls *.png); do
+ VALID=true
+ # Do not include blacklisted icons
+ for b in $BLACKLIST; do
+ if [ "$b" = "$f" ]; then
+ VALID=false
+ fi
+ done
+ if [ $VALID = false ]; then
+ continue
+ fi
+ DATA=$(identify -ping $f || echo "NULL")
+ if [ "$DATA" != "NULL" ]; then
+ SIZE=$(echo $DATA | cut -d ' ' -f 3 | sed 's/x/ /')
+ # Do not include icons that are larger than 16x16
+ for s in $SIZE; do
+ if [ $s -gt 16 ]; then
+ VALID=false
+ fi
+ done
+ if [ $VALID = true ]; then
+ # Build the list of valid icons
+ FILES="$FILES $f"
+ fi
+ fi
+ done
+
+ # Create an empty sprite of the correct size
+ NUM_FILES=''
+ for f in $FILES; do
+ NUM_FILES=$(($NUM_FILES+1))
+ done
+ convert -size 16x$(($NUM_FILES*16+16)) xc:none temp.png
+
+ # Add each icon to the sprite
+ CURRENT=1
+ for f in $FILES; do
+ convert temp.png $f -geometry +0+$(($CURRENT*16)) -composite temp.png
+ CURRENT=$(($CURRENT+1))
+ done
+
+ # Compress image, if possible
+ if [ $HAVE_PNGCRUSH -eq 1 ]; then
+ echo "Compressing file: $PWD/$OUTPUT"
+ pngcrush -brute temp.png $OUTPUT > /dev/null
+ rm -f temp.png
+ else
+ mv temp.png $OUTPUT
+ fi
+
+ # Generate the library file that contains the information
+ # about individual images that are part of the sprite
+ echo "<?php" > $LIBRARY
+ echo "/* AUTOGENERATED CONTENT - DO NOT EDIT */" >> $LIBRARY
+ echo "/* ALL CHANGES WILL BE UNDONE */" >> $LIBRARY
+ echo "/* RUN './scripts/generate-sprites' TO UPDATE THIS FILE */" >> $LIBRARY
+ echo "function PMA_sprites() {" >> $LIBRARY
+ echo " return array(" >> $LIBRARY
+ PADDING=0
+ for f in $FILES; do
+ if [ ${#f} -gt $PADDING ]; then
+ PADDING=${#f}
+ fi
+ done
+ PADDING=$(($PADDING-3))
+ CURRENT=1
+ for f in $FILES; do
+ # Add a CSS rule for each icon in the sprite
+ NAME=$(echo "'$f'" | sed 's/\.png//' | sed -e :a -e "s/^.\{1,$PADDING\}$/& /;ta")
+
+ DATA=$(identify -ping $f || echo "NULL")
+ if [ "$DATA" != "NULL" ]; then
+ SIZE=$(echo $DATA | cut -d ' ' -f 3 | sed 's/x/ /')
+ WIDTH=0
+ HEIGHT=0
+ for s in $SIZE; do
+ if [ $WIDTH = 0 ]; then
+ WIDTH=$s
+ else
+ HEIGHT=$s
+ fi
+ done
+ fi
+ echo " $NAME => array('position' => '$CURRENT', 'width' => '$WIDTH', 'height' => '$HEIGHT')," >> $LIBRARY
+ CURRENT=$(($CURRENT+1))
+ done
+ echo " );" >> $LIBRARY
+ echo "}" >> $LIBRARY
+ echo "?>" >> $LIBRARY
+
+ # Back to the parent folder
+ cd ../..
+ done
+ exit 0
+else
+ echo "ERROR: could not find the 'themes' folder in '`readlink -f $1`'"
+ exit 1
+fi
diff --git a/server_binlog.php b/server_binlog.php
index e3ac8f4..8e7a316 100644
--- a/server_binlog.php
+++ b/server_binlog.php
@@ -73,7 +73,7 @@ if (empty($_REQUEST['dontlimitchars'])) {
* Displays the sub-page heading
*/
echo '<h2>' . "\n"
- . ($GLOBALS['cfg']['MainPageIconic'] ? '<img src="themes/dot.gif" class="icon ic_s_tbl" alt="" />' : '')
+ . ($GLOBALS['cfg']['MainPageIconic'] ? PMA_getImage('s_tbl.png') : '')
. ' ' . __('Binary log') . "\n"
. '</h2>' . "\n";
diff --git a/server_collations.php b/server_collations.php
index 71508be..0fc182c 100644
--- a/server_collations.php
+++ b/server_collations.php
@@ -34,7 +34,7 @@ require './libraries/server_links.inc.php';
*/
echo '<h2>' . "\n"
. ' ' . ($GLOBALS['cfg']['MainPageIconic']
- ? '<img class="icon ic_s_asci" src="themes/dot.gif" alt="" />'
+ ? PMA_getImage('s_asci.png')
: '')
. '' . __('Character Sets and Collations') . "\n"
. '</h2>' . "\n";
diff --git a/server_databases.php b/server_databases.php
index 8ae3422..e7519a5 100644
--- a/server_databases.php
+++ b/server_databases.php
@@ -99,7 +99,7 @@ require './libraries/server_links.inc.php';
*/
echo '<h2>' . "\n"
. ($GLOBALS['cfg']['MainPageIconic']
- ? '<img class="icon ic_s_db" src="themes/dot.gif" alt="" />'
+ ? PMA_getImage('s_db.png')
: '')
. ($dbstats ? __('Databases statistics') : __('Databases')) . "\n"
.'</h2>' . "\n";
@@ -159,7 +159,7 @@ if ($databases_count > 0) {
. ($is_superuser || $cfg['AllowUserDropDatabase'] ? ' <th></th>' . "\n" : '')
. ' <th><a href="./server_databases.php' . PMA_generate_common_url($_url_params) . '">' . "\n"
. ' ' . __('Database') . "\n"
- . ($sort_by == 'SCHEMA_NAME' ? ' <img class="icon ic_s_' . $sort_order . '" src="themes/dot.gif" alt="' . ($sort_order == 'asc' ? __('Ascending') : __('Descending')) . '" />' . "\n" : '')
+ . ($sort_by == 'SCHEMA_NAME' ? ' ' . PMA_getImage('s_' . $sort_order . '.png', ($sort_order == 'asc' ? __('Ascending') : __('Descending'))) . "\n" : '')
. ' </a></th>' . "\n";
$table_columns = 3;
foreach ($column_order as $stat_name => $stat) {
@@ -176,7 +176,7 @@ if ($databases_count > 0) {
echo ' <th' . $colspan . '>'
.'<a href="./server_databases.php' . PMA_generate_common_url($_url_params) . '">' . "\n"
.'<a href="./server_databases.php' . PMA_generate_common_url($_url_params) . '">' . "\n" t_order == 'asc' ? __('Ascending') : __('Descending'))) . "\n" : '') escending')) . '" />' . "\n" : '') ?>themes/dot.gif" /></a> ng'); ?></a> ="<?php echo $base_dir; ?>themes/dot.gif" /></a> t('+ i +')>' + PMA_getImage('b_edit.png', PMA_messages['strEdit']) + '</td><td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_delete('+ i +')><img src="themes/original/img/b_drop.png" title="Delete"></td></tr></thead>'; "Delete"></td></tr></thead>'; Oÿ hÑ{Oÿ 8;xcd+ p °Ñ{Oÿ uWcd+ :Xcd+ È{Oÿ PÇ{Oÿ k0Wcd+ G H I J K M N O P @Ñ{Oÿ °Ñ{Oÿ He*dd+ Ê{Oÿ Wcd+ 0Wcd+ @Ñ{Oÿ 0ß×dd+ uWcd+ ðsdd+ dd+ Ð×dd+ ØÔ×dd+ ¨Ù×dd+ :Xcd+ He*dd+ Ê{Oÿ `È{Oÿ k0Wcd+ 8e*dd+ Ê{Oÿ È{Oÿ k0Wcd+ (e*dd+ Ê{Oÿ ÀÈ{Oÿ k0Wcd+ e*dd+ Ê{Oÿ ðÈ{Oÿ k0Wcd+ ¨Þ×dd+ uWcd+ ¨Ù×dd+ pÃ{Oÿ èdd+ eWcd+ ØÔ×dd+ É{Oÿ yèdd+ eWcd+ Ð×dd+ ÀÉ{Oÿ Zèdd+ eWcd+ Ødd+ ðsdd+ dd+ Ð×dd+ Øôsdd+ ØÔ×dd+ ¨Ù×dd+ :Xcd+ 8;xcd+ ]Ócd+ °Ñ{Oÿ p+dd+ pË{Oÿ @Ê{Oÿ k0Wcd+ 5 6 7 8 : < = > ? @ B D @Ñ{Oÿ °Ñ{Oÿ à]Ðcd+ °Ñ{Oÿ uWcd+ 5xcd+ ðÉ{Oÿ ]Ócd+ eWcd+ 5xcd+ Õ_ at fÆS Qöl±íÁscd+ °Ñ{Oÿ à]Ðcd+ Ì{Oÿ PË{Oÿ k0Wcd+ u]ÞÓ 4Q ÷U^Qʧ ¶uª¹ñìò*Äv@Ñ{Oÿ °Ñ{Oÿ H®cd+ ôØcd+ ðÒ{Oÿ ¦ ;ed+ ¦ ;ed+ FÖcd+ Ñ{Oÿ °Ò{Oÿ hÑ{Oÿ ÐÍ{Oÿ ÿsdd+ uWcd+ Øôsdd+ 0Ô{Oÿ ¢ ;ed+ Ó{Oÿ Î{Oÿ ÿÿÿÿÿÿÿÿ¢ ;ed+ ¸Ñ{Oÿ .' ' . $stat['disp_name'] . "\n"
- .($sort_by == $stat_name ? ' <img class="icon ic_s_' . $sort_order . '" src="themes/dot.gif" alt="' . ($sort_order == 'asc' ? __('Ascending') : __('Descending')) . '" />' . "\n" : '')
+ .($sort_by == $stat_name ? ' ' . PMA_getImage('s_' . $sort_order . '.png', ($sort_order == 'asc' ? __('Ascending') : __('Descending'))) . "\n" : '')
.' </a></th>' . "\n";
}
}
diff --git a/server_engines.php b/server_engines.php
index 4e5eeb3..afd6d50 100644
--- a/server_engines.php
+++ b/server_engines.php
@@ -41,8 +41,7 @@ if (empty($_REQUEST['engine'])
* Displays the sub-page heading
*/
echo '<h2>' . "\n"
- . ($GLOBALS['cfg']['MainPageIconic']
- ? '<img class="icon ic_b_engine" src="themes/dot.gif" alt="" />' : '')
+ . ($GLOBALS['cfg']['MainPageIconic'] ? PMA_getImage('b_engine.png') : '')
. "\n" . __('Storage Engines') . "\n"
. '</h2>' . "\n";
@@ -105,8 +104,7 @@ if (empty($_REQUEST['engine'])
$engine_plugin = PMA_StorageEngine::getEngine($_REQUEST['engine']);
echo '<h2>' . "\n"
- . ($GLOBALS['cfg']['MainPageIconic']
- ? '<img class="icon ic_b_engine" src="themes/dot.gif" alt="" />' : '')
+ . ($GLOBALS['cfg']['MainPageIconic'] ? PMA_getImage('b_engine.png') : '')
. ' ' . htmlspecialchars($engine_plugin->getTitle()) . "\n"
. ' ' . PMA_showMySQLDocu('', $engine_plugin->getMysqlHelpPage()) . "\n"
. '</h2>' . "\n\n";
diff --git a/server_replication.php b/server_replication.php
index 68db315..b070067 100644
--- a/server_replication.php
+++ b/server_replication.php
@@ -158,7 +158,7 @@ require './libraries/server_links.inc.php';
echo '<div id="replication">';
echo ' <h2>';
-echo ' <img class="icon ic_s_replication" src="themes/dot.gif" alt="" />';
+echo ' ' . PMA_getImage('s_replication.png');
echo __('Replication');
echo ' </h2>';
diff --git a/server_status.php b/server_status.php
index 4a8a37f..5f493e5 100644
--- a/server_status.php
+++ b/server_status.php
@@ -764,7 +764,7 @@ require './libraries/server_links.inc.php';
* Displays the sub-page heading
*/
if ($GLOBALS['cfg']['MainPageIconic']) {
- echo '<img class="icon ic_s_status" src="themes/dot.gif" width="16" height="16" alt="" />';
+ echo PMA_getImage('s_status.png');
}
echo __('Runtime Information');
@@ -889,8 +889,8 @@ echo __('Runtime Information');
<div id="statustabs_advisor" class="jsfeature">
<div class="tabLinks">
- <img src="themes/dot.gif" class="icon ic_play" alt="" /> <a href="#startAnalyzer"><?php echo __('Run analyzer'); ?></a>
- <img src="themes/dot.gif" class="icon ic_b_help" alt="" /> <a href="#openAdvisorInstructions"><?php echo __('Instructions'); ?></a>
+ <?php echo PMA_getImage('play.png'); ?> <a href="#startAnalyzer"><?php echo __('Run analyzer'); ?></a>
+ <?php echo PMA_getImage('b_help.png'); ?> <a href="#openAdvisorInstructions"><?php echo __('Instructions'); ?></a>
</div>
<div class="tabInnerContent clearfloat">
</div>
@@ -1536,31 +1536,31 @@ function printMonitor()
?>
<div class="tabLinks" style="display:none;">
<a href="#pauseCharts">
- <img src="themes/dot.gif" class="icon ic_play" alt="" />
+ <?php echo PMA_getImage('play.png'); ?>
<?php echo __('Start Monitor'); ?>
</a>
<a href="#settingsPopup" rel="popupLink" style="display:none;">
- <img src="themes/dot.gif" class="icon ic_s_cog" alt="" />
+ <?php echo PMA_getImage('s_cog.png'); ?>
<?php echo __('Settings'); ?>
</a>
<?php if (!PMA_DRIZZLE) { ?>
<a href="#monitorInstructionsDialog">
- <img src="themes/dot.gif" class="icon ic_b_help" alt="" />
+ <?php echo PMA_getImage('b_help.png'); ?>
<?php echo __('Instructions/Setup'); ?>
</a>
<?php } ?>
<a href="#endChartEditMode" style="display:none;">
- <img src="themes/dot.gif" class="icon ic_s_okay" alt="" />
+ <?php echo PMA_getImage('s_okay.png'); ?>
<?php echo __('Done rearranging/editing charts'); ?>
</a>
</div>
<div class="popupContent settingsPopup">
<a href="#addNewChart">
- <img src="themes/dot.gif" class="icon ic_b_chart" alt="" />
+ <?php echo PMA_getImage('b_chart.png'); ?>
<?php echo __('Add chart'); ?>
</a>
- <a href="#rearrangeCharts"><img class="icon ic_b_tblops" src="themes/dot.gif" width="16" height="16" alt="" /><?php echo __('Rearrange/edit charts'); ?></a>
+ <a href="#rearrangeCharts"><?php echo PMA_getImage('b_tblops.png'); ?><?php echo __('Rearrange/edit charts'); ?></a>
<div class="clearfloat paddingtop"></div>
<div class="floatleft">
<?php
@@ -1594,7 +1594,7 @@ function printMonitor()
<?php echo __('The phpMyAdmin Monitor can assist you in optimizing the server configuration and track down time intensive queries. For the latter you will need to set log_output to \'TABLE\' and have either the slow_query_log or general_log enabled. Note however, that the general_log produces a lot of data and increases server load by up to 15%'); ?>
<?php if (PMA_MYSQL_INT_VERSION < 50106) { ?>
<p>
- <img class="icon ic_s_attention" src="themes/dot.gif" alt="" />
+ <?php echo PMA_getImage('s_attention.png'); ?>
<?php
echo __('Unfortunately your Database server does not support logging to table, which is a requirement for analyzing the database logs with phpMyAdmin. Logging to table is supported by MySQL 5.1.6 and onwards. You may still use the server charting features however.');
?>
@@ -1617,7 +1617,7 @@ function printMonitor()
echo '</p>';
?>
<p>
- <img class="icon ic_s_attention" src="themes/dot.gif" alt="" />
+ <?php echo PMA_getImage('s_attention.png'); ?>
<?php
echo '<strong>';
echo __('Please note:');
diff --git a/server_synchronize.php b/server_synchronize.php
index 3b8ff59..cb04634 100644
--- a/server_synchronize.php
+++ b/server_synchronize.php
@@ -1149,7 +1149,7 @@ if (! isset($_REQUEST['submit_connect'])
* Displays the sub-page heading
*/
echo '<h2>' . ($GLOBALS['cfg']['MainPageIconic']
- ? '<img class="icon ic_s_sync" src="themes/dot.gif" alt="" />'
+ ? PMA_getImage('s_sync.png')
: '')
. __('Synchronize')
.'</h2>';
diff --git a/server_variables.php b/server_variables.php
index f09706a..9c37864 100644
--- a/server_variables.php
+++ b/server_variables.php
@@ -95,7 +95,7 @@ require './libraries/server_links.inc.php';
* Displays the sub-page heading
*/
echo '<h2>' . "\n"
- . ($cfg['MainPageIconic'] ? '<img class="icon ic_s_vars" src="themes/dot.gif" alt="" />' : '')
+ . ($cfg['MainPageIconic'] ? PMA_getImage('s_vars.png') : '')
. '' . __('Server variables and settings') . "\n"
. PMA_showMySQLDocu('server_system_variables', 'server_system_variables')
. '</h2>' . "\n";
diff --git a/tbl_create.php b/tbl_create.php
index e60c172..2810e0d 100644
--- a/tbl_create.php
+++ b/tbl_create.php
@@ -266,9 +266,11 @@ if (isset($_REQUEST['do_save_data'])) {
if (PMA_Tracker::isActive()) {
$truename = str_replace(' ', ' ', htmlspecialchars($table));
if (PMA_Tracker::isTracked($db, $truename)) {
- $new_table_string .= '<a href="tbl_tracking.php' . PMA_generate_common_url($tbl_url_params) . '"><img class="icon ic_eye" src="themes/dot.gif" alt="' . __('Tracking is active.') . '" title="' . __('Tracking is active.') . '" /></a>';
+ $new_table_string .= '<a href="tbl_tracking.php' . PMA_generate_common_url($tbl_url_params) . '">';
+ $new_table_string .= PMA_getImage('eye.png', __('Tracking is active.'));
} elseif (PMA_Tracker::getVersion($db, $truename) > 0) {
- $new_table_string .= '<a href="tbl_tracking.php' . PMA_generate_common_url($tbl_url_params) . '"><img class="icon ic_eye_grey" src="themes/dot.gif" alt="' . __('Tracking is not active.') . '" title="' . __('Tracking is not active.') . '" /></a>';
+ $new_table_string .= '<a href="tbl_tracking.php' . PMA_generate_common_url($tbl_url_params) . '">';
+ $new_table_string .= PMA_getImage('eye_grey.png', __('Tracking is not active.'));
}
unset($truename);
}
diff --git a/tbl_structure.php b/tbl_structure.php
index 3a6ae2a..b1e5ac9 100644
--- a/tbl_structure.php
+++ b/tbl_structure.php
@@ -462,7 +462,7 @@ foreach ($fields as $row) {
echo "\n";
?>
<td class="more_opts" id="more_opts<?php echo $rownum; ?>">
- <?php echo __('More'); ?> <img class="icon ic_more" src="themes/dot.gif" alt="<?php echo __('Show more actions'); ?>" />
+ <?php echo PMA_getImage('more.png', __('Show more actions')); ?> <?php echo __('More'); ?>
<div class="structure_actions_dropdown" id="row_<?php echo $rownum; ?>">
<div class="action_browse">
@@ -646,7 +646,7 @@ if (! $tbl_is_view && ! $db_is_information_schema) {
<?php
echo PMA_generate_common_hidden_inputs($db, $table);
if ($cfg['PropertiesIconic']) {
- echo '<img class="icon ic_b_insrow" src="themes/dot.gif" alt="' . __('Add column') . '"/>';
+ echo PMA_getImage('b_insrow.png', __('Add column'));
}
echo sprintf(__('Add %s column(s)'), '<input type="text" name="num_fields" size="2" maxlength="2" value="1" onfocus="this.select()" />');
diff --git a/tbl_tracking.php b/tbl_tracking.php
index 496982a..5099859 100644
--- a/tbl_tracking.php
+++ b/tbl_tracking.php
@@ -420,7 +420,7 @@ if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
// Prepare delete link content here
$drop_image_or_text = '';
if (true == $GLOBALS['cfg']['PropertiesIconic']) {
- $drop_image_or_text .= '<img class="icon ic_b_drop" src="themes/dot.gif" alt="' . __('Delete tracking data row from report') . '" title="' . __('Delete tracking data row from report') . '" />';
+ $drop_image_or_text .= PMA_getImage('b_drop.png', __('Delete tracking data row from report'));
}
if ('both' === $GLOBALS['cfg']['PropertiesIconic'] || false === $GLOBALS['cfg']['PropertiesIconic']) {
$drop_image_or_text .= __('Delete');
diff --git a/test/libraries/common/PMA_buildActionTitles_test.php b/test/libraries/common/PMA_buildActionTitles_test.php
index 97c2be9..88c54f3 100644
--- a/test/libraries/common/PMA_buildActionTitles_test.php
+++ b/test/libraries/common/PMA_buildActionTitles_test.php
@@ -12,12 +12,14 @@
* Include to test.
*/
require_once 'libraries/common.lib.php';
+require_once 'libraries/Theme.class.php';
class PMA_buildActionTitles_test extends PHPUnit_Framework_TestCase
{
function setup()
{
+ $_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
$GLOBALS['cfg'] = array('PropertiesIconic' => 'both');
$GLOBALS['pmaThemeImage'] = 'theme/';
}
diff --git a/test/libraries/common/PMA_getIcon_test.php b/test/libraries/common/PMA_getIcon_test.php
index 883a7b5..5c0f3e2 100644
--- a/test/libraries/common/PMA_getIcon_test.php
+++ b/test/libraries/common/PMA_getIcon_test.php
@@ -12,9 +12,14 @@
* Include to test.
*/
require_once 'libraries/common.lib.php';
+require_once 'libraries/Theme.class.php';
class PMA_getIcon_test extends PHPUnit_Framework_TestCase
{
+ function setup()
+ {
+ $_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
+ }
function testGetIconWithoutPropertiesIconic(){
diff --git a/test/libraries/common/PMA_showDocu_test.php b/test/libraries/common/PMA_showDocu_test.php
index 9941c15..bd5c723 100644
--- a/test/libraries/common/PMA_showDocu_test.php
+++ b/test/libraries/common/PMA_showDocu_test.php
@@ -12,15 +12,23 @@
* Include to test.
*/
require_once 'libraries/common.lib.php';
+require_once 'libraries/Theme.class.php';
class PMA_showDocu_test extends PHPUnit_Framework_TestCase
{
+ function setup()
+ {
+ $_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
+ }
+
function testShowDocuReplaceHelpImg()
{
$GLOBALS['cfg']['ReplaceHelpImg'] = true;
$anchor = "relation";
- $expected = '<a href="Documentation.html#' . $anchor . '" target="documentation"><img class="icon ic_b_help_s" src="themes/dot.gif" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
+ $expected = '<a href="Documentation.html#' . $anchor . '" target="documentation">'
+ . '<img src="themes/dot.gif" title="' . __('Documentation') . '" '
+ . 'alt="' . __('Documentation') . '" class="icon ic_b_help" /></a>';
$this->assertEquals($expected, PMA_showDocu($anchor));
@@ -31,7 +39,9 @@ class PMA_showDocu_test extends PHPUnit_Framework_TestCase
$GLOBALS['cfg']['ReplaceHelpImg'] = false;
$anchor = "relation";
- $expected = '[<a href="Documentation.html#' . $anchor . '" target="documentation">' . __('Documentation') . '</a>]';
+ $expected = '[<a href="Documentation.html#' . $anchor . '" target="documentation">'
+ . __('Documentation')
+ . '</a>]';
$this->assertEquals($expected, PMA_showDocu($anchor));
diff --git a/test/libraries/common/PMA_showPHPDocu_test.php b/test/libraries/common/PMA_showPHPDocu_test.php
index e2364d2..0cd576f 100644
--- a/test/libraries/common/PMA_showPHPDocu_test.php
+++ b/test/libraries/common/PMA_showPHPDocu_test.php
@@ -12,18 +12,24 @@
* Include to test.
*/
require_once 'libraries/common.lib.php';
+require_once 'libraries/Theme.class.php';
class PMA_showPHPDocu_test extends PHPUnit_Framework_TestCase
{
+ function setup()
+ {
+ $_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
+ }
+
function testShwoPHPDocuReplaceHelpImg()
{
$GLOBALS['cfg']['ReplaceHelpImg'] = true;
$target = "docu";
$lang = _pgettext('PHP documentation language', 'en');
- $expected = '<a href="http://php.net/manual/' . $lang . '/' . $target
- . '" target="documentation"><img class="icon ic_b_help_s" src="themes/dot.gif" alt="'
- . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
+ $expected = '<a href="http://php.net/manual/' . $lang . '/' . $target
+ . '" target="documentation"><img src="themes/dot.gif" title="'
+ . __('Documentation') . '" alt="' . __('Documentation') . '" class="icon ic_b_help" /></a>';
$this->assertEquals($expected, PMA_showPHPDocu($target));
}
diff --git a/themes/original/css/theme_left.css.php b/themes/original/css/theme_left.css.php
index fc13337..b8a1409 100644
--- a/themes/original/css/theme_left.css.php
+++ b/themes/original/css/theme_left.css.php
@@ -64,33 +64,6 @@ button {
display: inline;
}
-/* Icon sprites */
-
-.icon {
- /* leave some space between icons and text */
- vertical-align: middle;
- margin-right: 0.3em;
- margin-left: 0.3em;
- width:16px;
- height:16px;
- background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>iconsprites.png) no-repeat top left;
-}
-
-/* 2 px more on the menu icons, for being centered */
-.ic_b_home { background-position: 2px -335px; }
-.ic_b_selboard { background-position: 2px -688px; }
-.ic_b_docs { background-position: 2px -142px; }
-.ic_b_sqlhelp { background-position: 2px -772px; }
-.ic_s_reload { background-position: 2px -1671px; }
-.ic_s_loggoff { background-position: 2px -1604px; }
-
-.ic_b_browse { background-position: 0 -18px; }
-.ic_b_sbrowse { background-position: 0 -660px; width: 10px; height: 10px; }
-.ic_b_view { background-position: 0 -1044px; }
-.ic_b_minus { background-position: 0 -440px; width: 9px; height: 9px; }
-.ic_b_plus { background-position: 0 -523px; width: 9px; height: 9px; }
-.ic_b_snewtbl { background-position: 0 -726px; width: 10px; height: 10px; }
-
/******************************************************************************/
/* classes */
@@ -159,9 +132,9 @@ div#leftframelinks .icon {
}
div#leftframelinks a img.icon {
- margin: 0;
+ margin: 2px;
border: 0.1em solid <?php echo $GLOBALS['cfg']['NaviColor']; ?>;
- padding: 2px;
+ padding: 0;
}
div#leftframelinks a:hover img {
diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php
index 2e4410b..fca6cda 100644
--- a/themes/original/css/theme_right.css.php
+++ b/themes/original/css/theme_right.css.php
@@ -144,146 +144,6 @@ button {
vertical-align: middle;
}
-/* Icon sprites */
-
-.icon, .footnotemarker {
- vertical-align: -3px;
- margin-right: 0.3em;
- margin-left: 0.3em;
- width:16px;
- height:16px;
- background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>iconsprites.png) no-repeat top left;
-}
-
-.ic_b_bookmark { background-position: 0 0; }
-.ic_b_browse { background-position: 0 -18px; }
-.ic_b_calendar { background-position: 0 -36px; }
-.ic_b_chart { background-position: 0 -54px; }
-.ic_b_close { background-position: 0 -72px; }
-.ic_b_comment { background-position: 0 -90px; }
-.ic_b_dbstatistics { background-position: 0 -108px; }
-.ic_b_deltbl { background-position: 0 -126px; }
-.ic_b_docs { background-position: 0 -144px; }
-.ic_b_drop { background-position: 0 -162px; }
-.ic_b_edit { background-position: 0 -180px; }
-.ic_b_empty { background-position: 0 -198px; }
-.ic_b_engine { background-position: 0 -216px; }
-.ic_b_event_add { background-position: 0 -234px; }
-.ic_b_events { background-position: 0 -252px; }
-.ic_b_export { background-position: 0 -270px; }
-.ic_b_ftext { background-position: 0 -288px; }
-.ic_b_globe { background-position: 0 -306px; }
-.ic_b_help { background-position: 0 -324px; width: 11px; height: 11px; }
-.ic_b_home { background-position: 0 -337px; }
-.ic_b_import { background-position: 0 -355px; }
-.ic_b_index { background-position: 0 -373px; }
-.ic_b_info { background-position: 0 -391px; width: 11px; height: 11px; }
-.ic_b_inline_edit { background-position: 0 -404px; }
-.ic_b_insrow { background-position: 0 -422px; }
-.ic_b_minus { background-position: 0 -440px; width: 9px; height: 9px; }
-.ic_b_more { background-position: 0 -451px; }
-.ic_b_newdb { background-position: 0 -469px; }
-.ic_b_newtbl { background-position: 0 -487px; }
-.ic_b_nextpage, .ic_play { background-position: 0 -505px; }
-.ic_b_plus { background-position: 0 -523px; width: 9px; height: 9px; }
-.ic_b_primary { background-position: 0 -534px; }
-.ic_b_print { background-position: 0 -552px; }
-.ic_b_props { background-position: 0 -570px; }
-.ic_b_relations { background-position: 0 -588px; }
-.ic_b_routine_add { background-position: 0 -606px; }
-.ic_b_routines { background-position: 0 -624px; }
-.ic_b_save { background-position: 0 -642px; }
-.ic_b_sbrowse { background-position: 0 -660px; width: 10px; height: 10px; }
-.ic_b_search { background-position: 0 -672px; }
-.ic_b_selboard { background-position: 0 -690px; }
-.ic_b_select { background-position: 0 -708px; }
-.ic_b_snewtbl { background-position: 0 -726px; width: 10px; height: 10px; }
-.ic_b_spatial { background-position: 0 -738px; }
-.ic_b_sql { background-position: 0 -756px; }
-.ic_b_sqlhelp { background-position: 0 -774px; }
-.ic_b_tblanalyse { background-position: 0 -792px; }
-.ic_b_tblexport { background-position: 0 -810px; }
-.ic_b_tblimport { background-position: 0 -828px; }
-.ic_b_tblops { background-position: 0 -846px; }
-.ic_b_tbloptimize { background-position: 0 -864px; }
-.ic_b_tipp { background-position: 0 -882px; }
-.ic_b_trigger_add { background-position: 0 -900px; }
-.ic_b_triggers { background-position: 0 -918px; }
-.ic_b_unique { background-position: 0 -936px; }
-.ic_b_usradd { background-position: 0 -954px; }
-.ic_b_usrcheck { background-position: 0 -972px; }
-.ic_b_usrdrop { background-position: 0 -990px; }
-.ic_b_usredit { background-position: 0 -1008px; }
-.ic_b_usrlist { background-position: 0 -1026px; }
-.ic_b_view { background-position: 0 -1044px; }
-.ic_b_views { background-position: 0 -1062px; }
-.ic_bd_browse { background-position: 0 -1080px; }
-.ic_bd_deltbl { background-position: 0 -1098px; }
-.ic_bd_drop { background-position: 0 -1116px; }
-.ic_bd_edit { background-position: 0 -1134px; }
-.ic_bd_empty { background-position: 0 -1152px; }
-.ic_bd_export { background-position: 0 -1170px; }
-.ic_bd_ftext { background-position: 0 -1188px; }
-.ic_bd_index { background-position: 0 -1206px; }
-.ic_bd_insrow { background-position: 0 -1224px; }
-.ic_bd_nextpage { background-position: 0 -1242px; width: 8px; height: 13px; }
-.ic_bd_primary { background-position: 0 -1257px; }
-.ic_bd_sbrowse { background-position: 0 -1275px; width: 10px; height: 10px; }
-.ic_bd_select { background-position: 0 -1287px; }
-.ic_bd_spatial { background-position: 0 -1305px; }
-.ic_bd_unique { background-position: 0 -1323px; }
-.ic_col_drop { background-position: 0 -1341px; }
-.ic_eye { background-position: 0 -1359px; }
-.ic_eye_grey { background-position: 0 -1377px; }
-.ic_item_ltr { background-position: 0 -1395px; width: 5px; height: 9px; }
-.ic_item_rtl { background-position: 0 -1406px; width: 5px; height: 9px; }
-.ic_more { background-position: 0 -1417px; width: 13px; height: 8px; }
-.ic_pause { background-position: 0 -1427px; }
-.ic_s_asc { background-position: 0 -1445px; width: 11px; height: 9px; }
-.ic_s_asci { background-position: 0 -1456px; }
-.ic_s_cancel { background-position: 0 -1474px; }
-.ic_s_cog { background-position: 0 -1492px; }
-.ic_s_db { background-position: 0 -1510px; }
-.ic_s_desc { background-position: 0 -1528px; width: 11px; height: 9px; }
-.ic_s_error { background-position: 0 -1539px; }
-.ic_s_error2 { background-position: 0 -1557px; width: 11px; height: 11px; }
-.ic_s_host { background-position: 0 -1570px; }
-.ic_s_lang { background-position: 0 -1588px; }
-.ic_s_loggoff { background-position: 0 -1606px; }
-.ic_s_notice { background-position: 0 -1624px; }
-.ic_s_passwd { background-position: 0 -1642px; }
-.ic_s_really { background-position: 0 -1660px; width: 11px; height: 11px; }
-.ic_s_reload { background-position: 0 -1673px; }
-.ic_s_replication { background-position: 0 -1691px; }
-.ic_s_rights { background-position: 0 -1709px; }
-.ic_s_sortable { background-position: 0 -1727px; }
-.ic_s_status { background-position: 0 -1745px; }
-.ic_s_success { background-position: 0 -1763px; }
-.ic_s_sync { background-position: 0 -1781px; }
-.ic_s_tbl { background-position: 0 -1799px; }
-.ic_s_theme { background-position: 0 -1817px; }
-.ic_s_vars { background-position: 0 -1835px; }
-.ic_s_views { background-position: 0 -1853px; width: 10px; height: 10px; }
-.ic_window-new { background-position: 0 -1865px; }
-
-/* Same as s_notice */
-.ic_s_attention { background-position: 0 -1624px; }
-
-/* Same as ic_b_help, but applied to place where width=11, height=11 attributes were used */
-.ic_b_help_s { background-position: -324px 0; width: 11px; height: 11px; }
-
-/* Same as ic_s_sortable */
-img.sortableIcon { background-position: -1727px 0; }
-
-/* Same as s_asc */
-th.headerSortUp img.sortableIcon { background-position: 0 -1528px; width: 11px; height: 9px; }
-
-/* Same as s_desc */
-th.headerSortDown img.sortableIcon { background-position: 0 -1445px; width: 11px; height: 9px; }
-
-/* Fix position */
-.ic_more { vertical-align: middle; }
-
/******************************************************************************/
/* classes */
.clearfloat {
diff --git a/themes/original/img/iconsprites.png b/themes/original/img/iconsprites.png
deleted file mode 100644
index 8ffdff8..0000000
Binary files a/themes/original/img/iconsprites.png and /dev/null differ
diff --git a/themes/original/img/more.png b/themes/original/img/more.png
index e4147fe..32aaf61 100644
Binary files a/themes/original/img/more.png and b/themes/original/img/more.png differ
diff --git a/themes/original/img/sprites.png b/themes/original/img/sprites.png
new file mode 100644
index 0000000..4f85893
Binary files /dev/null and b/themes/original/img/sprites.png differ
diff --git a/themes/original/sprites.lib.php b/themes/original/sprites.lib.php
new file mode 100644
index 0000000..b4b2f39
--- /dev/null
+++ b/themes/original/sprites.lib.php
@@ -0,0 +1,126 @@
+<?php
+/* AUTOGENERATED CONTENT - DO NOT EDIT */
+/* ALL CHANGES WILL BE UNDONE */
+/* RUN './scripts/generate-sprites' TO UPDATE THIS FILE */
+function PMA_sprites() {
+ return array(
+ 'b_bookmark' => array('position' => '1', 'width' => '16', 'height' => '16'),
+ 'b_browse' => array('position' => '2', 'width' => '16', 'height' => '16'),
+ 'b_calendar' => array('position' => '3', 'width' => '16', 'height' => '16'),
+ 'b_chart' => array('position' => '4', 'width' => '16', 'height' => '16'),
+ 'b_close' => array('position' => '5', 'width' => '16', 'height' => '16'),
+ 'b_comment' => array('position' => '6', 'width' => '16', 'height' => '16'),
+ 'bd_browse' => array('position' => '7', 'width' => '16', 'height' => '16'),
+ 'b_dbstatistics' => array('position' => '8', 'width' => '16', 'height' => '16'),
+ 'bd_deltbl' => array('position' => '9', 'width' => '16', 'height' => '16'),
+ 'bd_drop' => array('position' => '10', 'width' => '16', 'height' => '16'),
+ 'bd_edit' => array('position' => '11', 'width' => '16', 'height' => '16'),
+ 'b_deltbl' => array('position' => '12', 'width' => '16', 'height' => '16'),
+ 'bd_empty' => array('position' => '13', 'width' => '16', 'height' => '16'),
+ 'bd_export' => array('position' => '14', 'width' => '16', 'height' => '16'),
+ 'bd_ftext' => array('position' => '15', 'width' => '16', 'height' => '16'),
+ 'bd_index' => array('position' => '16', 'width' => '16', 'height' => '16'),
+ 'bd_insrow' => array('position' => '17', 'width' => '16', 'height' => '16'),
+ 'bd_nextpage' => array('position' => '18', 'width' => '8', 'height' => '13'),
+ 'b_docs' => array('position' => '19', 'width' => '16', 'height' => '16'),
+ 'bd_primary' => array('position' => '20', 'width' => '16', 'height' => '16'),
+ 'b_drop' => array('position' => '21', 'width' => '16', 'height' => '16'),
+ 'bd_sbrowse' => array('position' => '22', 'width' => '10', 'height' => '10'),
+ 'bd_select' => array('position' => '23', 'width' => '16', 'height' => '16'),
+ 'bd_spatial' => array('position' => '24', 'width' => '16', 'height' => '16'),
+ 'bd_unique' => array('position' => '25', 'width' => '16', 'height' => '16'),
+ 'b_edit' => array('position' => '26', 'width' => '16', 'height' => '16'),
+ 'b_empty' => array('position' => '27', 'width' => '16', 'height' => '16'),
+ 'b_engine' => array('position' => '28', 'width' => '16', 'height' => '16'),
+ 'b_event_add' => array('position' => '29', 'width' => '16', 'height' => '16'),
+ 'b_events' => array('position' => '30', 'width' => '16', 'height' => '16'),
+ 'b_export' => array('position' => '31', 'width' => '16', 'height' => '16'),
+ 'b_ftext' => array('position' => '32', 'width' => '16', 'height' => '16'),
+ 'b_help' => array('position' => '33', 'width' => '11', 'height' => '11'),
+ 'b_home' => array('position' => '34', 'width' => '16', 'height' => '16'),
+ 'b_import' => array('position' => '35', 'width' => '16', 'height' => '16'),
+ 'b_index' => array('position' => '36', 'width' => '16', 'height' => '16'),
+ 'b_info' => array('position' => '37', 'width' => '11', 'height' => '11'),
+ 'b_inline_edit' => array('position' => '38', 'width' => '16', 'height' => '16'),
+ 'b_insrow' => array('position' => '39', 'width' => '16', 'height' => '16'),
+ 'b_minus' => array('position' => '40', 'width' => '9', 'height' => '9'),
+ 'b_more' => array('position' => '41', 'width' => '16', 'height' => '16'),
+ 'b_newdb' => array('position' => '42', 'width' => '16', 'height' => '16'),
+ 'b_newtbl' => array('position' => '43', 'width' => '16', 'height' => '16'),
+ 'b_nextpage' => array('position' => '44', 'width' => '16', 'height' => '16'),
+ 'b_plus' => array('position' => '45', 'width' => '9', 'height' => '9'),
+ 'b_primary' => array('position' => '46', 'width' => '16', 'height' => '16'),
+ 'b_print' => array('position' => '47', 'width' => '16', 'height' => '16'),
+ 'b_props' => array('position' => '48', 'width' => '16', 'height' => '16'),
+ 'b_relations' => array('position' => '49', 'width' => '16', 'height' => '16'),
+ 'b_routine_add' => array('position' => '50', 'width' => '16', 'height' => '16'),
+ 'b_routines' => array('position' => '51', 'width' => '16', 'height' => '16'),
+ 'b_save' => array('position' => '52', 'width' => '16', 'height' => '16'),
+ 'b_sbrowse' => array('position' => '53', 'width' => '10', 'height' => '10'),
+ 'b_search' => array('position' => '54', 'width' => '16', 'height' => '16'),
+ 'b_selboard' => array('position' => '55', 'width' => '16', 'height' => '16'),
+ 'b_select' => array('position' => '56', 'width' => '16', 'height' => '16'),
+ 'b_snewtbl' => array('position' => '57', 'width' => '10', 'height' => '10'),
+ 'b_spatial' => array('position' => '58', 'width' => '16', 'height' => '16'),
+ 'b_sqlhelp' => array('position' => '59', 'width' => '16', 'height' => '16'),
+ 'b_sql' => array('position' => '60', 'width' => '16', 'height' => '16'),
+ 'b_tblanalyse' => array('position' => '61', 'width' => '16', 'height' => '16'),
+ 'b_tblexport' => array('position' => '62', 'width' => '16', 'height' => '16'),
+ 'b_tblimport' => array('position' => '63', 'width' => '16', 'height' => '16'),
+ 'b_tblops' => array('position' => '64', 'width' => '16', 'height' => '16'),
+ 'b_tbloptimize' => array('position' => '65', 'width' => '16', 'height' => '16'),
+ 'b_tipp' => array('position' => '66', 'width' => '16', 'height' => '16'),
+ 'b_trigger_add' => array('position' => '67', 'width' => '16', 'height' => '16'),
+ 'b_triggers' => array('position' => '68', 'width' => '16', 'height' => '16'),
+ 'b_unique' => array('position' => '69', 'width' => '16', 'height' => '16'),
+ 'b_usradd' => array('position' => '70', 'width' => '16', 'height' => '16'),
+ 'b_usrcheck' => array('position' => '71', 'width' => '16', 'height' => '16'),
+ 'b_usrdrop' => array('position' => '72', 'width' => '16', 'height' => '16'),
+ 'b_usredit' => array('position' => '73', 'width' => '16', 'height' => '16'),
+ 'b_usrlist' => array('position' => '74', 'width' => '16', 'height' => '16'),
+ 'b_view' => array('position' => '75', 'width' => '16', 'height' => '16'),
+ 'b_views' => array('position' => '76', 'width' => '16', 'height' => '16'),
+ 'col_drop' => array('position' => '77', 'width' => '16', 'height' => '16'),
+ 'docs_menu_bg' => array('position' => '78', 'width' => '2', 'height' => '2'),
+ 'eye_grey' => array('position' => '79', 'width' => '16', 'height' => '16'),
+ 'eye' => array('position' => '80', 'width' => '16', 'height' => '16'),
+ 'item_ltr' => array('position' => '81', 'width' => '5', 'height' => '9'),
+ 'item_rtl' => array('position' => '82', 'width' => '5', 'height' => '9'),
+ 'more' => array('position' => '83', 'width' => '13', 'height' => '16'),
+ 'new_data_hovered' => array('position' => '84', 'width' => '16', 'height' => '16'),
+ 'new_data' => array('position' => '85', 'width' => '16', 'height' => '16'),
+ 'new_data_selected_hovered' => array('position' => '86', 'width' => '16', 'height' => '16'),
+ 'new_data_selected' => array('position' => '87', 'width' => '16', 'height' => '16'),
+ 'new_struct_hovered' => array('position' => '88', 'width' => '16', 'height' => '16'),
+ 'new_struct' => array('position' => '89', 'width' => '16', 'height' => '16'),
+ 'new_struct_selected_hovered' => array('position' => '90', 'width' => '16', 'height' => '16'),
+ 'new_struct_selected' => array('position' => '91', 'width' => '16', 'height' => '16'),
+ 's_asci' => array('position' => '92', 'width' => '16', 'height' => '16'),
+ 's_asc' => array('position' => '93', 'width' => '11', 'height' => '9'),
+ 's_cancel' => array('position' => '94', 'width' => '16', 'height' => '16'),
+ 's_cog' => array('position' => '95', 'width' => '16', 'height' => '16'),
+ 's_db' => array('position' => '96', 'width' => '16', 'height' => '16'),
+ 's_desc' => array('position' => '97', 'width' => '11', 'height' => '9'),
+ 's_error2' => array('position' => '98', 'width' => '11', 'height' => '11'),
+ 's_error' => array('position' => '99', 'width' => '16', 'height' => '16'),
+ 's_host' => array('position' => '100', 'width' => '16', 'height' => '16'),
+ 's_lang' => array('position' => '101', 'width' => '16', 'height' => '16'),
+ 's_loggoff' => array('position' => '102', 'width' => '16', 'height' => '16'),
+ 's_notice' => array('position' => '103', 'width' => '16', 'height' => '16'),
+ 's_passwd' => array('position' => '104', 'width' => '16', 'height' => '16'),
+ 's_really' => array('position' => '105', 'width' => '11', 'height' => '11'),
+ 's_reload' => array('position' => '106', 'width' => '16', 'height' => '16'),
+ 's_replication' => array('position' => '107', 'width' => '16', 'height' => '16'),
+ 's_rights' => array('position' => '108', 'width' => '16', 'height' => '16'),
+ 's_sortable' => array('position' => '109', 'width' => '11', 'height' => '15'),
+ 's_status' => array('position' => '110', 'width' => '16', 'height' => '16'),
+ 's_success' => array('position' => '111', 'width' => '16', 'height' => '16'),
+ 's_sync' => array('position' => '112', 'width' => '16', 'height' => '16'),
+ 's_tbl' => array('position' => '113', 'width' => '16', 'height' => '16'),
+ 's_theme' => array('position' => '114', 'width' => '16', 'height' => '16'),
+ 's_vars' => array('position' => '115', 'width' => '16', 'height' => '16'),
+ 's_views' => array('position' => '116', 'width' => '10', 'height' => '10'),
+ 'window-new' => array('position' => '117', 'width' => '16', 'height' => '16'),
+ );
+}
+?>
diff --git a/themes/pmahomme/css/theme_left.css.php b/themes/pmahomme/css/theme_left.css.php
index 461329d..ce2771b 100644
--- a/themes/pmahomme/css/theme_left.css.php
+++ b/themes/pmahomme/css/theme_left.css.php
@@ -65,32 +65,6 @@ button {
display: inline;
}
-/* Icon sprites */
-
-.icon {
- /* leave some space between icons and text */
- vertical-align: middle;
- margin-right: 0.3em;
- margin-left: 0.3em;
- width:16px;
- height:16px;
- background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>iconsprites.png) no-repeat top left;
-}
-
-.ic_b_home { background-position: -357px 0; }
-.ic_b_selboard { background-position: -754px 0; }
-.ic_b_docs { background-position: -136px 0; }
-.ic_b_sqlhelp { background-position: -856px 0; }
-.ic_s_reload { background-position: -1761px 0; }
-.ic_s_loggoff { background-position: -1698px 0; }
-.ic_b_browse, .ic_b_sbrowse { background-position: -34px 0; }
-.ic_b_view { background-position: -1077px 0; }
-.ic_b_plus { background-position: -573px 0; }
-.ic_b_minus { background-position: -471px 0; }
-
-.ic_b_views, .ic_s_views { background-position: -1094px 0; }
-.ic_b_snewtbl { background-position: -788px 0; }
-
/******************************************************************************/
/* classes */
diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php
index b6c37d3..f29794b 100644
--- a/themes/pmahomme/css/theme_right.css.php
+++ b/themes/pmahomme/css/theme_right.css.php
@@ -294,153 +294,6 @@ select[multiple] {
<?php echo $_SESSION['PMA_Theme']->getCssGradient('ffffff', 'f2f2f2'); ?>
}
-/* Icon sprites */
-
-.icon, .footnotemarker {
- vertical-align: -3px;
- margin-right: 0.3em;
- margin-left: 0.3em;
- width:16px;
- height:16px;
- background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>iconsprites.png) no-repeat top left;
-}
-
-.ic_asc_order, .ic_s_desc { background-position: 0 0; }
-.ic_b_bookmark { background-position: -17px 0; }
-.ic_b_browse, .ic_b_sbrowse { background-position: -34px 0; }
-.ic_b_calendar { background-position: -51px 0; }
-.ic_b_chart, .ic_b_dbstatistics { background-position: -68px 0; }
-.ic_b_close { background-position: -85px 0; }
-.ic_b_comment { background-position: -102px 0; }
-.ic_b_deltbl { background-position: -119px 0; }
-.ic_b_docs { background-position: -136px 0; }
-.ic_b_docsql { background-position: -153px 0; }
-.ic_b_drop { background-position: -170px 0; }
-.ic_b_edit { background-position: -187px 0; }
-.ic_b_empty { background-position: -204px 0; }
-.ic_b_engine { background-position: -221px 0; }
-.ic_b_event_add { background-position: -238px 0; }
-.ic_b_events { background-position: -255px 0; }
-.ic_b_export, .ic_b_tblexport { background-position: -272px 0; }
-.ic_b_firstpage { background-position: -289px 0; }
-.ic_b_ftext { background-position: -306px 0; }
-.ic_b_globe { background-position: -323px 0; }
-.ic_b_help { background-position: -340px 0; }
-.ic_b_help_s { background-position: -340px 0; }
-.ic_b_home { background-position: -357px 0; }
-.ic_b_import, .ic_b_tblimport { background-position: -374px 0; }
-.ic_b_index { background-position: -391px 0; }
-.ic_b_info { background-position: -408px 0; width: 11px; height: 11px; }
-.ic_b_inline_edit { background-position: -420px 0; }
-.ic_b_insrow { background-position: -437px 0; }
-.ic_b_lastpage { background-position: -454px 0; }
-.ic_b_minus { background-position: -471px 0; }
-.ic_b_more, .ic_col_drop { background-position: -488px 0; }
-.ic_b_newdb { background-position: -505px 0; }
-.ic_b_newtbl { background-position: -522px 0; }
-.ic_b_nextpage, .ic_play { background-position: -539px 0; }
-.ic_b_pdfdoc { background-position: -556px 0; }
-.ic_b_plus { background-position: -573px 0; }
-.ic_b_prevpage { background-position: -590px 0; }
-.ic_b_primary { background-position: -607px 0; }
-.ic_b_print { background-position: -624px 0; }
-.ic_b_props { background-position: -641px 0; }
-.ic_b_relations { background-position: -658px 0; }
-.ic_b_routine_add { background-position: -675px 0; }
-.ic_b_routines { background-position: -692px 0; }
-.ic_b_save { background-position: -709px 0; }
-.ic_b_sdb { background-position: -726px 0; width: 10px; height: 10px; }
-.ic_b_search { background-position: -737px 0; }
-.ic_b_selboard { background-position: -754px 0; }
-.ic_b_select { background-position: -771px 0; }
-.ic_b_snewtbl { background-position: -788px 0; }
-.ic_b_spatial { background-position: -805px 0; }
-.ic_b_sql { background-position: -822px 0; }
-.ic_b_sqldoc { background-position: -839px 0; }
-.ic_b_sqlhelp { background-position: -856px 0; }
-.ic_b_tblanalyse { background-position: -873px 0; }
-.ic_b_tblops { background-position: -890px 0; }
-.ic_b_tbloptimize { background-position: -907px 0; }
-.ic_b_tipp { background-position: -924px 0; }
-.ic_b_trigger_add { background-position: -941px 0; }
-.ic_b_triggers { background-position: -958px 0; }
-.ic_b_unique { background-position: -975px 0; }
-.ic_b_usradd { background-position: -992px 0; }
-.ic_b_usrcheck { background-position: -1009px 0; }
-.ic_b_usrdrop { background-position: -1026px 0; }
-.ic_b_usredit { background-position: -1043px 0; }
-.ic_b_usrlist { background-position: -1060px 0; }
-.ic_b_view { background-position: -1077px 0; }
-.ic_b_views, .ic_s_views { background-position: -1094px 0; }
-.ic_bd_browse { background-position: -1111px 0; }
-.ic_bd_deltbl { background-position: -1128px 0; }
-.ic_bd_drop { background-position: -1145px 0; }
-.ic_bd_edit { background-position: -1162px 0; }
-.ic_bd_empty { background-position: -1179px 0; }
-.ic_bd_export { background-position: -1196px 0; }
-.ic_bd_firstpage { background-position: -1213px 0; width: 16px; height: 13px; }
-.ic_bd_ftext { background-position: -1230px 0; }
-.ic_bd_index { background-position: -1247px 0; }
-.ic_bd_insrow { background-position: -1264px 0; }
-.ic_bd_lastpage { background-position: -1281px 0; width: 16px; height: 13px; }
-.ic_bd_nextpage { background-position: -1298px 0; width: 8px; height: 13px; }
-.ic_bd_prevpage { background-position: -1307px 0; width: 8px; height: 13px; }
-.ic_bd_primary { background-position: -1316px 0; }
-.ic_bd_sbrowse { background-position: -1333px 0; width: 10px; height: 10px; }
-.ic_bd_select { background-position: -1344px 0; }
-.ic_bd_spatial { background-position: -1361px 0; }
-.ic_bd_unique { background-position: -1378px 0; }
-.ic_database, .ic_s_db { background-position: -1395px 0; }
-.ic_eye { background-position: -1412px 0; }
-.ic_eye_grey { background-position: -1429px 0; }
-.ic_item { background-position: -1446px 0; width: 9px; height: 9px; }
-.ic_item_ltr { background-position: -1456px 0; width: 5px; height: 9px; }
-.ic_item_rtl { background-position: -1462px 0; width: 5px; height: 9px; }
-.ic_more { background-position: -1468px 0; width: 13px; height: 8px; }
-.ic_pause { background-position: -1482px 0; }
-.ic_php_sym { background-position: -1499px 0; }
-.ic_s_asc { background-position: -1516px 0; }
-.ic_s_asci { background-position: -1533px 0; }
-.ic_s_attention, .ic_s_notice { background-position: -1550px 0; }
-.ic_s_cancel { background-position: -1567px 0; }
-.ic_s_cancel2 { background-position: -1584px 0; }
-.ic_s_cog { background-position: -1601px 0; }
-.ic_s_error { background-position: -1618px 0; }
-.ic_s_error2 { background-position: -1635px 0; width: 11px; height: 11px; }
-.ic_s_host { background-position: -1647px 0; }
-.ic_s_info { background-position: -1664px 0; }
-.ic_s_lang { background-position: -1681px 0; }
-.ic_s_loggoff { background-position: -1698px 0; }
-.ic_s_okay { background-position: -1715px 0; }
-.ic_s_passwd { background-position: -1732px 0; }
-.ic_s_really { background-position: -1749px 0; width: 11px; height: 11px; }
-.ic_s_reload { background-position: -1761px 0; }
-.ic_s_replication { background-position: -1778px 0; }
-.ic_s_rights { background-position: -1795px 0; }
-.ic_s_sortable { background-position: -1812px 0; }
-.ic_s_status { background-position: -1829px 0; }
-.ic_s_success { background-position: -1846px 0; }
-.ic_s_sync { background-position: -1863px 0; }
-.ic_s_tbl { background-position: -1880px 0; }
-.ic_s_theme { background-position: -1897px 0; }
-.ic_s_vars { background-position: -1914px 0; }
-.ic_window-new { background-position: -1931px 0; }
-
-/* Same as ic_b_help, but applied to place where width=11, height=11 attributes were used */
-.ic_b_help_s { background-position: -340px 0; }
-
-/* Same as ic_s_sortable */
-img.sortableIcon { background-position: -1812px 0; }
-
-/* Same as s_asc */
-th.headerSortUp img.sortableIcon { background-position: 0 0; }
-
-/* Same as s_desc */
-th.headerSortDown img.sortableIcon { background-position: -1516px 0; }
-
-/* Fix position */
-.ic_more { vertical-align: middle; }
-
/******************************************************************************/
/* classes */
.clearfloat {
@@ -456,6 +309,11 @@ th.headerSortDown img.sortableIcon { background-position: -1516px 0; }
padding-top: 1em;
}
+.separator {
+ color: white;
+ text-shadow: 0 1px 0 black;
+}
+
div.tools {
/* border: 1px solid #000000; */
padding: 0.2em;
diff --git a/themes/pmahomme/img/iconsprites.png b/themes/pmahomme/img/iconsprites.png
deleted file mode 100644
index 339dd81..0000000
Binary files a/themes/pmahomme/img/iconsprites.png and /dev/null differ
diff --git a/themes/pmahomme/img/more.png b/themes/pmahomme/img/more.png
index e4147fe..32aaf61 100644
Binary files a/themes/pmahomme/img/more.png and b/themes/pmahomme/img/more.png differ
diff --git a/themes/pmahomme/img/sprites.png b/themes/pmahomme/img/sprites.png
new file mode 100644
index 0000000..aa196ce
Binary files /dev/null and b/themes/pmahomme/img/sprites.png differ
diff --git a/themes/pmahomme/sprites.lib.php b/themes/pmahomme/sprites.lib.php
new file mode 100644
index 0000000..30b54ee
--- /dev/null
+++ b/themes/pmahomme/sprites.lib.php
@@ -0,0 +1,147 @@
+<?php
+/* AUTOGENERATED CONTENT - DO NOT EDIT */
+/* ALL CHANGES WILL BE UNDONE */
+/* RUN './scripts/generate-sprites' TO UPDATE THIS FILE */
+function PMA_sprites() {
+ return array(
+ 'asc_order' => array('position' => '1', 'width' => '16', 'height' => '16'),
+ 'b_bookmark' => array('position' => '2', 'width' => '16', 'height' => '16'),
+ 'b_browse' => array('position' => '3', 'width' => '16', 'height' => '16'),
+ 'b_calendar' => array('position' => '4', 'width' => '16', 'height' => '16'),
+ 'b_chart' => array('position' => '5', 'width' => '16', 'height' => '16'),
+ 'b_close' => array('position' => '6', 'width' => '16', 'height' => '16'),
+ 'b_comment' => array('position' => '7', 'width' => '16', 'height' => '16'),
+ 'bd_browse' => array('position' => '8', 'width' => '16', 'height' => '16'),
+ 'b_dbstatistics' => array('position' => '9', 'width' => '16', 'height' => '16'),
+ 'bd_deltbl' => array('position' => '10', 'width' => '16', 'height' => '16'),
+ 'bd_drop' => array('position' => '11', 'width' => '16', 'height' => '16'),
+ 'bd_edit' => array('position' => '12', 'width' => '16', 'height' => '16'),
+ 'b_deltbl' => array('position' => '13', 'width' => '16', 'height' => '16'),
+ 'bd_empty' => array('position' => '14', 'width' => '16', 'height' => '16'),
+ 'bd_export' => array('position' => '15', 'width' => '16', 'height' => '16'),
+ 'bd_firstpage' => array('position' => '16', 'width' => '16', 'height' => '13'),
+ 'bd_ftext' => array('position' => '17', 'width' => '16', 'height' => '16'),
+ 'bd_index' => array('position' => '18', 'width' => '16', 'height' => '16'),
+ 'bd_insrow' => array('position' => '19', 'width' => '16', 'height' => '16'),
+ 'bd_lastpage' => array('position' => '20', 'width' => '16', 'height' => '13'),
+ 'bd_nextpage' => array('position' => '21', 'width' => '8', 'height' => '13'),
+ 'b_docs' => array('position' => '22', 'width' => '16', 'height' => '16'),
+ 'b_docsql' => array('position' => '23', 'width' => '16', 'height' => '16'),
+ 'bd_prevpage' => array('position' => '24', 'width' => '8', 'height' => '13'),
+ 'bd_primary' => array('position' => '25', 'width' => '16', 'height' => '16'),
+ 'b_drop' => array('position' => '26', 'width' => '16', 'height' => '16'),
+ 'bd_sbrowse' => array('position' => '27', 'width' => '10', 'height' => '10'),
+ 'bd_select' => array('position' => '28', 'width' => '16', 'height' => '16'),
+ 'bd_spatial' => array('position' => '29', 'width' => '16', 'height' => '16'),
+ 'bd_unique' => array('position' => '30', 'width' => '16', 'height' => '16'),
+ 'b_edit' => array('position' => '31', 'width' => '16', 'height' => '16'),
+ 'b_empty' => array('position' => '32', 'width' => '16', 'height' => '16'),
+ 'b_engine' => array('position' => '33', 'width' => '16', 'height' => '16'),
+ 'b_event_add' => array('position' => '34', 'width' => '16', 'height' => '16'),
+ 'b_events' => array('position' => '35', 'width' => '16', 'height' => '16'),
+ 'b_export' => array('position' => '36', 'width' => '16', 'height' => '16'),
+ 'b_firstpage' => array('position' => '37', 'width' => '16', 'height' => '16'),
+ 'b_ftext' => array('position' => '38', 'width' => '16', 'height' => '16'),
+ 'b_help' => array('position' => '39', 'width' => '16', 'height' => '16'),
+ 'b_home' => array('position' => '40', 'width' => '16', 'height' => '16'),
+ 'b_import' => array('position' => '41', 'width' => '16', 'height' => '16'),
+ 'b_index' => array('position' => '42', 'width' => '16', 'height' => '16'),
+ 'b_info' => array('position' => '43', 'width' => '11', 'height' => '11'),
+ 'b_inline_edit' => array('position' => '44', 'width' => '16', 'height' => '16'),
+ 'b_insrow' => array('position' => '45', 'width' => '16', 'height' => '16'),
+ 'b_lastpage' => array('position' => '46', 'width' => '16', 'height' => '16'),
+ 'b_minus' => array('position' => '47', 'width' => '16', 'height' => '16'),
+ 'b_more' => array('position' => '48', 'width' => '16', 'height' => '16'),
+ 'b_newdb' => array('position' => '49', 'width' => '16', 'height' => '16'),
+ 'b_newtbl' => array('position' => '50', 'width' => '16', 'height' => '16'),
+ 'b_nextpage' => array('position' => '51', 'width' => '16', 'height' => '16'),
+ 'b_pdfdoc' => array('position' => '52', 'width' => '16', 'height' => '16'),
+ 'b_plus' => array('position' => '53', 'width' => '16', 'height' => '16'),
+ 'b_prevpage' => array('position' => '54', 'width' => '16', 'height' => '16'),
+ 'b_primary' => array('position' => '55', 'width' => '16', 'height' => '16'),
+ 'b_print' => array('position' => '56', 'width' => '16', 'height' => '16'),
+ 'b_props' => array('position' => '57', 'width' => '16', 'height' => '16'),
+ 'b_relations' => array('position' => '58', 'width' => '16', 'height' => '16'),
+ 'b_routine_add' => array('position' => '59', 'width' => '16', 'height' => '16'),
+ 'b_routines' => array('position' => '60', 'width' => '16', 'height' => '16'),
+ 'b_save' => array('position' => '61', 'width' => '16', 'height' => '16'),
+ 'b_sbrowse' => array('position' => '62', 'width' => '16', 'height' => '16'),
+ 'b_sdb' => array('position' => '63', 'width' => '10', 'height' => '10'),
+ 'b_search' => array('position' => '64', 'width' => '16', 'height' => '16'),
+ 'b_selboard' => array('position' => '65', 'width' => '16', 'height' => '16'),
+ 'b_select' => array('position' => '66', 'width' => '16', 'height' => '16'),
+ 'b_snewtbl' => array('position' => '67', 'width' => '16', 'height' => '16'),
+ 'b_spatial' => array('position' => '68', 'width' => '16', 'height' => '16'),
+ 'b_sqldoc' => array('position' => '69', 'width' => '16', 'height' => '16'),
+ 'b_sqlhelp' => array('position' => '70', 'width' => '16', 'height' => '16'),
+ 'b_sql' => array('position' => '71', 'width' => '16', 'height' => '16'),
+ 'b_tblanalyse' => array('position' => '72', 'width' => '16', 'height' => '16'),
+ 'b_tblexport' => array('position' => '73', 'width' => '16', 'height' => '16'),
+ 'b_tblimport' => array('position' => '74', 'width' => '16', 'height' => '16'),
+ 'b_tblops' => array('position' => '75', 'width' => '16', 'height' => '16'),
+ 'b_tbloptimize' => array('position' => '76', 'width' => '16', 'height' => '16'),
+ 'b_tipp' => array('position' => '77', 'width' => '16', 'height' => '16'),
+ 'b_trigger_add' => array('position' => '78', 'width' => '16', 'height' => '16'),
+ 'b_triggers' => array('position' => '79', 'width' => '16', 'height' => '16'),
+ 'b_unique' => array('position' => '80', 'width' => '16', 'height' => '16'),
+ 'b_usradd' => array('position' => '81', 'width' => '16', 'height' => '16'),
+ 'b_usrcheck' => array('position' => '82', 'width' => '16', 'height' => '16'),
+ 'b_usrdrop' => array('position' => '83', 'width' => '16', 'height' => '16'),
+ 'b_usredit' => array('position' => '84', 'width' => '16', 'height' => '16'),
+ 'b_usrlist' => array('position' => '85', 'width' => '16', 'height' => '16'),
+ 'b_view' => array('position' => '86', 'width' => '16', 'height' => '16'),
+ 'b_views' => array('position' => '87', 'width' => '16', 'height' => '16'),
+ 'col_drop' => array('position' => '88', 'width' => '16', 'height' => '16'),
+ 'database' => array('position' => '89', 'width' => '16', 'height' => '16'),
+ 'docs_menu_bg' => array('position' => '90', 'width' => '2', 'height' => '2'),
+ 'eye_grey' => array('position' => '91', 'width' => '16', 'height' => '16'),
+ 'eye' => array('position' => '92', 'width' => '16', 'height' => '16'),
+ 'item_ltr' => array('position' => '93', 'width' => '5', 'height' => '9'),
+ 'item' => array('position' => '94', 'width' => '9', 'height' => '9'),
+ 'item_rtl' => array('position' => '95', 'width' => '5', 'height' => '9'),
+ 'more' => array('position' => '96', 'width' => '13', 'height' => '16'),
+ 'new_data_hovered' => array('position' => '97', 'width' => '16', 'height' => '16'),
+ 'new_data' => array('position' => '98', 'width' => '16', 'height' => '16'),
+ 'new_data_selected_hovered' => array('position' => '99', 'width' => '16', 'height' => '16'),
+ 'new_data_selected' => array('position' => '100', 'width' => '16', 'height' => '16'),
+ 'new_struct_hovered' => array('position' => '101', 'width' => '16', 'height' => '16'),
+ 'new_struct' => array('position' => '102', 'width' => '16', 'height' => '16'),
+ 'new_struct_selected_hovered' => array('position' => '103', 'width' => '16', 'height' => '16'),
+ 'new_struct_selected' => array('position' => '104', 'width' => '16', 'height' => '16'),
+ 'pause' => array('position' => '105', 'width' => '16', 'height' => '16'),
+ 'php_sym' => array('position' => '106', 'width' => '16', 'height' => '16'),
+ 'play' => array('position' => '107', 'width' => '16', 'height' => '16'),
+ 's_asci' => array('position' => '108', 'width' => '16', 'height' => '16'),
+ 's_asc' => array('position' => '109', 'width' => '16', 'height' => '16'),
+ 's_attention' => array('position' => '110', 'width' => '16', 'height' => '16'),
+ 's_cancel2' => array('position' => '111', 'width' => '16', 'height' => '16'),
+ 's_cancel' => array('position' => '112', 'width' => '16', 'height' => '16'),
+ 's_cog' => array('position' => '113', 'width' => '16', 'height' => '16'),
+ 's_db' => array('position' => '114', 'width' => '16', 'height' => '16'),
+ 's_desc' => array('position' => '115', 'width' => '16', 'height' => '16'),
+ 's_error2' => array('position' => '116', 'width' => '11', 'height' => '11'),
+ 's_error' => array('position' => '117', 'width' => '16', 'height' => '16'),
+ 's_host' => array('position' => '118', 'width' => '16', 'height' => '16'),
+ 's_info' => array('position' => '119', 'width' => '16', 'height' => '16'),
+ 's_lang' => array('position' => '120', 'width' => '16', 'height' => '16'),
+ 's_loggoff' => array('position' => '121', 'width' => '16', 'height' => '16'),
+ 's_notice' => array('position' => '122', 'width' => '16', 'height' => '16'),
+ 's_okay' => array('position' => '123', 'width' => '16', 'height' => '16'),
+ 's_passwd' => array('position' => '124', 'width' => '16', 'height' => '16'),
+ 's_process' => array('position' => '125', 'width' => '16', 'height' => '16'),
+ 's_really' => array('position' => '126', 'width' => '11', 'height' => '11'),
+ 's_reload' => array('position' => '127', 'width' => '16', 'height' => '16'),
+ 's_replication' => array('position' => '128', 'width' => '16', 'height' => '16'),
+ 's_rights' => array('position' => '129', 'width' => '16', 'height' => '16'),
+ 's_sortable' => array('position' => '130', 'width' => '16', 'height' => '16'),
+ 's_status' => array('position' => '131', 'width' => '16', 'height' => '16'),
+ 's_success' => array('position' => '132', 'width' => '16', 'height' => '16'),
+ 's_sync' => array('position' => '133', 'width' => '16', 'height' => '16'),
+ 's_tbl' => array('position' => '134', 'width' => '16', 'height' => '16'),
+ 's_theme' => array('position' => '135', 'width' => '16', 'height' => '16'),
+ 's_vars' => array('position' => '136', 'width' => '16', 'height' => '16'),
+ 's_views' => array('position' => '137', 'width' => '16', 'height' => '16'),
+ 'window-new' => array('position' => '138', 'width' => '16', 'height' => '16'),
+ );
+}
+?>
diff --git a/themes/sprites.css.php b/themes/sprites.css.php
new file mode 100644
index 0000000..aa545a3
--- /dev/null
+++ b/themes/sprites.css.php
@@ -0,0 +1,81 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * This file generates the CSS code for the sprites of a theme
+ *
+ * @package phpMyAdmin-theme
+ */
+
+// unplanned execution path
+if (!defined('PMA_MINIMUM_COMMON')) {
+ exit();
+}
+
+$bg = $_SESSION['PMA_Theme']->getImgPath() . 'sprites.png';
+?>
+/* Icon sprites */
+.icon, .footnotemarker {
+ margin: 0 0.3em;
+ padding: 0 !important;
+ width: 16px;
+ height: 16px;
+ background-image: url('<?php echo $bg; ?>') !important;
+ background-repeat: no-repeat !important;
+ background-position: top left !important;
+}
+
+<?php
+ /* Check if there is a valid data file for sprites */
+ if (is_readable($_SESSION['PMA_Theme']->getPath() . '/sprites.lib.php')) {
+ include_once $_SESSION['PMA_Theme']->getPath() . '/sprites.lib.php';
+ $sprites = array();
+ if (function_exists('PMA_sprites')) {
+ $sprites = PMA_sprites();
+ }
+ $template = ".ic_%s { background-position: 0 -%upx !important;%s%s }\n";
+ foreach ($sprites as $name => $data) {
+ // generate the CSS code for each icon
+ $width = '';
+ $height = '';
+ // if either the height or width of an icon is 16px,
+ // then it's pointless to set this as a parameter,
+ //since it will be inherited from the "icon" class
+ if ($data['width'] != 16) {
+ $width = " width: " . $data['width'] . "px;";
+ }
+ if ($data['height'] != 16) {
+ $height = " height: " . $data['height'] . "px;";
+ }
+ printf(
+ $template,
+ $name,
+ ($data['position'] * 16),
+ $width,
+ $height
+ );
+ }
+ // Here we map some of the classes that we
+ // defined above to other CSS selectors.
+ // The indexes of the array correspond to
+ // already defined classes and the values
+ // are the selectors that we want to map to.
+ $elements = array(
+ 's_sortable' => 'img.sortableIcon',
+ 's_asc' => 'th.headerSortUp img.sortableIcon',
+ 's_desc' => 'th.headerSortDown img.sortableIcon'
+ );
+ $template = "%s { background-position: 0 -%upx; "
+ . "height: %upx; width: %upx; }\n";
+ foreach ($elements as $key => $value) {
+ if (isset($sprites[$key])) { // If the CSS class has been defined
+ printf(
+ $template,
+ $value,
+ ($sprites[$key]['position'] * 16),
+ $sprites[$key]['height'],
+ $sprites[$key]['width']
+ );
+ }
+ }
+ }
+?>
hooks/post-receive
--
phpMyAdmin
More information about the Git
mailing list