diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 572b187e0f90..c8f8e2d2dedc 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -1342,43 +1342,41 @@ public static function getMessage( } $retval .= '
'; + $retval .= '
'; + $retval .= PMA_generate_common_hidden_inputs( + $GLOBALS['db'], $GLOBALS['table'] + ); + $retval .= ''; + // avoid displaying a Profiling checkbox that could // be checked, which would reexecute an INSERT, for example - if (! empty($refresh_link)) { - $retval .= self::getProfilingForm($sql_query); - } - // if needed, generate an invisible form that contains controls for the - // Inline link; this way, the behavior of the Inline link does not - // depend on the profiling support or on the refresh link - if (empty($refresh_link) || !self::profilingSupported()) { - $retval .= ''; - $retval .= PMA_generate_common_hidden_inputs( - $GLOBALS['db'], $GLOBALS['table'] + if (! empty($refresh_link) && self::profilingSupported()) { + $retval .= ''; + $retval .= self::getCheckbox( + 'profiling', __('Profiling'), isset($_SESSION['profiling']), true ); - $retval .= ''; - $retval .= '
'; } + $retval .= ''; - // 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 - if ($is_select || ($GLOBALS['is_ajax_request'] === false) + /** + * TODO: Should we have $cfg['SQLQuery']['InlineEdit']? + */ + if (! empty($cfg['SQLQuery']['Edit']) + && $is_select && ! $query_too_big ) { - // see in js/functions.js the jQuery code attached to id inline_edit - // document.write conflicts with jQuery, hence used $().append() - $retval .= ""; + $inline_edit_link = ' [' + . self::linkOrButton( + '#', + _pgettext('Inline edit query', 'Inline'), + array('class' => 'inline_edit_sql') + ) + . ']'; + } else { + $inline_edit_link = ''; } - $retval .= $edit_link . $explain_link . $php_link + $retval .= $inline_edit_link . $edit_link . $explain_link . $php_link . $refresh_link . $validate_link; $retval .= '
'; } @@ -1417,38 +1415,6 @@ public static function profilingSupported() return self::cacheGet('profiling_supported', true); } - /** - * Returns HTML for the form with the Profiling checkbox - * - * @param string $sql_query sql query - * - * @return string HTML for the form with the Profiling checkbox - * - * @access public - */ - public static function getProfilingForm($sql_query) - { - $retval = ''; - if (self::profilingSupported()) { - - $retval .= '
' . "\n"; - $retval .= PMA_generate_common_hidden_inputs( - $GLOBALS['db'], $GLOBALS['table'] - ); - - $retval .= '' . "\n" - . '' . "\n"; - - $retval .= self::getCheckbox( - 'profiling', __('Profiling'), isset($_SESSION['profiling']), true - ); - $retval .= '
' . "\n"; - - } - return $retval; - } - /** * Formats $value to byte view *