diff --git a/ChangeLog b/ChangeLog index 5a15934e76..5bbab72c7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ phpMyAdmin - ChangeLog ====================== +3.5.0.0 (not yet released) + 3.4.0.0 (not yet released) + rfe #2890226 [view] Enable VIEW rename + rfe #838637 [privileges] Export a user's privileges diff --git a/Documentation.html b/Documentation.html index aa3df7f7a5..cee6a4211e 100644 --- a/Documentation.html +++ b/Documentation.html @@ -9,7 +9,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 - phpMyAdmin 3.4.0-rc3-dev - Documentation + phpMyAdmin 3.5.0-dev - Documentation @@ -17,7 +17,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 diff --git a/README b/README index 1504628d27..bbc7762236 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ phpMyAdmin - Readme =================== -Version 3.4.0-rc3-dev +Version 3.5.0-dev A set of PHP-scripts to manage MySQL over the web. diff --git a/db_operations.php b/db_operations.php index 558766407e..f48ba27678 100644 --- a/db_operations.php +++ b/db_operations.php @@ -349,11 +349,6 @@ if ($db == 'information_schema') { } if (!$is_information_schema) { - ?> -
- -
- +
+ +
+ execute it, else display the headers + * A query has been submitted -> (maybe) execute it */ +$message_to_display = false; if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) { - $goto = 'db_sql.php'; - $message_to_show = htmlspecialchars(__('Your SQL query has been executed successfully')); - require './sql.php'; - exit; -} else { - $sub_part = '_qbe'; - require './libraries/db_common.inc.php'; - $url_query .= '&goto=db_qbe.php'; - $url_params['goto'] = 'db_qbe.php'; - require './libraries/db_info.inc.php'; + if (! preg_match('@^SELECT@i', $sql_query)) { + $message_to_display = true; + } else { + $goto = 'db_sql.php'; + require './sql.php'; + exit; + } } -if (isset($_REQUEST['submit_sql']) - && ! preg_match('@^SELECT@i', $sql_query)) { - PMA_Message::warning(__('You have to choose at least one column to display'))->display(); -} +$sub_part = '_qbe'; +require './libraries/db_common.inc.php'; +$url_query .= '&goto=db_qbe.php'; +$url_params['goto'] = 'db_qbe.php'; +require './libraries/db_info.inc.php'; +if ($message_to_display) { + PMA_Message::error(__('You have to choose at least one column to display'))->display(); +} +unset($message_to_display); /** * Initialize some variables diff --git a/js/functions.js b/js/functions.js index d808a0cea0..52c3c287f4 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/Config.class.php b/libraries/Config.class.php index 04451ddd04..4c2f281bb0 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -96,7 +96,7 @@ class PMA_Config */ function checkSystem() { - $this->set('PMA_VERSION', '3.4.0-rc3-dev'); + $this->set('PMA_VERSION', '3.5.0-dev'); /** * @deprecated */ diff --git a/libraries/Index.class.php b/libraries/Index.class.php index 6fc0bec097..ee266aa137 100644 --- a/libraries/Index.class.php +++ b/libraries/Index.class.php @@ -424,7 +424,7 @@ class PMA_Index $indexes = PMA_Index::getFromTable($table, $schema); if (count($indexes) < 1) { - return PMA_Message::warning(__('No index defined!'))->getDisplay(); + return PMA_Message::error(__('No index defined!'))->getDisplay(); } $r = ''; @@ -576,7 +576,7 @@ class PMA_Index // did not find any difference // so it makes no sense to have this two equal indexes - $message = PMA_Message::warning(__('The indexes %1$s and %2$s seem to be equal and one of them could possibly be removed.')); + $message = PMA_Message::error(__('The indexes %1$s and %2$s seem to be equal and one of them could possibly be removed.')); $message->addParam($each_index->getName()); $message->addParam($while_index->getName()); $output .= $message->getDisplay(); 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/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..49937c8ed6 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -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 ca4eebefcd..4ff850b242 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -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) { @@ -1261,9 +1261,9 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view // document.write conflicts with jQuery, hence used $().append() echo "