Skip to content

Commit

Permalink
PMA Icons to sprites part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tyronx committed Jul 14, 2011
1 parent 7c1bebd commit da943ec
Show file tree
Hide file tree
Showing 133 changed files with 291 additions and 147 deletions.
15 changes: 5 additions & 10 deletions db_operations.php
Expand Up @@ -398,8 +398,7 @@
<legend>
<?php
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'
.' alt="" width="16" height="16" />';
echo '<img class="icon ic_b_edit" src="themes/dot.gif" alt="" />';
}
echo __('Rename database to') . ':';
?>
Expand Down Expand Up @@ -434,8 +433,7 @@
<fieldset class="caution">
<legend><?php
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_deltbl.png"'
.' alt="" width="16" height="16" />';
echo '<img class="icon ic-b_deltbl" src="themes/dot.gif" alt="" />';
}
echo __('Remove database');
?></legend>
Expand Down Expand Up @@ -481,8 +479,7 @@
<legend>
<?php
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'
.' alt="" width="16" height="16" />';
echo '<img class="icon ic-b_edit" src="themes/dot.gif" alt="" />';
}
echo __('Copy database to') . ':';
$drop_clause = 'DROP TABLE / DROP VIEW';
Expand Down Expand Up @@ -546,8 +543,7 @@
. '<fieldset>' . "\n"
. ' <legend>';
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 's_asci.png"'
.' alt="" width="16" height="16" />';
echo '<img class="icon ic_s_asci" src="themes/dot.gif" alt="" />';
}
echo ' <label for="select_db_collation">' . __('Collation') . ':</label>' . "\n"
. ' </legend>' . "\n"
Expand Down Expand Up @@ -594,8 +590,7 @@
*/
echo '<div class="operations_full_width"><fieldset><a href="schema_edit.php?' . $url_query . '">';
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'
.' alt="" width="16" height="16" />';
echo '<img class="icon ic_b_edit" src="themes/dot.gif" alt="" />';
}
echo __('Edit or export relational schema') . '</a></fieldset></div>';
} // end if
Expand Down
12 changes: 5 additions & 7 deletions db_structure.php
Expand Up @@ -283,9 +283,9 @@
$tracking_icon = '';
if (PMA_Tracker::isActive()) {
if (PMA_Tracker::isTracked($GLOBALS["db"], $truename)) {
$tracking_icon = '<a href="tbl_tracking.php?' . $url_query.'&amp;table=' . $truename . '"><img class="icon" width="14" height="14" src="' . $pmaThemeImage . 'eye.png" alt="' . __('Tracking is active.') . '" title="' . __('Tracking is active.') . '" /></a>';
$tracking_icon = '<a href="tbl_tracking.php?' . $url_query.'&amp;table=' . $truename . '"><img class="icon ic_eye" src="themes/dot.gif" alt="' . __('Tracking is active.') . '" title="' . __('Tracking is active.') . '" /></a>';
} elseif (PMA_Tracker::getVersion($GLOBALS["db"], $truename) > 0) {
$tracking_icon = '<a href="tbl_tracking.php?' . $url_query . '&amp;table=' . $truename . '"><img class="icon" width="14" height="14" src="' . $pmaThemeImage . 'eye_grey.png" alt="' . __('Tracking is not active.') . '" title="' . __('Tracking is not active.') . '" /></a>';
$tracking_icon = '<a href="tbl_tracking.php?' . $url_query . '&amp;table=' . $truename . '"><img class="icon ic_eye" src="themes/dot.gif" alt="' . __('Tracking is not active.') . '" title="' . __('Tracking is not active.') . '" /></a>';
}
}

Expand Down Expand Up @@ -340,7 +340,7 @@
<th><?php echo $browse_table_label; ?>
<?php echo (! empty($tracking_icon) ? $tracking_icon : ''); ?>
</th>
<?php if ($server_slave_status) { ?><td align="center"><?php echo $ignored ? ' <img class="icon" src="' . $pmaThemeImage . 's_cancel.png" width="16" height="16" alt="NOT REPLICATED" />' : ''. $do ? ' <img class="icon" src="' . $pmaThemeImage . 's_success.png" width="16" height="16" alt="REPLICATED" />' : ''; ?></td><?php } ?>
<?php if ($server_slave_status) { ?><td align="center"><?php echo $ignored ? ' <img class="icon ic_s_cancel" src="themes/dot.gif" alt="NOT REPLICATED" />' : ''. $do ? ' <img class="icon ic_s_success" src="themes/dot.gif" alt="REPLICATED" />' : ''; ?></td><?php } ?>
<td align="center"><?php echo $browse_table; ?></td>
<td align="center">
<a href="tbl_structure.php?<?php echo $tbl_url_query; ?>">
Expand Down Expand Up @@ -547,15 +547,13 @@
echo '<p>';
echo '<a href="db_printview.php?' . $url_query . '">';
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage
.'b_print.png" width="16" height="16" alt="" />';
echo '<img class="icon ic_b_print" src="themes/dot.gif" alt="" />';
}
echo __('Print view') . '</a> ';

echo '<a href="./db_datadict.php?' . $url_query . '">';
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage
.'b_tblanalyse.png" width="16" height="16" alt="" />';
echo '<img class="icon ic_b_tblanalyse" src="themes/dot.gif" alt="" />';
}
echo __('Data Dictionary') . '</a>';
echo '</p>';
Expand Down
4 changes: 2 additions & 2 deletions db_tracking.php
Expand Up @@ -98,7 +98,7 @@

$drop_image_or_text = '';
if (true == $GLOBALS['cfg']['PropertiesIconic']) {
$drop_image_or_text .= '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'b_drop.png" alt="' . __('Delete tracking data for this table') . '" title="' . __('Delete tracking data for this table') . '" />';
$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') . '" />';
}
if ('both' === $GLOBALS['cfg']['PropertiesIconic'] || false === $GLOBALS['cfg']['PropertiesIconic']) {
$drop_image_or_text .= __('Drop');
Expand Down Expand Up @@ -198,7 +198,7 @@
$my_link = '<a href="tbl_tracking.php?' . $url_query . '&amp;table=' . htmlspecialchars($tablename) .'">';

if ($cfg['PropertiesIconic']) {
$my_link .= '<img class="icon" src="' . $pmaThemeImage . 'eye.png" width="16" height="16" alt="' . __('Track table') . '" /> ';
$my_link .= '<img class="icon ic_eye" src="themes/dot.gif" alt="' . __('Track table') . '" /> ';
}
$my_link .= __('Track table') . '</a>';
?>
Expand Down
11 changes: 6 additions & 5 deletions js/functions.js
Expand Up @@ -135,14 +135,13 @@ function displayPasswordGenerateButton() {
*
* @param object $this_element a jQuery object pointing to the element
*/
function PMA_addDatepicker($this_element) {
function PMA_addDatepicker($this_element, options) {
var showTimeOption = false;
if ($this_element.is('.datetimefield')) {
showTimeOption = true;
}

$this_element
.datepicker({

var defaultOptions = {
showOn: 'button',
buttonImage: themeCalendarImage, // defined in js/messages.php
buttonImageOnly: true,
Expand All @@ -159,7 +158,9 @@ function PMA_addDatepicker($this_element) {
$this_element.data('comes_from', 'datepicker');
},
constrainInput: false
});
};

$this_element.datepicker($.extend(defaultOptions, options));
}

/**
Expand Down
48 changes: 34 additions & 14 deletions js/server_status.js
Expand Up @@ -942,9 +942,9 @@ $(function() {
$('a[href="#pauseCharts"]').click(function() {
runtime.redrawCharts = ! runtime.redrawCharts;
if(! runtime.redrawCharts)
$(this).html('<img src="' + pmaThemeImage + 'play.png" alt="" /> ' + PMA_messages['strResumeMonitor']);
$(this).html('<img src="themes/dot.gif" class="icon ic_play" alt="" /> ' + PMA_messages['strResumeMonitor']);
else {
$(this).html('<img src="' + pmaThemeImage + 'pause.png" alt="" /> ' + PMA_messages['strPauseMonitor']);
$(this).html('<img src="themes/dot.gif" class="icon ic_play" alt="" /> ' + PMA_messages['strPauseMonitor']);
if(runtime.charts == null) {
initGrid();
$('a[href="#settingsPopup"]').show();
Expand All @@ -968,7 +968,7 @@ $(function() {
$.get('server_status.php?' + url_query, vars,
function(data) {
var logVars = $.parseJSON(data),
icon = 's_success.png', msg='', str='';
icon = 'ic_s_success', msg='', str='';

if(logVars['general_log'] == 'ON') {
if(logVars['slow_query_log'] == 'ON')
Expand All @@ -982,26 +982,26 @@ $(function() {
}

if(msg.length == 0) {
icon = 's_error.png';
icon = 'ic_s_success';
msg = PMA_messages['strBothLogOff'];
}

str = '<b>' + PMA_messages['strCurrentSettings'] + '</b><br><div class="smallIndent">';
str += '<img src="' + pmaThemeImage + icon + '" alt=""/> ' + msg + '<br />';
str += '<img src="themes/dot.gif" class="icon ' + icon + '" alt=""/> ' + msg + '<br />';

if(logVars['log_output'] != 'TABLE')
str += '<img src="' + pmaThemeImage + 's_error.png" alt=""/> ' + PMA_messages['strLogOutNotTable'] + '<br />';
str += '<img src="themes/dot.gif" class="icon ic_s_error" alt=""/> ' + PMA_messages['strLogOutNotTable'] + '<br />';
else
str += '<img src="' + pmaThemeImage + 's_success.png" alt=""/> ' + PMA_messages['strLogOutIsTable'] + '<br />';
str += '<img src="themes/dot.gif" class="icon ic_s_success" alt=""/> ' + PMA_messages['strLogOutIsTable'] + '<br />';

if(logVars['slow_query_log'] == 'ON') {
if(logVars['long_query_time'] > 2)
str += '<img src="' + pmaThemeImage + 's_attention.png" alt=""/> '
str += '<img src="themes/dot.gif" class="icon ic_s_attention" alt=""/> '
+ $.sprintf(PMA_messages['strSmallerLongQueryTimeAdvice'], logVars['long_query_time'])
+ '<br />';

if(logVars['long_query_time'] < 2)
str += '<img src="' + pmaThemeImage + 's_success.png" alt=""/> '
str += '<img src="themes/dot.gif" class="icon ic_s_success" alt=""/> '
+ $.sprintf(PMA_messages['strLongQueryTimeSet'], logVars['long_query_time'])
+ '<br />';
}
Expand Down Expand Up @@ -1261,27 +1261,47 @@ $(function() {

$('#logAnalyseDialog').html(
'<p>' + PMA_messages['strSelectedTimeRange']
+ Highcharts.dateFormat('%H:%M:%S',new Date(min)) + ' - '
+ Highcharts.dateFormat('%H:%M:%S',new Date(max)) + '</p>'
+ '<input type="text" name="dateStart" class="datetimefield" value="' + Highcharts.dateFormat('%Y-%m-%d %H:%M:%S',new Date(min)) + '" /> - '
+ '<input type="text" name="dateEnd" class="datetimefield" value="' + Highcharts.dateFormat('%Y-%m-%d %H:%M:%S',new Date(max)) + '" /></p>'
+ '<input type="checkbox" id="groupInserts" value="1" checked="checked" />'
+ '<label for="groupData">' + PMA_messages['strGroupInserts'] + '</label>'
+ PMA_messages['strLogAnalyseInfo']
);

PMA_addDatepicker($('#logAnalyseDialog').find('input[name="dateStart"],input[name="dateEnd"]'), {
showOn: 'focus',
beforeShow: function() {
// Fix wrong timepicker z-index, doesn't work without timeout
setTimeout(function() {
$('#ui-timepicker-div').css('z-index',$('#ui-datepicker-div').css('z-index'))
},0);
}
});

var dlgBtns = { };

dlgBtns[PMA_messages['strFromSlowLog']] = function() {
var dateStart = Date.parse($('#logAnalyseDialog input[name="dateStart"]').attr('value')) || min;
var dateEnd = Date.parse($('#logAnalyseDialog input[name="dateEnd"]').attr('value')) || max;

loadLogStatistics(
{ src: 'slow', start: min, end: max, groupInserts: $('input#groupInserts').attr('checked') }
{ src: 'slow', start: dateStart, end: dateEnd, groupInserts: $('input#groupInserts').attr('checked') }
);

$('#logAnalyseDialog').find('dateStart,dateEnd').datepicker('destroy');

$(this).dialog("close");
}

dlgBtns[PMA_messages['strFromGeneralLog']] = function() {
var dateStart = Date.parse($('#logAnalyseDialog input[name="dateStart"]').attr('value')) || min;
var dateEnd = Date.parse($('#logAnalyseDialog input[name="dateEnd"]').attr('value')) || max;

loadLogStatistics(
{ src: 'general', start: min, end: max, groupInserts: $('input#groupInserts').attr('checked') }
{ src: 'general', start: dateStart, end: dateEnd, groupInserts: $('input#groupInserts').attr('checked') }
);

$('#logAnalyseDialog').find('dateStart,dateEnd').datepicker('destroy');

$(this).dialog("close");
}
Expand Down Expand Up @@ -1515,7 +1535,7 @@ $(function() {

// Append a tooltip to the count column, if there exist one
if($('#logTable th:last').html() == '#') {
$('#logTable th:last').append('&nbsp;<img class="qroupedQueryInfoIcon" src="' + pmaThemeImage + 'b_docs.png" alt="" />');
$('#logTable th:last').append('&nbsp;<img class="qroupedQueryInfoIcon icon ic_b_docs" src="themes/dot.gif" alt="" />');

var qtipContent = PMA_messages['strCountColumnExplanation'];
if(groupInserts) qtipContent += '<p>' + PMA_messages['strMoreCountColumnExplanation'] + '</p>';
Expand Down
2 changes: 1 addition & 1 deletion libraries/auth/cookie.auth.lib.php
Expand Up @@ -198,7 +198,7 @@ function PMA_auth()
echo '<a href="./Documentation.html" target="documentation" ' .
'title="' . __('phpMyAdmin documentation') . '">';
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
echo '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_help.png" width="11" height="11" alt="' . __('phpMyAdmin documentation') . '" />';
echo '<img class="icon ic_b_help_s" src="themes/dot.gif" alt="' . __('phpMyAdmin documentation') . '" />';
} else {
echo '(*)';
}
Expand Down
19 changes: 9 additions & 10 deletions libraries/common.lib.php
Expand Up @@ -97,9 +97,9 @@ function PMA_getIcon($icon, $alternate = '', $container = false, $force_text = f
$button .= '<span class="nowrap">';

if ($include_icon) {
$button .= '<img src="' . $GLOBALS['pmaThemeImage'] . $icon . '"'
$button .= '<img src="themes/dot.gif"'
. ' title="' . $alternate . '" alt="' . $alternate . '"'
. ' class="icon" width="16" height="16" />';
. ' class="icon ic_' . str_replace('.png','',$icon) . '" />';
}

if ($include_icon && $include_text) {
Expand Down Expand Up @@ -393,9 +393,9 @@ function PMA_showMySQLDocu($chapter, $link, $big_icon = false, $anchor = '', $ju
if ($just_open) {
return '<a href="' . PMA_linkURL($url) . '" target="mysql_doc">';
} elseif ($big_icon) {
return '<a href="' . PMA_linkURL($url) . '" target="mysql_doc"><img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_sqlhelp.png" width="16" height="16" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
return '<a href="' . PMA_linkURL($url) . '" target="mysql_doc"><img class="icon ic_b_sqlhelp" src="themes/dot.gif" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
} elseif ($GLOBALS['cfg']['ReplaceHelpImg']) {
return '<a href="' . PMA_linkURL($url) . '" target="mysql_doc"><img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_help.png" width="11" height="11" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
return '<a href="' . PMA_linkURL($url) . '" target="mysql_doc"><img class="icon ic_b_help_s" src="themes/dot.gif" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
} else {
return '[<a href="' . PMA_linkURL($url) . '" target="mysql_doc">' . __('Documentation') . '</a>]';
}
Expand All @@ -412,7 +412,7 @@ function PMA_showMySQLDocu($chapter, $link, $big_icon = false, $anchor = '', $ju
*/
function PMA_showDocu($anchor) {
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
return '<a href="Documentation.html#' . $anchor . '" target="documentation"><img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_help.png" width="11" height="11" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
return '<a href="Documentation.html#' . $anchor . '" target="documentation"><img class="icon ic_b_help_s" src="themes/dot.gif" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
} else {
return '[<a href="Documentation.html#' . $anchor . '" target="documentation">' . __('Documentation') . '</a>]';
}
Expand All @@ -430,7 +430,7 @@ function PMA_showPHPDocu($target) {
$url = PMA_getPHPDocLink($target);

if ($GLOBALS['cfg']['ReplaceHelpImg']) {
return '<a href="' . $url . '" target="documentation"><img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_help.png" width="11" height="11" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
return '<a href="' . $url . '" target="documentation"><img class="icon ic_b_help_s" src="themes/dot.gif" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
} else {
return '[<a href="' . $url . '" target="documentation">' . __('Documentation') . '</a>]';
}
Expand Down Expand Up @@ -479,8 +479,7 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice')

// footnotemarker used in js/tooltip.js
return '<sup class="footnotemarker">' . $nr . '</sup>' .
'<img class="footnotemarker" id="footnote_' . $nr . '_' . $instance . '" src="' .
$GLOBALS['pmaThemeImage'] . 'b_help.png" alt="" />';
'<img class="footnotemarker ic_b_help" id="footnote_' . $nr . '_' . $instance . '" src="themes/dot.gif" alt="" />';
}

/**
Expand Down Expand Up @@ -1581,8 +1580,8 @@ function PMA_generate_html_tab($tab, $url_params = array())
// 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" src="' . htmlentities($GLOBALS['pmaThemeImage'])
.'%1$s" width="16" height="16" alt="" />%2$s';
$image = '<img class="icon %1$s" src="themes/dot.gif"'
.' width="16" height="16" alt="" />%2$s';
$tab['text'] = sprintf($image, htmlentities($tab['icon']), $tab['text']);
}
// check to not display an empty link-text
Expand Down

0 comments on commit da943ec

Please sign in to comment.