diff --git a/js/functions.js b/js/functions.js index d808a0cea..52c3c287f 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1118,25 +1118,32 @@ function changeMIMEType(db, table, reference, mime_type) * Jquery Coding for inline editing SQL_QUERY */ $(document).ready(function(){ - var oldText,db,table,token,sql_query; - oldText=$(".inner_sql").html(); - $("#inline_edit").live('click',function(){ - db=$("input[name='db']").val(); - table=$("input[name='table']").val(); - token=$("input[name='token']").val(); - sql_query=$("input[name='sql_query']").val(); - $(".inner_sql").replaceWith(""); + $(".inline_edit").click( function(){ + var db = $(this).prev().find("input[name='db']").val(); + var table = $(this).prev().find("input[name='table']").val(); + var token = $(this).prev().find("input[name='token']").val(); + var sql_query = $(this).prev().find("input[name='sql_query']").val(); + var $inner_sql = $(this).parent().prev().find('.inner_sql'); + var old_text = $inner_sql.html(); + + var new_content = "\n"; + new_content += "\n"; + new_content += "\n"; + $inner_sql.replaceWith(new_content); + $(".btnSave").each(function(){ + $(this).click(function(){ + sql_query = $(this).prev().val(); + window.location.replace("import.php?db=" + db +"&table=" + table + "&sql_query=" + sql_query + "&show_query=1&token=" + token); + }); + }); + $(".btnDiscard").each(function(){ + $(this).click(function(){ + $(this).closest(".sql").html("" + old_text + ""); + }); + }); return false; }); - $("#btnSave").live("click",function(){ - window.location.replace("import.php?db=" + db +"&table=" + table + "&sql_query=" + $("#sql_query_edit").val()+"&show_query=1&token=" + token + ""); - }); - - $("#btnDiscard").live("click",function(){ - $(".sql").html("" + oldText + ""); - }); - $('.sqlbutton').click(function(evt){ insertQuery(evt.target.id); return false; diff --git a/libraries/chart/pma_pchart_chart.php b/libraries/chart/pma_pchart_chart.php index 1dac4cfb2..c4277d804 100644 --- a/libraries/chart/pma_pchart_chart.php +++ b/libraries/chart/pma_pchart_chart.php @@ -69,21 +69,9 @@ abstract class PMA_pChart_chart extends PMA_chart // as in CSS (top, right, bottom, left) $this->setAreaMargins(array(20, 20, 40, 60)); - - // when graph area gradient is used, this is the color of the graph - // area border - $this->settings['graphAreaColor'] = '#D5D9DD'; - - // the background color of the graph area - $this->settings['graphAreaGradientColor'] = '#A3CBA7'; - - // the color of the grid lines in the graph area - $this->settings['gridColor'] = '#E6E6E6'; - - // the color of the scale and the labels - $this->settings['scaleColor'] = '#D5D9DD'; - - $this->settings['titleBgColor'] = '#000000'; + + // Get color settings from theme + $this->settings = array_merge($this->settings,$GLOBALS['cfg']['chartColor']); } protected function init() @@ -149,8 +137,11 @@ abstract class PMA_pChart_chart extends PMA_chart $this->getBgColor(RED), $this->getBgColor(GREEN), $this->getBgColor(BLUE), - 50,TARGET_BACKGROUND); - $this->chart->addBorder(2); + // With a gradientIntensity of 0 the background does't draw, oddly + ($this->settings['gradientIntensity']==0)?1:$this->settings['gradientIntensity'],TARGET_BACKGROUND); + + if(is_string($this->settings['border'])) + $this->chart->addBorder(1,$this->getBorderColor(RED),$this->getBorderColor(GREEN),$this->getBorderColor(BLUE)); } /** @@ -170,11 +161,10 @@ abstract class PMA_pChart_chart extends PMA_chart $this->getTitleColor(GREEN), $this->getTitleColor(BLUE), ALIGN_CENTER, - True, + false, $this->getTitleBgColor(RED), $this->getTitleBgColor(GREEN), - $this->getTitleBgColor(BLUE), - 30 + $this->getTitleBgColor(BLUE) ); } @@ -211,12 +201,21 @@ abstract class PMA_pChart_chart extends PMA_chart $this->getScaleColor(BLUE), TRUE,0,2,TRUE ); - $this->chart->drawGraphAreaGradient( - $this->getGraphAreaGradientColor(RED), - $this->getGraphAreaGradientColor(GREEN), - $this->getGraphAreaGradientColor(BLUE), - 50 - ); + + if($this->settings['gradientIntensity']>0) + $this->chart->drawGraphAreaGradient( + $this->getGraphAreaGradientColor(RED), + $this->getGraphAreaGradientColor(GREEN), + $this->getGraphAreaGradientColor(BLUE), + $this->settings['gradientIntensity'] + ); + else + $this->chart->drawGraphArea( + $this->getGraphAreaGradientColor(RED), + $this->getGraphAreaGradientColor(GREEN), + $this->getGraphAreaGradientColor(BLUE) + ); + $this->chart->drawGrid( 4, TRUE, @@ -393,6 +392,11 @@ abstract class PMA_pChart_chart extends PMA_chart { return $this->hexStrToDecComp($this->settings['titleBgColor'], $component); } + + protected function getBorderColor($component) + { + return $this->hexStrToDecComp($this->settings['border'], $component); + } } ?> diff --git a/libraries/chart/pma_pchart_multi_radar.php b/libraries/chart/pma_pchart_multi_radar.php index e4acae2f7..c96fb3cc4 100644 --- a/libraries/chart/pma_pchart_multi_radar.php +++ b/libraries/chart/pma_pchart_multi_radar.php @@ -57,12 +57,20 @@ class PMA_pChart_multi_radar extends PMA_pChart_multi $this->getGraphAreaColor(BLUE), FALSE ); - $this->chart->drawGraphAreaGradient( - $this->getGraphAreaGradientColor(RED), - $this->getGraphAreaGradientColor(GREEN), - $this->getGraphAreaGradientColor(BLUE), - 50 - ); + + if($this->settings['gradientIntensity']>0) + $this->chart->drawGraphAreaGradient( + $this->getGraphAreaGradientColor(RED), + $this->getGraphAreaGradientColor(GREEN), + $this->getGraphAreaGradientColor(BLUE), + $this->settings['gradientIntensity'] + ); + else + $this->chart->drawGraphArea( + $this->getGraphAreaGradientColor(RED), + $this->getGraphAreaGradientColor(GREEN), + $this->getGraphAreaGradientColor(BLUE) + ); } /** diff --git a/libraries/chart/pma_pchart_pie.php b/libraries/chart/pma_pchart_pie.php index cc82df5c5..0366ba48b 100644 --- a/libraries/chart/pma_pchart_pie.php +++ b/libraries/chart/pma_pchart_pie.php @@ -47,12 +47,21 @@ class PMA_pChart_Pie extends PMA_pChart_multi $this->getGraphAreaColor(BLUE), FALSE ); - $this->chart->drawGraphAreaGradient( - $this->getGraphAreaGradientColor(RED), - $this->getGraphAreaGradientColor(GREEN), - $this->getGraphAreaGradientColor(BLUE), - 50 - ); + + if($this->settings['gradientIntensity']>0) + $this->chart->drawGraphAreaGradient( + $this->getGraphAreaGradientColor(RED), + $this->getGraphAreaGradientColor(GREEN), + $this->getGraphAreaGradientColor(BLUE), + $this->settings['gradientIntensity'] + ); + else + $this->chart->drawGraphArea( + $this->getGraphAreaGradientColor(RED), + $this->getGraphAreaGradientColor(GREEN), + $this->getGraphAreaGradientColor(BLUE) + ); + } /** diff --git a/libraries/chart/pma_pchart_single_radar.php b/libraries/chart/pma_pchart_single_radar.php index dbe2b2e18..659058217 100644 --- a/libraries/chart/pma_pchart_single_radar.php +++ b/libraries/chart/pma_pchart_single_radar.php @@ -48,12 +48,21 @@ class PMA_pChart_single_radar extends PMA_pChart_single $this->getGraphAreaColor(BLUE), FALSE ); - $this->chart->drawGraphAreaGradient( - $this->getGraphAreaGradientColor(RED), - $this->getGraphAreaGradientColor(GREEN), - $this->getGraphAreaGradientColor(BLUE), - 50 - ); + + if($this->settings['gradientIntensity']>0) + $this->chart->drawGraphAreaGradient( + $this->getGraphAreaGradientColor(RED), + $this->getGraphAreaGradientColor(GREEN), + $this->getGraphAreaGradientColor(BLUE), + $this->settings['gradientIntensity'] + ); + else + $this->chart->drawGraphArea( + $this->getGraphAreaGradientColor(RED), + $this->getGraphAreaGradientColor(GREEN), + $this->getGraphAreaGradientColor(BLUE) + ); + } /** diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 49694635b..56618a180 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1261,9 +1261,9 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view // document.write conflicts with jQuery, hence used $().append() echo "