diff --git a/libraries/Util.php b/libraries/Util.php index 91b144765e..27d83f2276 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -1164,6 +1164,8 @@ class Util if (! empty($GLOBALS['show_as_php'])) { $query_base = '$sql = \'' . $query_base; + $query_base = '
' . "\n"
+                    . $query_base;
             } elseif (isset($query_base)) {
                 $query_base = self::formatSql($query_base);
             }
@@ -1234,7 +1236,9 @@ class Util
 
             // even if the query is big and was truncated, offer the chance
             // to edit it (unless it's enormous, see linkOrButton() )
-            if (! empty($cfg['SQLQuery']['Edit'])) {
+            if (! empty($cfg['SQLQuery']['Edit'])
+                && empty($GLOBALS['show_as_php'])
+            ) {
                 $edit_link .= PMA_URL_getCommon($url_params) . '#querybox';
                 $edit_link = ' ['
                     . self::linkOrButton($edit_link, __('Edit'))
@@ -1307,7 +1311,8 @@ class Util
 
             //Clean up the end of the PHP
             if (! empty($GLOBALS['show_as_php'])) {
-                $retval .= '\';';
+                $retval .= '\';' . "\n"
+                    . '
'; } $retval .= ''; @@ -1333,7 +1338,10 @@ class Util /** * TODO: Should we have $cfg['SQLQuery']['InlineEdit']? */ - if (! empty($cfg['SQLQuery']['Edit']) && ! $query_too_big) { + if (! empty($cfg['SQLQuery']['Edit']) + && ! $query_too_big + && empty($GLOBALS['show_as_php']) + ) { $inline_edit_link = ' [' . self::linkOrButton( '#', diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index d7c164f719..9ea932ffad 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -1433,6 +1433,10 @@ function PMA_getQueryResponseForNoResultsReturned($analyzed_sql_results, $db, } $html_output = ''; + $html_message = PMA\libraries\Util::getMessage( + $message, $GLOBALS['sql_query'], 'success' + ); + $html_output .= $html_message; if (!isset($GLOBALS['show_as_php'])) { if (! empty($GLOBALS['reload'])) { @@ -1440,11 +1444,6 @@ function PMA_getQueryResponseForNoResultsReturned($analyzed_sql_results, $db, $extra_data['db'] = $GLOBALS['db']; } - $html_message = PMA\libraries\Util::getMessage( - $message, $GLOBALS['sql_query'], 'success' - ); - $html_output .= $html_message; - // For ajax requests add message and sql_query as JSON if (empty($_REQUEST['ajax_page_request'])) { $extra_data['message'] = $message; diff --git a/themes/original/css/common.css.php b/themes/original/css/common.css.php index 13b4b3debc..05b374e773 100644 --- a/themes/original/css/common.css.php +++ b/themes/original/css/common.css.php @@ -1355,6 +1355,16 @@ label.desc sup { position: absolute; } +code.php { + display: block; + padding-left: 0.3em; + margin-top: 0; + margin-bottom: 0; + max-height: 10em; + overflow: auto; + direction: ltr; +} + code.sql, div.sqlvalidate { display: block; diff --git a/themes/pmahomme/css/common.css.php b/themes/pmahomme/css/common.css.php index a4177400f3..e19395c056 100644 --- a/themes/pmahomme/css/common.css.php +++ b/themes/pmahomme/css/common.css.php @@ -1786,6 +1786,16 @@ label.desc sup { position: absolute; } +code.php { + display: block; + padding-left: 1em; + margin-top: 0; + margin-bottom: 0; + max-height: 10em; + overflow: auto; + direction: ltr; +} + code.sql, div.sqlvalidate { display: block;