' . htmlspecialchars($group) . '' . "\n";
// whether display db_name cut by the group part
$cut = true;
} else {
@@ -498,7 +498,7 @@ require_once './libraries/List.class.php';
if (isset($tmp_mydbs[$tmp_db]) && $tmp_mydbs[$tmp_db] == 1) {
$dblist[] = $tmp_db;
$tmp_mydbs[$tmp_db] = 0;
- } elseif (!isset($dblist[$tmp_db])) {
+ } elseif (! isset($dblist[$tmp_db])) {
foreach ($tmp_mydbs as $tmp_matchpattern => $tmp_value) {
// fixed bad regexp
// TODO: db names may contain characters
diff --git a/libraries/Message.class.php b/libraries/Message.class.php
index 908a1d714d..3b0d0c51ca 100644
--- a/libraries/Message.class.php
+++ b/libraries/Message.class.php
@@ -19,9 +19,6 @@
*
* // get special notice 'Some locale notice'
* $message = PMA_Message::notice('strSomeLocaleNotice');
- *
- * // display raw warning message 'This is a warning!'
- * PMA_Message::rawWarning('This is a warning!')->display();
*
*
* more advanced usage example:
@@ -63,7 +60,6 @@ class PMA_Message
{
const SUCCESS = 1; // 0001
const NOTICE = 2; // 0010
- const WARNING = 4; // 0100
const ERROR = 8; // 1000
const SANITIZE_NONE = 0; // 0000 0000
@@ -79,7 +75,6 @@ class PMA_Message
static public $level = array (
PMA_Message::SUCCESS => 'success',
PMA_Message::NOTICE => 'notice',
- PMA_Message::WARNING => 'warning',
PMA_Message::ERROR => 'error',
);
@@ -151,8 +146,8 @@ class PMA_Message
* @uses PMA_Message::SANITIZE_PARAMS
* @param string $string
* @param integer $number
- * @param array $$params
- * @param boolean $sanitize
+ * @param array $params
+ * @param integer $sanitize
*/
public function __construct($string = '', $number = PMA_Message::NOTICE,
$params = array(), $sanitize = PMA_Message::SANITIZE_NONE)
@@ -213,22 +208,6 @@ class PMA_Message
return new PMA_Message($string, PMA_Message::ERROR);
}
- /**
- * get PMA_Message of type warning
- *
- * shorthand for getting a simple warning message
- *
- * @static
- * @uses PMA_Message as returned object
- * @uses PMA_Message::WARNING
- * @param string $string a localized string e.g. 'strSetupWarning'
- * @return PMA_Message
- */
- static public function warning($string)
- {
- return new PMA_Message($string, PMA_Message::WARNING);
- }
-
/**
* get PMA_Message of type notice
*
@@ -337,22 +316,6 @@ class PMA_Message
return PMA_Message::raw($message, PMA_Message::ERROR);
}
- /**
- * get PMA_Message of type warning with custom content
- *
- * shorthand for getting a customized warning message
- *
- * @static
- * @uses PMA_Message::raw()
- * @uses PMA_Message::WARNING
- * @param string $message
- * @return PMA_Message
- */
- static public function rawWarning($message)
- {
- return PMA_Message::raw($message, PMA_Message::WARNING);
- }
-
/**
* get PMA_Message of type notice with custom content
*
@@ -423,25 +386,6 @@ class PMA_Message
return $this->getNumber() === PMA_Message::NOTICE;
}
- /**
- * returns whether this message is a warning message or not
- * and optionally makes this message a warning message
- *
- * @uses PMA_Message::WARNING
- * @uses PMA_Message::setNumber()
- * @uses PMA_Message::getNumber()
- * @param boolean $set
- * @return boolean whether this is a warning message or not
- */
- public function isWarning($set = false)
- {
- if ($set) {
- $this->setNumber(PMA_Message::WARNING);
- }
-
- return $this->getNumber() === PMA_Message::WARNING;
- }
-
/**
* returns whether this message is an error message or not
* and optionally makes this message an error message
@@ -624,9 +568,9 @@ class PMA_Message
* @static
* @uses is_array()
* @uses htmlspecialchars()
- * @uses PMA_Message::sanitize() recursiv
- * @param mixed the message(s)
- * @return mixed the sanitized message(s)
+ * @uses PMA_Message::sanitize() recursive
+ * @param mixed $message the message(s)
+ * @return mixed the sanitized message(s)
* @access public
*/
static public function sanitize($message)
@@ -686,7 +630,6 @@ class PMA_Message
* @uses PMA_Message::$_string
* @uses PMA_Message::$_message
* @uses md5()
- * @param string $file
* @return string PMA_Message::$_hash
*/
public function getHash()
diff --git a/libraries/Table.class.php b/libraries/Table.class.php
index a29900e7b5..d41eadc8d9 100644
--- a/libraries/Table.class.php
+++ b/libraries/Table.class.php
@@ -889,7 +889,7 @@ class PMA_Table
} else {
// we are copying
// Create new entries as duplicates from old PMA DBs
- if ($what != 'dataonly' && !isset($maintain_relations)) {
+ if ($what != 'dataonly' && ! isset($maintain_relations)) {
if ($GLOBALS['cfgRelation']['commwork']) {
// Get all comments and MIME-Types for current table
$comments_copy_query = 'SELECT
diff --git a/libraries/chart.lib.php b/libraries/chart.lib.php
index 3911f2e95b..83791fb425 100644
--- a/libraries/chart.lib.php
+++ b/libraries/chart.lib.php
@@ -104,7 +104,7 @@ function PMA_chart_results($data, &$chartSettings)
// default for muti series
$chartSettings['multi'] = false;
- if (!isset($data[0])) {
+ if (! isset($data[0])) {
// empty data
return __('No data found for the chart.');
}
@@ -192,7 +192,7 @@ function PMA_chart_results($data, &$chartSettings)
// the value os for this serie
$chartData[$yAxisKey][$seriesLabelsValue][$row[$xAxisKey]] = (int)$row[$yAxisKey];
}
- else if (!isset($chartData[$yAxisKey][$seriesLabelsValue][$row[$xAxisKey]])) {
+ else if (! isset($chartData[$yAxisKey][$seriesLabelsValue][$row[$xAxisKey]])) {
// if the value for this serie is not set, set it to 0
$chartData[$yAxisKey][$seriesLabelsValue][$row[$xAxisKey]] = 0;
}
diff --git a/libraries/chart/pma_pchart_chart.php b/libraries/chart/pma_pchart_chart.php
index 1dac4cfb2e..c4277d8046 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 e4acae2f7b..c96fb3cc49 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 cc82df5c57..0366ba48ba 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 dbe2b2e18f..659058217e 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.inc.php b/libraries/common.inc.php
index 906b6f6e17..ef6f64b6c9 100644
--- a/libraries/common.inc.php
+++ b/libraries/common.inc.php
@@ -608,7 +608,7 @@ $GLOBALS['server'] = 0;
* @todo merge into PMA_Config
*/
// Do we have some server?
-if (!isset($cfg['Servers']) || count($cfg['Servers']) == 0) {
+if (! isset($cfg['Servers']) || count($cfg['Servers']) == 0) {
// No server => create one with defaults
$cfg['Servers'] = array(1 => $default_server);
} else {
@@ -664,7 +664,7 @@ if (! isset($_SESSION['PMA_Theme_Manager'])) {
}
// for the theme per server feature
-if (isset($_REQUEST['server']) && !isset($_REQUEST['set_theme'])) {
+if (isset($_REQUEST['server']) && ! isset($_REQUEST['set_theme'])) {
$GLOBALS['server'] = $_REQUEST['server'];
$tmp = $_SESSION['PMA_Theme_Manager']->getThemeCookie();
if (empty($tmp)) {
@@ -838,7 +838,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
// http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/aaa/mod_access.c?rev=1.37&content-type=text/vnd.viewcvs-markup
// Look at: "static int check_dir_access(request_rec *r)"
if (isset($cfg['Server']['AllowDeny'])
- && isset($cfg['Server']['AllowDeny']['order'])) {
+ && isset($cfg['Server']['AllowDeny']['order'])) {
/**
* ip based access library
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 8be5c0e7e4..e8e6b8a9d0 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -301,7 +301,7 @@ function PMA_formatSql($parsed_sql, $unparsed_sql = '')
return htmlspecialchars($parsed_sql['raw']);
}
// then check for an array
- if (!is_array($parsed_sql)) {
+ if (! is_array($parsed_sql)) {
// We don't so just return the input directly
// This is intended to be used for when the SQL Parser is turned off
$formatted_sql = '
' . "\n"
@@ -663,7 +663,7 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
if ($exit) {
/**
* If in an Ajax request
- * - avoid displaying a Back link
+ * - avoid displaying a Back link
* - use PMA_ajaxResponse() to transmit the message and exit
*/
if($GLOBALS['is_ajax_request'] == true) {
@@ -706,11 +706,11 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
* @uses uksort()
* @uses strstr()
* @uses explode()
- * @param string $db name of db
- * @param string $tables name of tables
- * @param integer $limit_offset list offset
- * @param integer $limit_count max tables to return
- * return array (recursive) grouped table list
+ * @param string $db name of db
+ * @param string $tables name of tables
+ * @param integer $limit_offset list offset
+ * @param int|bool $limit_count max tables to return
+ * @return array (recursive) grouped table list
*/
function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count = false)
{
@@ -781,12 +781,12 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
$group_name = $parts[$i] . $sep;
$group_name_full .= $group_name;
- if (!isset($group[$group_name])) {
+ if (! isset($group[$group_name])) {
$group[$group_name] = array();
$group[$group_name]['is' . $sep . 'group'] = true;
$group[$group_name]['tab' . $sep . 'count'] = 1;
$group[$group_name]['tab' . $sep . 'group'] = $group_name_full;
- } elseif (!isset($group[$group_name]['is' . $sep . 'group'])) {
+ } elseif (! isset($group[$group_name]['is' . $sep . 'group'])) {
$table = $group[$group_name];
$group[$group_name] = array();
$group[$group_name][$group_name] = $table;
@@ -801,7 +801,7 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
$i++;
}
} else {
- if (!isset($table_groups[$table_name])) {
+ if (! isset($table_groups[$table_name])) {
$table_groups[$table_name] = array();
}
$group =& $table_groups;
@@ -963,7 +963,7 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
* in a string. In some special cases on sql.php, buffering has to be disabled
* and hence we check with $GLOBALS['buffer_message']
*/
- if( $GLOBALS['is_ajax_request'] == true && !isset($GLOBALS['buffer_message']) ) {
+ if( $GLOBALS['is_ajax_request'] == true && ! isset($GLOBALS['buffer_message']) ) {
ob_start();
}
global $cfg;
@@ -1255,15 +1255,15 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
// in the tools div, only display the Inline link when not in ajax
// mode because 1) it currently does not work and 2) we would
- // have two similar mechanisms on the page for the same goal
+ // have two similar mechanisms on the page for the same goal
if ($is_select || $GLOBALS['is_ajax_request'] === false) {
// see in js/functions.js the jQuery code attached to id inline_edit
// document.write conflicts with jQuery, hence used $().append()
echo "