From c88762e3860abd94c41ad609e6b05c1976dea94a Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Thu, 23 May 2013 23:54:29 +0530 Subject: [PATCH] Include profiling scripts initially, bug#3639 in QA_4_0 --- libraries/common.inc.php | 17 ++++++++++++++++- sql.php | 13 ------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 5e0976827d..bbea065bd6 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -1030,12 +1030,27 @@ if (! defined('PMA_MINIMUM_COMMON')) { // the checkbox was unchecked unset($_SESSION['profiling']); } + /** + * Inclusion of profiling scripts is needed on various + * pages like sql, tbl_sql, db_sql, tbl_select + */ + $response = PMA_Response::getInstance(); + if (isset($_SESSION['profiling'])) { + $header = $response->getHeader(); + $scripts = $header->getScripts(); + /* < IE 9 doesn't support canvas natively */ + if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) { + $scripts->addFile('canvg/flashcanvas.js'); + } + $scripts->addFile('jqplot/jquery.jqplot.js'); + $scripts->addFile('jqplot/plugins/jqplot.pieRenderer.js'); + $scripts->addFile('canvg/canvg.js'); + } /* * There is no point in even attempting to process * an ajax request if there is a token mismatch */ - $response = PMA_Response::getInstance(); if ($response->isAjax() && $token_mismatch) { $response->isSuccess(false); $response->addJSON( diff --git a/sql.php b/sql.php index ab7c4d8207..35d2c67618 100644 --- a/sql.php +++ b/sql.php @@ -67,19 +67,6 @@ if (isset($_REQUEST['printview'])) { $GLOBALS['printview'] = $_REQUEST['printview']; } -if (isset($_SESSION['profiling'])) { - $response = PMA_Response::getInstance(); - $header = $response->getHeader(); - $scripts = $header->getScripts(); - /* < IE 9 doesn't support canvas natively */ - if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) { - $scripts->addFile('canvg/flashcanvas.js'); - } - $scripts->addFile('jqplot/jquery.jqplot.js'); - $scripts->addFile('jqplot/plugins/jqplot.pieRenderer.js'); - $scripts->addFile('canvg/canvg.js'); -} - if (!isset($_SESSION['is_multi_query'])) { $_SESSION['is_multi_query'] = false; }