The branch, master has been updated via 246cf649e472779a8fb8df81710cbd9fb2e2bffc (commit) via cc8a27edce7ae9cc366cfdaee3dc32a26a1c72a9 (commit) via b44abc0f1982be923542c84e1c42afcef4b6e702 (commit) via 7645bc93d1aa43ad4092e332f914b9362ace1f01 (commit) from 5c38a10468a40b9b1de4c7d1f9af6284c8d66478 (commit)
- Log ----------------------------------------------------------------- commit 246cf649e472779a8fb8df81710cbd9fb2e2bffc Author: tyron tyronx@gmail.com Date: Thu May 5 09:44:47 2011 +0200
Correct indent (spaces instead of tabs)
commit cc8a27edce7ae9cc366cfdaee3dc32a26a1c72a9 Merge: 5c38a10468a40b9b1de4c7d1f9af6284c8d66478 b44abc0f1982be923542c84e1c42afcef4b6e702 Author: tyron tyronx@gmail.com Date: Thu May 5 09:39:14 2011 +0200
Merge branch 'master' of ssh://repo.or.cz/srv/git/phpmyadmin/tyronm into tyronm
commit b44abc0f1982be923542c84e1c42afcef4b6e702 Merge: 7645bc93d1aa43ad4092e332f914b9362ace1f01 3256a4407600b6d1cbba29b1cb05ffadb6a1ad67 Author: tyron tyronx@gmail.com Date: Sun May 1 23:48:11 2011 +0200
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 7645bc93d1aa43ad4092e332f914b9362ace1f01 Author: Tyron Madlener tyronx@gmail.com Date: Sat Apr 30 13:36:55 2011 +0200
Adjusted chart code to use colors as defined in each theme's layout.inc.php
-----------------------------------------------------------------------
Summary of changes: libraries/chart/pma_pchart_chart.php | 56 ++++++++++++++------------ libraries/chart/pma_pchart_multi_radar.php | 20 +++++++--- libraries/chart/pma_pchart_pie.php | 21 +++++++--- libraries/chart/pma_pchart_single_radar.php | 21 +++++++--- themes/original/layout.inc.php | 25 ++++++++++++ themes/pmahomme/layout.inc.php | 26 ++++++++++++ 6 files changed, 125 insertions(+), 44 deletions(-)
diff --git a/libraries/chart/pma_pchart_chart.php b/libraries/chart/pma_pchart_chart.php index 1dac4cf..c4277d8 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 e4acae2..c96fb3c 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 cc82df5..0366ba4 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 dbe2b2e..6590582 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/themes/original/layout.inc.php b/themes/original/layout.inc.php index 73bd7b7..f22369e 100644 --- a/themes/original/layout.inc.php +++ b/themes/original/layout.inc.php @@ -110,4 +110,29 @@ $GLOBALS['cfg']['SQP']['fmtColor'] = array( 'quote_single' => '', 'quote_backtick' => '' ); + +/** + * Chart colors + */ + + $GLOBALS['cfg']['chartColor'] = array( + 'gradientIntensity' => 0, + // The style of the chart title. + 'titleColor' => '#000000', + 'titleBgColor' => $GLOBALS['cfg']['ThBackground'], + // Chart border (0 for no border) + 'border' => '#CCCCCC', + // Chart background color. + 'bgColor' => $GLOBALS['cfg']['BgTwo'], + // when graph area gradient is used, this is the color of the graph + // area border + 'graphAreaColor' => '#D5D9DD', + // the background color of the inner graph area + 'graphAreaGradientColor' => $GLOBALS['cfg']['BgOne'], + // the color of the grid lines in the graph area + 'gridColor' => '#E6E6E6', + // the color of the scale and the labels + 'scaleColor' => '#D5D9DD', + ); + ?> diff --git a/themes/pmahomme/layout.inc.php b/themes/pmahomme/layout.inc.php index 3338256..8ff3ebc 100644 --- a/themes/pmahomme/layout.inc.php +++ b/themes/pmahomme/layout.inc.php @@ -112,4 +112,30 @@ $GLOBALS['cfg']['SQP']['fmtColor'] = array( 'quote_single' => '', 'quote_backtick' => '' ); + +/** + * Chart colors + */ + + $GLOBALS['cfg']['chartColor'] = array( + 'gradientIntensity' => 50, + // The style of the chart title. + 'titleColor' => '#000000', + 'titleBgColor' => '#E5E5E5', + // Chart border (0 for no border) + 'border' => '#CCCCCC', + // Chart background color. + 'bgColor' => '#FBFBFB', + // when graph area gradient is used, this is the color of the graph + // area border + 'graphAreaColor' => '#D5D9DD', + // the background color of the graph area + 'graphAreaGradientColor' => $GLOBALS['cfg']['BgTwo'], + // the color of the grid lines in the graph area + 'gridColor' => '#E6E6E6', + // the color of the scale and the labels + 'scaleColor' => '#D5D9DD', + + ); + ?>
hooks/post-receive